[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 217/473: Remove unnecessary reloading of applications.
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:56:27 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 642bf9f8f545e910bcdb96cd59e0bb9d36067919
Author: Graeme Gott <graeme at gottcode.org>
Date: Sun Nov 3 07:14:07 2013 -0500
Remove unnecessary reloading of applications.
---
panel-plugin/applications-page.cpp | 10 ++++++++++
panel-plugin/applications-page.h | 1 +
panel-plugin/configuration-dialog.cpp | 5 -----
panel-plugin/window.cpp | 26 ++++++++++++++------------
4 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index eeeb8ad..275d86b 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -158,6 +158,16 @@ void ApplicationsPage::load_applications()
//-----------------------------------------------------------------------------
+void ApplicationsPage::reload_category_icon_size()
+{
+ for (std::vector<Category*>::const_iterator i = m_categories.begin(), end = m_categories.end(); i != end; ++i)
+ {
+ (*i)->get_button()->reload_icon_size();
+ }
+}
+
+//-----------------------------------------------------------------------------
+
void ApplicationsPage::clear_applications()
{
// Free categories
diff --git a/panel-plugin/applications-page.h b/panel-plugin/applications-page.h
index 47d6026..5559508 100644
--- a/panel-plugin/applications-page.h
+++ b/panel-plugin/applications-page.h
@@ -48,6 +48,7 @@ public:
void invalidate_applications();
void load_applications();
+ void reload_category_icon_size();
private:
void apply_filter(GtkToggleButton* togglebutton);
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index bdd16be..fbba8da 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -115,7 +115,6 @@ void ConfigurationDialog::choose_icon()
void ConfigurationDialog::category_icon_size_changed(GtkComboBox* combo)
{
wm_settings->category_icon_size = gtk_combo_box_get_active(combo);
- m_plugin->reload();
}
//-----------------------------------------------------------------------------
@@ -123,7 +122,6 @@ void ConfigurationDialog::category_icon_size_changed(GtkComboBox* combo)
void ConfigurationDialog::item_icon_size_changed(GtkComboBox* combo)
{
wm_settings->launcher_icon_size = gtk_combo_box_get_active(combo);
- m_plugin->reload();
}
//-----------------------------------------------------------------------------
@@ -171,7 +169,6 @@ void ConfigurationDialog::toggle_position_search_alternate(GtkToggleButton* butt
bool active = gtk_toggle_button_get_active(button);
wm_settings->position_search_alternate = gtk_toggle_button_get_active(button);
gtk_widget_set_sensitive(GTK_WIDGET(m_position_commands_alternate), active);
- m_plugin->reload();
}
//-----------------------------------------------------------------------------
@@ -179,7 +176,6 @@ void ConfigurationDialog::toggle_position_search_alternate(GtkToggleButton* butt
void ConfigurationDialog::toggle_position_commands_alternate(GtkToggleButton* button)
{
wm_settings->position_commands_alternate = gtk_toggle_button_get_active(button);
- m_plugin->reload();
}
//-----------------------------------------------------------------------------
@@ -202,7 +198,6 @@ void ConfigurationDialog::toggle_remember_favorites(GtkToggleButton* button)
void ConfigurationDialog::toggle_display_recent(GtkToggleButton* button)
{
wm_settings->display_recent = gtk_toggle_button_get_active(button);
- m_plugin->reload();
}
//-----------------------------------------------------------------------------
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 2552447..01e5011 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -242,18 +242,6 @@ void Window::hide()
// Hide window
gtk_widget_hide(GTK_WIDGET(m_window));
- // Update default page
- if (wm_settings->display_recent && (m_default_page == m_favorites))
- {
- m_default_button = m_recent_button;
- m_default_page = m_recent;
- }
- else if (!wm_settings->display_recent && (m_default_page == m_recent))
- {
- m_default_button = m_favorites_button;
- m_default_page = m_favorites;
- }
-
// Reset mouse cursor by forcing default page to hide
gtk_widget_hide(m_default_page->get_widget());
@@ -268,6 +256,7 @@ void Window::show(GtkWidget* parent, bool horizontal)
// Make sure icon sizes are correct
m_favorites_button->reload_icon_size();
m_recent_button->reload_icon_size();
+ m_applications->reload_category_icon_size();
m_search_results->get_view()->reload_icon_size();
m_favorites->get_view()->reload_icon_size();
@@ -285,6 +274,19 @@ void Window::show(GtkWidget* parent, bool horizontal)
// Reset mouse cursor by forcing default page to hide
gtk_widget_show(m_default_page->get_widget());
+ // Update default page
+ if (wm_settings->display_recent && (m_default_page == m_favorites))
+ {
+ m_default_button = m_recent_button;
+ m_default_page = m_recent;
+ }
+ else if (!wm_settings->display_recent && (m_default_page == m_recent))
+ {
+ m_default_button = m_favorites_button;
+ m_default_page = m_favorites;
+ }
+ show_default_page();
+
GdkScreen* screen = NULL;
int parent_x = 0, parent_y = 0, parent_w = 0, parent_h = 0;
if (parent != NULL)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list