[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 255/473: Merge configuration dialog behavior tabs.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:57:05 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 2277003b3c870b3ee3c8ebb114bac6528ad96d6d
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Nov 20 18:33:22 2013 -0500

    Merge configuration dialog behavior tabs.
---
 panel-plugin/command-edit.cpp         |   19 +++++------------
 panel-plugin/command-edit.h           |    2 +-
 panel-plugin/configuration-dialog.cpp |   38 ++++++++++++++-------------------
 panel-plugin/configuration-dialog.h   |    2 --
 4 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/panel-plugin/command-edit.cpp b/panel-plugin/command-edit.cpp
index 094b9b6..e06a824 100644
--- a/panel-plugin/command-edit.cpp
+++ b/panel-plugin/command-edit.cpp
@@ -25,34 +25,25 @@ using namespace WhiskerMenu;
 
 //-----------------------------------------------------------------------------
 
-CommandEdit::CommandEdit(Command* command) :
+CommandEdit::CommandEdit(Command* command, GtkSizeGroup* label_size_group) :
 	m_command(command)
 {
-	m_widget = gtk_vbox_new(false, 6);
+	m_widget = gtk_hbox_new(false, 6);
 
 	m_shown = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_mnemonic(m_command->get_text()));
 	gtk_toggle_button_set_active(m_shown, m_command->get_shown());
 	gtk_box_pack_start(GTK_BOX(m_widget), GTK_WIDGET(m_shown), false, false, 0);
+	gtk_size_group_add_widget(label_size_group, GTK_WIDGET(m_shown));
 	g_signal_connect(m_shown, "toggled", G_CALLBACK(CommandEdit::shown_toggled_slot), this);
 
-	GtkAlignment* alignment = GTK_ALIGNMENT(gtk_alignment_new(0.0, 0.0, 1.0, 1.0));
-	gtk_alignment_set_padding(alignment, 0, 0, 18, 0);
-	gtk_box_pack_start(GTK_BOX(m_widget), GTK_WIDGET(alignment), false, false, 0);
-
-	GtkBox* hbox = GTK_BOX(gtk_hbox_new(false, 6));
-	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(hbox));
-
-	GtkWidget* label = gtk_label_new(_("Command:"));
-	gtk_box_pack_start(hbox, label, false, false, 6);
-
 	m_entry = GTK_ENTRY(gtk_entry_new());
 	gtk_entry_set_text(m_entry, m_command->get());
-	gtk_box_pack_start(hbox, GTK_WIDGET(m_entry), true, true, 0);
+	gtk_box_pack_start(GTK_BOX(m_widget), GTK_WIDGET(m_entry), true, true, 0);
 	g_signal_connect(m_entry, "changed", G_CALLBACK(CommandEdit::command_changed_slot), this);
 
 	m_browse_button = gtk_button_new();
 	gtk_widget_set_tooltip_text(m_browse_button, _("Browse the file system to choose a custom command."));
-	gtk_box_pack_start(hbox, m_browse_button, false, false, 0);
+	gtk_box_pack_start(GTK_BOX(m_widget), m_browse_button, false, false, 0);
 	gtk_widget_show(m_browse_button);
 
 	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
diff --git a/panel-plugin/command-edit.h b/panel-plugin/command-edit.h
index 5a89ed9..3a39034 100644
--- a/panel-plugin/command-edit.h
+++ b/panel-plugin/command-edit.h
@@ -28,7 +28,7 @@ class Command;
 class CommandEdit
 {
 public:
-	CommandEdit(Command* command);
+	CommandEdit(Command* command, GtkSizeGroup* label_size_group);
 
 	GtkWidget* get_widget() const
 	{
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index 80e1f24..263ac75 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -59,7 +59,6 @@ ConfigurationDialog::ConfigurationDialog(Plugin* plugin) :
 	GtkNotebook* notebook = GTK_NOTEBOOK(gtk_notebook_new());
 	gtk_notebook_append_page(notebook, init_appearance_tab(), gtk_label_new_with_mnemonic(_("_Appearance")));
 	gtk_notebook_append_page(notebook, init_behavior_tab(), gtk_label_new_with_mnemonic(_("_Behavior")));
-	gtk_notebook_append_page(notebook, init_commands_tab(), gtk_label_new_with_mnemonic(_("_Commands")));
 
 	// Add tabs to dialog
 	GtkBox* vbox = GTK_BOX(gtk_vbox_new(false, 8));
@@ -80,6 +79,7 @@ ConfigurationDialog::~ConfigurationDialog()
 {
 	delete m_settings_command;
 	delete m_lockscreen_command;
+	delete m_switchuser_command;
 	delete m_logout_command;
 	delete m_menueditor_command;
 
@@ -409,38 +409,32 @@ GtkWidget* ConfigurationDialog::init_behavior_tab()
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_display_recent), wm_settings->display_recent);
 	g_signal_connect(m_display_recent, "toggled", G_CALLBACK(ConfigurationDialog::toggle_display_recent_slot), this);
 
-	return page;
-}
-
-//-----------------------------------------------------------------------------
-
-GtkWidget* ConfigurationDialog::init_commands_tab()
-{
 	// Create commands section
-	GtkWidget* page = gtk_alignment_new(0, 0, 1, 0);
-	gtk_container_set_border_width(GTK_CONTAINER(page), 8);
-	GtkBox* panel_vbox = GTK_BOX(gtk_vbox_new(false, 18));
-	gtk_container_add(GTK_CONTAINER(page), GTK_WIDGET(panel_vbox));
+	GtkSizeGroup* label_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+	GtkBox* commands_vbox = GTK_BOX(gtk_vbox_new(false, 6));
+	GtkWidget* commands_frame = xfce_gtk_frame_box_new_with_content(_("Commands"), GTK_WIDGET(commands_vbox));
+	gtk_box_pack_start(behavior_vbox, commands_frame, false, false, 6);
+	gtk_container_set_border_width(GTK_CONTAINER(commands_frame), 0);
 
 	// Add settings command entry
-	m_settings_command = new CommandEdit(wm_settings->command_settings);
-	gtk_box_pack_start(panel_vbox, m_settings_command->get_widget(), false, false, 0);
+	m_settings_command = new CommandEdit(wm_settings->command_settings, label_size_group);
+	gtk_box_pack_start(commands_vbox, m_settings_command->get_widget(), false, false, 0);
 
 	// Add lock screen command entry
-	m_lockscreen_command = new CommandEdit(wm_settings->command_lockscreen);
-	gtk_box_pack_start(panel_vbox, m_lockscreen_command->get_widget(), false, false, 0);
+	m_lockscreen_command = new CommandEdit(wm_settings->command_lockscreen, label_size_group);
+	gtk_box_pack_start(commands_vbox, m_lockscreen_command->get_widget(), false, false, 0);
 
 	// Add switch user command entry
-	m_switchuser_command = new CommandEdit(wm_settings->command_switchuser);
-	gtk_box_pack_start(panel_vbox, m_switchuser_command->get_widget(), false, false, 0);
+	m_switchuser_command = new CommandEdit(wm_settings->command_switchuser, label_size_group);
+	gtk_box_pack_start(commands_vbox, m_switchuser_command->get_widget(), false, false, 0);
 
 	// Add log out command entry
-	m_logout_command = new CommandEdit(wm_settings->command_logout);
-	gtk_box_pack_start(panel_vbox, m_logout_command->get_widget(), false, false, 0);
+	m_logout_command = new CommandEdit(wm_settings->command_logout, label_size_group);
+	gtk_box_pack_start(commands_vbox, m_logout_command->get_widget(), false, false, 0);
 
 	// Add menu editor command entry
-	m_menueditor_command = new CommandEdit(wm_settings->command_menueditor);
-	gtk_box_pack_start(panel_vbox, m_menueditor_command->get_widget(), false, false, 0);
+	m_menueditor_command = new CommandEdit(wm_settings->command_menueditor, label_size_group);
+	gtk_box_pack_start(commands_vbox, m_menueditor_command->get_widget(), false, false, 0);
 
 	return page;
 }
diff --git a/panel-plugin/configuration-dialog.h b/panel-plugin/configuration-dialog.h
index 1565202..ed30074 100644
--- a/panel-plugin/configuration-dialog.h
+++ b/panel-plugin/configuration-dialog.h
@@ -57,7 +57,6 @@ private:
 	void response(int response_id);
 	GtkWidget* init_appearance_tab();
 	GtkWidget* init_behavior_tab();
-	GtkWidget* init_commands_tab();
 
 private:
 	Plugin* m_plugin;
@@ -79,7 +78,6 @@ private:
 	GtkWidget* m_hover_switch_category;
 	GtkWidget* m_remember_favorites;
 	GtkWidget* m_display_recent;
-
 	CommandEdit* m_settings_command;
 	CommandEdit* m_lockscreen_command;
 	CommandEdit* m_switchuser_command;

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


More information about the Xfce4-commits mailing list