[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 03/05: Ignore descriptions with icon view.

noreply at xfce.org noreply at xfce.org
Fri Jan 24 15:15:53 CET 2020


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

g   o   t   t   c   o   d   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-whiskermenu-plugin.

commit d03e1776b46fbc86278d651bb32bbec0418b0e2b
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Jan 18 18:49:39 2020 -0500

    Ignore descriptions with icon view.
---
 panel-plugin/configuration-dialog.cpp | 8 +-------
 panel-plugin/launcher.cpp             | 2 +-
 panel-plugin/run-action.cpp           | 2 +-
 panel-plugin/search-action.cpp        | 7 ++++---
 panel-plugin/settings.cpp             | 4 ++--
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index daea5ec..5cdd485 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -231,12 +231,6 @@ void ConfigurationDialog::toggle_show_description(GtkToggleButton* button)
 	wm_settings->launcher_show_description = gtk_toggle_button_get_active(button);
 	wm_settings->set_modified();
 	m_plugin->reload();
-
-	const bool active = wm_settings->launcher_show_description;
-	if (active)
-	{
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_as_icons), false);
-	}
 }
 
 //-----------------------------------------------------------------------------
@@ -268,13 +262,13 @@ void ConfigurationDialog::toggle_show_as_icons(GtkToggleButton *button)
 {
 	wm_settings->view_as_icons = gtk_toggle_button_get_active(button);
 	wm_settings->set_modified();
+	m_plugin->reload();
 
 	const bool active = wm_settings->view_as_icons;
 	gtk_widget_set_sensitive(GTK_WIDGET(m_show_descriptions), !active);
 	gtk_widget_set_sensitive(GTK_WIDGET(m_show_hierarchy), !active);
 	if (active)
 	{
-		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_descriptions), false);
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_hierarchy), false);
 	}
 }
diff --git a/panel-plugin/launcher.cpp b/panel-plugin/launcher.cpp
index 8aa8af1..0f9c2aa 100644
--- a/panel-plugin/launcher.cpp
+++ b/panel-plugin/launcher.cpp
@@ -134,7 +134,7 @@ Launcher::Launcher(GarconMenuItem* item) :
 
 	// Create display text
 	const gchar* direction = (gtk_widget_get_default_direction() != GTK_TEXT_DIR_RTL) ? "\342\200\216" : "\342\200\217";
-	if (wm_settings->launcher_show_description)
+	if (wm_settings->launcher_show_description && !wm_settings->view_as_icons)
 	{
 		set_text(g_markup_printf_escaped("%s<b>%s</b>\n%s%s", direction, m_display_name, direction, details));
 	}
diff --git a/panel-plugin/run-action.cpp b/panel-plugin/run-action.cpp
index dc1e46c..b412367 100644
--- a/panel-plugin/run-action.cpp
+++ b/panel-plugin/run-action.cpp
@@ -69,7 +69,7 @@ guint RunAction::search(const Query& query)
 	// Set item text
 	const gchar* direction = (gtk_widget_get_default_direction() != GTK_TEXT_DIR_RTL) ? "\342\200\216" : "\342\200\217";
 	gchar* display_name = g_strdup_printf(_("Run %s"), m_command_line.c_str());
-	if (wm_settings->launcher_show_description)
+	if (wm_settings->launcher_show_description && !wm_settings->view_as_icons)
 	{
 		set_text(g_markup_printf_escaped("%s<b>%s</b>\n", direction, display_name));
 	}
diff --git a/panel-plugin/search-action.cpp b/panel-plugin/search-action.cpp
index 7819494..e898089 100644
--- a/panel-plugin/search-action.cpp
+++ b/panel-plugin/search-action.cpp
@@ -73,9 +73,10 @@ guint SearchAction::search(const Query& query)
 	const gchar* haystack = query.raw_query().c_str();
 	guint found = !m_is_regex ? match_prefix(haystack) : match_regex(haystack);
 
-	if ((found != G_MAXUINT) && (m_show_description != wm_settings->launcher_show_description))
+	const bool show_description = wm_settings->launcher_show_description && !wm_settings->view_as_icons;
+	if ((found != G_MAXUINT) && (m_show_description != show_description))
 	{
-		m_show_description = wm_settings->launcher_show_description;
+		m_show_description = show_description;
 		update_text();
 	}
 
@@ -202,7 +203,7 @@ void SearchAction::set_name(const gchar* name)
 	m_name = name;
 	wm_settings->set_modified();
 
-	m_show_description = wm_settings->launcher_show_description;
+	m_show_description = wm_settings->launcher_show_description && !wm_settings->view_as_icons;
 	update_text();
 }
 
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index 444893b..516122b 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -96,7 +96,7 @@ Settings::Settings() :
 	button_single_row(false),
 
 	launcher_show_name(true),
-	launcher_show_description(false),
+	launcher_show_description(true),
 	launcher_show_tooltip(true),
 	launcher_icon_size(IconSize::Normal),
 
@@ -242,7 +242,7 @@ void Settings::load(char* file)
 	category_show_name = xfce_rc_read_bool_entry(rc, "category-show-name", category_show_name) || (category_icon_size == -1);
 
 	load_hierarchy = xfce_rc_read_bool_entry(rc, "load-hierarchy", load_hierarchy);
-	view_as_icons = xfce_rc_read_bool_entry(rc, "view-as-icons", view_as_icons) && !launcher_show_description && !load_hierarchy;
+	view_as_icons = xfce_rc_read_bool_entry(rc, "view-as-icons", view_as_icons) && !load_hierarchy;
 
 	recent_items_max = std::max(0, xfce_rc_read_int_entry(rc, "recent-items-max", recent_items_max));
 	favorites_in_recent = xfce_rc_read_bool_entry(rc, "favorites-in-recent", favorites_in_recent);

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


More information about the Xfce4-commits mailing list