[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 455/473: Adjust configuration dialog widget sizes.

noreply at xfce.org noreply at xfce.org
Tue Feb 17 00:00:25 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 6b40417994773c0a38df2ff6e2a85c091949d05e
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Feb 10 09:29:34 2015 -0500

    Adjust configuration dialog widget sizes.
---
 panel-plugin/configuration-dialog.cpp |   93 ++++++++++++++-------------------
 1 file changed, 38 insertions(+), 55 deletions(-)

diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index 9a3b484..c55e5b0 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -481,103 +481,94 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
 
 
 	// Create panel button section
-	GtkSizeGroup* label_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-	GtkBox* panel_vbox = GTK_BOX(gtk_vbox_new(false, 6));
-	GtkWidget* panel_frame = xfce_gtk_frame_box_new_with_content(_("Panel Button"), GTK_WIDGET(panel_vbox));
+	GtkTable* panel_table = GTK_TABLE(gtk_table_new(4, 2, false));
+	gtk_table_set_col_spacings(panel_table, 12);
+	gtk_table_set_row_spacings(panel_table, 6);
+
+	GtkWidget* panel_frame = xfce_gtk_frame_box_new_with_content(_("Panel Button"), GTK_WIDGET(panel_table));
 	gtk_box_pack_start(contents_vbox, panel_frame, false, false, 6);
 	gtk_container_set_border_width(GTK_CONTAINER(panel_frame), 0);
 
 	// Add button style selector
-	GtkBox* hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(panel_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	GtkWidget* label = gtk_label_new_with_mnemonic(_("Di_splay:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(panel_table, label, 0, 1, 0, 1, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_button_style = gtk_combo_box_text_new();
 	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(m_button_style), _("Icon"));
 	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(m_button_style), _("Title"));
 	gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(m_button_style), _("Icon and title"));
 	gtk_combo_box_set_active(GTK_COMBO_BOX(m_button_style), static_cast<int>(m_plugin->get_button_style()) - 1);
-	gtk_box_pack_start(hbox, m_button_style, false, false, 0);
+	gtk_table_attach_defaults(panel_table, m_button_style, 1, 2, 0, 1);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_button_style);
 	g_signal_connect_slot(m_button_style, "changed", &ConfigurationDialog::style_changed, this);
 
 	// Add title selector
-	hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(panel_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	label = gtk_label_new_with_mnemonic(_("_Title:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(panel_table, label, 0, 1, 1, 2, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_title = gtk_entry_new();
 	gtk_entry_set_text(GTK_ENTRY(m_title), m_plugin->get_button_title().c_str());
-	gtk_box_pack_start(hbox, m_title, true, true, 0);
+	gtk_table_attach_defaults(panel_table, m_title, 1, 2, 1, 2);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_title);
 	g_signal_connect_slot(m_title, "changed", &ConfigurationDialog::title_changed, this);
 
 	// Add icon selector
-	hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(panel_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	label = gtk_label_new_with_mnemonic(_("_Icon:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(panel_table, label, 0, 1, 2, 3, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_icon_button = gtk_button_new();
-	gtk_box_pack_start(hbox, m_icon_button, false, false, 0);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_icon_button);
 	g_signal_connect_slot<GtkButton*>(m_icon_button, "clicked", &ConfigurationDialog::choose_icon, this);
+	GtkWidget* icon_alignment = gtk_alignment_new(0, 0, 0, 1);
+	gtk_container_add(GTK_CONTAINER(icon_alignment), m_icon_button);
+	gtk_table_attach_defaults(panel_table, icon_alignment, 1, 2, 2, 3);
 
 	m_icon = xfce_panel_image_new_from_source(m_plugin->get_button_icon_name().c_str());
 	xfce_panel_image_set_size(XFCE_PANEL_IMAGE(m_icon), 48);
 	gtk_container_add(GTK_CONTAINER(m_icon_button), m_icon);
 
 	m_button_single_row = gtk_check_button_new_with_mnemonic(_("Use a single _panel row"));
-	gtk_box_pack_start(panel_vbox, m_button_single_row, true, true, 0);
+	gtk_table_attach_defaults(panel_table, m_button_single_row, 1, 2, 3, 4);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button_single_row), wm_settings->button_single_row);
 	gtk_widget_set_sensitive(m_button_single_row, gtk_combo_box_get_active(GTK_COMBO_BOX (m_button_style)) == 0);
 	g_signal_connect_slot(m_button_single_row, "toggled", &ConfigurationDialog::toggle_button_single_row, this);
+	gtk_widget_show(m_button_single_row);
 
 
 	// Create menu section
-	label_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-	GtkBox* appearance_vbox = GTK_BOX(gtk_vbox_new(false, 6));
-	GtkWidget* appearance_frame = xfce_gtk_frame_box_new_with_content(_("Menu"), GTK_WIDGET(appearance_vbox));
+	GtkTable* menu_table = GTK_TABLE(gtk_table_new(6, 2, false));
+	gtk_table_set_col_spacings(menu_table, 12);
+	gtk_table_set_row_spacings(menu_table, 6);
+
+	GtkWidget* appearance_frame = xfce_gtk_frame_box_new_with_content(_("Menu"), GTK_WIDGET(menu_table));
 	gtk_box_pack_start(contents_vbox, appearance_frame, false, false, 6);
 	gtk_container_set_border_width(GTK_CONTAINER(appearance_frame), 0);
 
 	// Add option to use generic names
 	m_show_generic_names = gtk_check_button_new_with_mnemonic(_("Show generic application _names"));
-	gtk_box_pack_start(appearance_vbox, m_show_generic_names, true, true, 0);
+	gtk_table_attach_defaults(menu_table, m_show_generic_names, 0, 2, 0, 1);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_generic_names), !wm_settings->launcher_show_name);
 	g_signal_connect_slot(m_show_generic_names, "toggled", &ConfigurationDialog::toggle_show_generic_name, this);
 
 	// Add option to hide descriptions
 	m_show_descriptions = gtk_check_button_new_with_mnemonic(_("Show application _descriptions"));
-	gtk_box_pack_start(appearance_vbox, m_show_descriptions, true, true, 0);
+	gtk_table_attach_defaults(menu_table, m_show_descriptions, 0, 2, 1, 2);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_descriptions), wm_settings->launcher_show_description);
 	g_signal_connect_slot(m_show_descriptions, "toggled", &ConfigurationDialog::toggle_show_description, this);
 
 	// Add option to show menu hierarchy
 	m_show_hierarchy = gtk_check_button_new_with_mnemonic(_("Show menu subcatego_ries"));
-	gtk_box_pack_start(appearance_vbox, m_show_hierarchy, true, true, 0);
+	gtk_table_attach_defaults(menu_table, m_show_hierarchy, 0, 2, 2, 3);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_hierarchy), wm_settings->load_hierarchy);
 	g_signal_connect_slot(m_show_hierarchy, "toggled", &ConfigurationDialog::toggle_show_hierarchy, this);
 
 	// Add item icon size selector
-	hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(appearance_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	label = gtk_label_new_with_mnemonic(_("Ite_m icon size:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(menu_table, label, 0, 1, 3, 4, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_item_icon_size = gtk_combo_box_text_new();
 	std::vector<std::string> icon_sizes = IconSize::get_strings();
@@ -586,18 +577,14 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
 		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(m_item_icon_size), i->c_str());
 	}
 	gtk_combo_box_set_active(GTK_COMBO_BOX(m_item_icon_size), wm_settings->launcher_icon_size + 1);
-	gtk_box_pack_start(hbox, m_item_icon_size, false, false, 0);
+	gtk_table_attach_defaults(menu_table, m_item_icon_size, 1, 2, 3, 4);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_item_icon_size);
 	g_signal_connect_slot(m_item_icon_size, "changed", &ConfigurationDialog::item_icon_size_changed, this);
 
 	// Add category icon size selector
-	hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(appearance_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	label = gtk_label_new_with_mnemonic(_("Categ_ory icon size:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(menu_table, label, 0, 1, 4, 5, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_category_icon_size = gtk_combo_box_text_new();
 	for (std::vector<std::string>::const_iterator i = icon_sizes.begin(), end = icon_sizes.end(); i != end; ++i)
@@ -605,21 +592,17 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
 		gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(m_category_icon_size), i->c_str());
 	}
 	gtk_combo_box_set_active(GTK_COMBO_BOX(m_category_icon_size), wm_settings->category_icon_size + 1);
-	gtk_box_pack_start(hbox, m_category_icon_size, false, false, 0);
+	gtk_table_attach_defaults(menu_table, m_category_icon_size, 1, 2, 4, 5);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_category_icon_size);
 	g_signal_connect_slot(m_category_icon_size, "changed", &ConfigurationDialog::category_icon_size_changed, this);
 
 	// Add option to control background opacity
-	hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(appearance_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	label = gtk_label_new_with_mnemonic(_("Background opacit_y:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
-	gtk_size_group_add_widget(label_size_group, label);
+	gtk_table_attach(menu_table, label, 0, 1, 5, 6, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_background_opacity = gtk_hscale_new_with_range(0.0, 100.0, 1.0);
-	gtk_box_pack_start(hbox, m_background_opacity, true, true, 0);
+	gtk_table_attach_defaults(menu_table, m_background_opacity, 1, 2, 5, 6);
 	gtk_scale_set_value_pos(GTK_SCALE(m_background_opacity), GTK_POS_RIGHT);
 	gtk_range_set_value(GTK_RANGE(m_background_opacity), wm_settings->menu_opacity);
 	g_signal_connect_slot(m_background_opacity, "value-changed", &ConfigurationDialog::background_opacity_changed, this);
@@ -671,34 +654,34 @@ GtkWidget* ConfigurationDialog::init_behavior_tab()
 
 
 	// Create recently used section
-	GtkBox* recent_vbox = GTK_BOX(gtk_vbox_new(false, 6));
-	GtkWidget* recent_frame = xfce_gtk_frame_box_new_with_content(_("Recently Used"), GTK_WIDGET(recent_vbox));
+	GtkTable* recent_table = GTK_TABLE(gtk_table_new(3, 2, false));
+	gtk_table_set_col_spacings(recent_table, 12);
+	gtk_table_set_row_spacings(recent_table, 6);
+
+	GtkWidget* recent_frame = xfce_gtk_frame_box_new_with_content(_("Recently Used"), GTK_WIDGET(recent_table));
 	gtk_box_pack_start(contents_vbox, recent_frame, false, false, 6);
 	gtk_container_set_border_width(GTK_CONTAINER(recent_frame), 0);
 
 	// Add value to change maximum number of recently used entries
-	GtkBox* hbox = GTK_BOX(gtk_hbox_new(false, 12));
-	gtk_box_pack_start(recent_vbox, GTK_WIDGET(hbox), false, false, 0);
-
 	GtkWidget* label = gtk_label_new_with_mnemonic(_("Amount of _items:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_box_pack_start(hbox, label, false, false, 0);
+	gtk_table_attach(recent_table, label, 0, 1, 0, 1, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
 
 	m_recent_items_max = gtk_spin_button_new_with_range(5, 100, 1);
-	gtk_box_pack_start(hbox, m_recent_items_max, false, false, 0);
+	gtk_table_attach_defaults(recent_table, m_recent_items_max, 1, 2, 0, 1);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_recent_items_max);
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(m_recent_items_max), wm_settings->recent_items_max);
 	g_signal_connect_slot(m_recent_items_max, "value-changed", &ConfigurationDialog::recent_items_max_changed, this);
 
 	// Add option to remember favorites
 	m_remember_favorites = gtk_check_button_new_with_mnemonic(_("Ignore _favorites"));
-	gtk_box_pack_start(recent_vbox, m_remember_favorites, true, true, 0);
+	gtk_table_attach_defaults(recent_table, m_remember_favorites, 0, 2, 1, 2);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_remember_favorites), !wm_settings->favorites_in_recent);
 	g_signal_connect_slot(m_remember_favorites, "toggled", &ConfigurationDialog::toggle_remember_favorites, this);
 
 	// Add option to display recently used
 	m_display_recent = gtk_check_button_new_with_mnemonic(_("Display by _default"));
-	gtk_box_pack_start(recent_vbox, m_display_recent, true, true, 0);
+	gtk_table_attach_defaults(recent_table, m_display_recent, 0, 2, 2, 3);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_display_recent), wm_settings->display_recent);
 	g_signal_connect_slot(m_display_recent, "toggled", &ConfigurationDialog::toggle_display_recent, this);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list