[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 236/473: Immediately hide or show commands.
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:56:46 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 630148a5f35212af75d53743ea49589c6e824f75
Author: Graeme Gott <graeme at gottcode.org>
Date: Thu Nov 14 16:54:05 2013 -0500
Immediately hide or show commands.
---
panel-plugin/command.cpp | 31 +++++++++++++++++++++----------
panel-plugin/settings.cpp | 1 +
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/panel-plugin/command.cpp b/panel-plugin/command.cpp
index 21f23f5..37fd12f 100644
--- a/panel-plugin/command.cpp
+++ b/panel-plugin/command.cpp
@@ -133,23 +133,36 @@ GtkWidget* Command::get_menuitem()
void Command::set(const gchar* command)
{
- if (command != m_command)
+ if (command == m_command)
{
- g_free(m_command);
- m_command = g_strdup(command);
- m_status = WHISKERMENU_COMMAND_UNCHECKED;
- wm_settings->set_modified();
+ return;
}
+
+ g_free(m_command);
+ m_command = g_strdup(command);
+ m_status = WHISKERMENU_COMMAND_UNCHECKED;
+ wm_settings->set_modified();
}
//-----------------------------------------------------------------------------
void Command::set_shown(bool shown)
{
- if (shown != m_shown)
+ if (shown == m_shown)
+ {
+ return;
+ }
+
+ m_shown = shown;
+ wm_settings->set_modified();
+
+ if (m_button)
{
- m_shown = shown;
- wm_settings->set_modified();
+ gtk_widget_set_visible(m_button, m_shown);
+ }
+ if (m_menuitem)
+ {
+ gtk_widget_set_visible(m_menuitem, m_shown);
}
}
@@ -166,12 +179,10 @@ void Command::check()
if (m_button)
{
- gtk_widget_set_visible(m_button, m_shown);
gtk_widget_set_sensitive(m_button, m_status == WHISKERMENU_COMMAND_VALID);
}
if (m_menuitem)
{
- gtk_widget_set_visible(m_menuitem, m_shown);
gtk_widget_set_sensitive(m_menuitem, m_status == WHISKERMENU_COMMAND_VALID);
}
}
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index db002a5..2ef685e 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -177,6 +177,7 @@ void Settings::load(char* file)
command_settings->check();
command_lockscreen->check();
+ command_switchuser->check();
command_logout->check();
command_menueditor->check();
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list