[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 02/02: Add tooltips for program descriptions. (bug #12379)
noreply at xfce.org
noreply at xfce.org
Sun Jul 17 17:42:41 CEST 2016
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 01f8a45d37ad956ae8b788fcd5d1c20202e477d8
Author: Graeme Gott <graeme at gottcode.org>
Date: Sun Jul 17 08:56:46 2016 -0400
Add tooltips for program descriptions. (bug #12379)
---
panel-plugin/applications-page.cpp | 4 +++-
panel-plugin/category.cpp | 13 ++++++++++++-
panel-plugin/configuration-dialog.cpp | 28 +++++++++++++++++++++-------
panel-plugin/configuration-dialog.h | 4 +++-
panel-plugin/element.h | 14 ++++++++++++++
panel-plugin/favorites-page.cpp | 1 +
panel-plugin/launcher-view.cpp | 16 +++++++++++++++-
panel-plugin/launcher-view.h | 6 +++++-
panel-plugin/launcher.cpp | 3 ++-
panel-plugin/recent-page.cpp | 1 +
panel-plugin/run-action.cpp | 3 ++-
panel-plugin/search-action.cpp | 6 ++++--
panel-plugin/search-page.cpp | 5 ++++-
panel-plugin/settings.cpp | 5 ++++-
panel-plugin/settings.h | 3 ++-
panel-plugin/window.cpp | 18 +++++++++++++++++-
16 files changed, 110 insertions(+), 20 deletions(-)
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 2b9afa1..376fcb9 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,6 +80,7 @@ GtkTreeModel* ApplicationsPage::create_launcher_model(std::vector<std::string>&
LauncherView::N_COLUMNS,
G_TYPE_STRING,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_POINTER);
// Fetch menu items or remove them from list if missing
@@ -97,6 +98,7 @@ GtkTreeModel* ApplicationsPage::create_launcher_model(std::vector<std::string>&
store, NULL, G_MAXINT,
LauncherView::COLUMN_ICON, launcher->get_icon(),
LauncherView::COLUMN_TEXT, launcher->get_text(),
+ LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, launcher,
-1);
}
diff --git a/panel-plugin/category.cpp b/panel-plugin/category.cpp
index a7233f2..4f69235 100644
--- a/panel-plugin/category.cpp
+++ b/panel-plugin/category.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,10 +48,12 @@ Category::Category(GarconMenuDirectory* directory) :
{
const gchar* icon = NULL;
const gchar* text = NULL;
+ const gchar* tooltip = NULL;
if (directory)
{
icon = garcon_menu_directory_get_icon_name(directory);
text = garcon_menu_directory_get_name(directory);
+ tooltip = garcon_menu_directory_get_comment(directory);
}
else
{
@@ -60,6 +62,7 @@ Category::Category(GarconMenuDirectory* directory) :
}
set_icon(icon ? icon : "");
set_text(text ? text : "");
+ set_tooltip(tooltip ? tooltip : "");
}
//-----------------------------------------------------------------------------
@@ -103,6 +106,7 @@ GtkTreeModel* Category::get_model()
LauncherView::N_COLUMNS,
G_TYPE_STRING,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_POINTER);
insert_items(model, NULL, get_icon());
m_model = GTK_TREE_MODEL(model);
@@ -113,6 +117,7 @@ GtkTreeModel* Category::get_model()
LauncherView::N_COLUMNS,
G_TYPE_STRING,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_POINTER);
insert_items(model);
m_model = GTK_TREE_MODEL(model);
@@ -194,12 +199,14 @@ void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gcha
icon = fallback_icon;
}
gchar* text = g_markup_escape_text(category->get_text(), -1);
+ const gchar* tooltip = category->get_tooltip();
GtkTreeIter iter;
gtk_tree_store_insert_with_values(model,
&iter, parent, INT_MAX,
LauncherView::COLUMN_ICON, icon,
LauncherView::COLUMN_TEXT, text,
+ LauncherView::COLUMN_TOOLTIP, tooltip,
LauncherView::COLUMN_LAUNCHER, NULL,
-1);
g_free(text);
@@ -212,6 +219,7 @@ void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gcha
NULL, parent, INT_MAX,
LauncherView::COLUMN_ICON, launcher->get_icon(),
LauncherView::COLUMN_TEXT, launcher->get_text(),
+ LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, launcher,
-1);
}
@@ -221,6 +229,7 @@ void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gcha
NULL, parent, INT_MAX,
LauncherView::COLUMN_ICON, NULL,
LauncherView::COLUMN_TEXT, NULL,
+ LauncherView::COLUMN_TOOLTIP, NULL,
LauncherView::COLUMN_LAUNCHER, NULL,
-1);
}
@@ -241,6 +250,7 @@ void Category::insert_items(GtkListStore* model)
NULL, INT_MAX,
LauncherView::COLUMN_ICON, launcher->get_icon(),
LauncherView::COLUMN_TEXT, launcher->get_text(),
+ LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, launcher,
-1);
}
@@ -250,6 +260,7 @@ void Category::insert_items(GtkListStore* model)
NULL, INT_MAX,
LauncherView::COLUMN_ICON, NULL,
LauncherView::COLUMN_TEXT, NULL,
+ LauncherView::COLUMN_TOOLTIP, NULL,
LauncherView::COLUMN_LAUNCHER, NULL,
-1);
}
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index 71a4700..aa850bc 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -207,6 +207,14 @@ void ConfigurationDialog::toggle_show_description(GtkToggleButton* button)
//-----------------------------------------------------------------------------
+void ConfigurationDialog::toggle_show_tooltip(GtkToggleButton* button)
+{
+ wm_settings->launcher_show_tooltip = gtk_toggle_button_get_active(button);
+ wm_settings->set_modified();
+}
+
+//-----------------------------------------------------------------------------
+
void ConfigurationDialog::toggle_show_hierarchy(GtkToggleButton* button)
{
wm_settings->load_hierarchy = gtk_toggle_button_get_active(button);
@@ -581,16 +589,22 @@ GtkWidget* ConfigurationDialog::init_appearance_tab()
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 hide tooltips
+ m_show_tooltips = gtk_check_button_new_with_mnemonic(_("Show application too_ltips"));
+ gtk_table_attach_defaults(menu_table, m_show_tooltips, 0, 2, 2, 3);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_show_tooltips), wm_settings->launcher_show_tooltip);
+ g_signal_connect_slot(m_show_tooltips, "toggled", &ConfigurationDialog::toggle_show_tooltip, this);
+
// Add option to show menu hierarchy
m_show_hierarchy = gtk_check_button_new_with_mnemonic(_("Show menu hie_rarchy"));
- gtk_table_attach_defaults(menu_table, m_show_hierarchy, 0, 2, 2, 3);
+ gtk_table_attach_defaults(menu_table, m_show_hierarchy, 0, 2, 3, 4);
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
label = gtk_label_new_with_mnemonic(_("Ite_m icon size:"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
- gtk_table_attach(menu_table, label, 0, 1, 3, 4, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach(menu_table, label, 0, 1, 4, 5, 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();
@@ -599,14 +613,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_table_attach_defaults(menu_table, m_item_icon_size, 1, 2, 3, 4);
+ gtk_table_attach_defaults(menu_table, m_item_icon_size, 1, 2, 4, 5);
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
label = gtk_label_new_with_mnemonic(_("Categ_ory icon size:"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
- gtk_table_attach(menu_table, label, 0, 1, 4, 5, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach(menu_table, label, 0, 1, 5, 6, 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)
@@ -614,17 +628,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_table_attach_defaults(menu_table, m_category_icon_size, 1, 2, 4, 5);
+ gtk_table_attach_defaults(menu_table, m_category_icon_size, 1, 2, 5, 6);
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
label = gtk_label_new_with_mnemonic(_("Background opacit_y:"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
- gtk_table_attach(menu_table, label, 0, 1, 5, 6, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
+ gtk_table_attach(menu_table, label, 0, 1, 6, 7, GTK_FILL, GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0, 0);
m_background_opacity = gtk_hscale_new_with_range(0.0, 100.0, 1.0);
- gtk_table_attach_defaults(menu_table, m_background_opacity, 1, 2, 5, 6);
+ gtk_table_attach_defaults(menu_table, m_background_opacity, 1, 2, 6, 7);
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);
diff --git a/panel-plugin/configuration-dialog.h b/panel-plugin/configuration-dialog.h
index 8aa3388..d14b630 100644
--- a/panel-plugin/configuration-dialog.h
+++ b/panel-plugin/configuration-dialog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013,2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,6 +43,7 @@ public:
private:
void toggle_show_generic_name(GtkToggleButton* button);
void toggle_show_description(GtkToggleButton* button);
+ void toggle_show_tooltip(GtkToggleButton* button);
void toggle_show_hierarchy(GtkToggleButton* button);
void toggle_position_search_alternate(GtkToggleButton* button);
void toggle_position_commands_alternate(GtkToggleButton* button);
@@ -85,6 +86,7 @@ private:
GtkWidget* m_button_single_row;
GtkWidget* m_show_generic_names;
GtkWidget* m_show_descriptions;
+ GtkWidget* m_show_tooltips;
GtkWidget* m_show_hierarchy;
GtkWidget* m_position_search_alternate;
GtkWidget* m_position_commands_alternate;
diff --git a/panel-plugin/element.h b/panel-plugin/element.h
index acf16f2..4a031ee 100644
--- a/panel-plugin/element.h
+++ b/panel-plugin/element.h
@@ -31,6 +31,7 @@ public:
Element() :
m_icon(NULL),
m_text(NULL),
+ m_tooltip(NULL),
m_sort_key(NULL)
{
}
@@ -39,6 +40,7 @@ public:
{
g_free(m_icon);
g_free(m_text);
+ g_free(m_tooltip);
g_free(m_sort_key);
}
@@ -54,6 +56,11 @@ public:
return m_text;
}
+ const gchar* get_tooltip() const
+ {
+ return m_tooltip;
+ }
+
virtual void run(GdkScreen*) const
{
}
@@ -97,6 +104,12 @@ protected:
m_sort_key = g_utf8_collate_key(m_text, -1);
}
+ void set_tooltip(const gchar* tooltip)
+ {
+ g_free(m_tooltip);
+ m_tooltip = g_markup_escape_text(tooltip, -1);
+ }
+
private:
Element(const Element&);
Element& operator=(const Element&);
@@ -104,6 +117,7 @@ private:
private:
gchar* m_icon;
gchar* m_text;
+ gchar* m_tooltip;
gchar* m_sort_key;
};
diff --git a/panel-plugin/favorites-page.cpp b/panel-plugin/favorites-page.cpp
index b94dba4..1491799 100644
--- a/panel-plugin/favorites-page.cpp
+++ b/panel-plugin/favorites-page.cpp
@@ -75,6 +75,7 @@ void FavoritesPage::add(Launcher* launcher)
store, NULL, G_MAXINT,
LauncherView::COLUMN_ICON, launcher->get_icon(),
LauncherView::COLUMN_TEXT, launcher->get_text(),
+ LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, launcher,
-1);
}
diff --git a/panel-plugin/launcher-view.cpp b/panel-plugin/launcher-view.cpp
index 4f2d7b5..7891f9e 100644
--- a/panel-plugin/launcher-view.cpp
+++ b/panel-plugin/launcher-view.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -198,6 +198,20 @@ void LauncherView::set_selection_mode(GtkSelectionMode mode)
//-----------------------------------------------------------------------------
+void LauncherView::hide_tooltips()
+{
+ gtk_tree_view_set_tooltip_column(m_view, -1);
+}
+
+//-----------------------------------------------------------------------------
+
+void LauncherView::show_tooltips()
+{
+ gtk_tree_view_set_tooltip_column(m_view, LauncherView::COLUMN_TOOLTIP);
+}
+
+//-----------------------------------------------------------------------------
+
void LauncherView::collapse_all()
{
gtk_tree_view_collapse_all(m_view);
diff --git a/panel-plugin/launcher-view.h b/panel-plugin/launcher-view.h
index c4763e5..c20e826 100644
--- a/panel-plugin/launcher-view.h
+++ b/panel-plugin/launcher-view.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,6 +48,9 @@ public:
void set_reorderable(bool reorderable);
void set_selection_mode(GtkSelectionMode mode);
+ void hide_tooltips();
+ void show_tooltips();
+
void collapse_all();
GtkTreeModel* get_model() const
@@ -64,6 +67,7 @@ public:
{
COLUMN_ICON = 0,
COLUMN_TEXT,
+ COLUMN_TOOLTIP,
COLUMN_LAUNCHER,
N_COLUMNS
};
diff --git a/panel-plugin/launcher.cpp b/panel-plugin/launcher.cpp
index ee91078..6bffd6a 100644
--- a/panel-plugin/launcher.cpp
+++ b/panel-plugin/launcher.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -172,6 +172,7 @@ Launcher::Launcher(GarconMenuItem* item) :
{
set_text(g_markup_printf_escaped("%s%s", direction, m_display_name));
}
+ set_tooltip(details);
// Create search text for display name
m_search_name = normalize(m_display_name);
diff --git a/panel-plugin/recent-page.cpp b/panel-plugin/recent-page.cpp
index d9be893..32ec489 100644
--- a/panel-plugin/recent-page.cpp
+++ b/panel-plugin/recent-page.cpp
@@ -90,6 +90,7 @@ void RecentPage::add(Launcher* launcher)
store, NULL, 0,
LauncherView::COLUMN_ICON, launcher->get_icon(),
LauncherView::COLUMN_TEXT, launcher->get_text(),
+ LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, launcher,
-1);
wm_settings->recent.insert(wm_settings->recent.begin(), desktop_id);
diff --git a/panel-plugin/run-action.cpp b/panel-plugin/run-action.cpp
index dafa471..35eb6c8 100644
--- a/panel-plugin/run-action.cpp
+++ b/panel-plugin/run-action.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -77,6 +77,7 @@ guint RunAction::search(const Query& query)
{
set_text(g_markup_printf_escaped("%s%s", direction, display_name));
}
+ set_tooltip(display_name);
g_free(display_name);
// Sort after matches in names and before matches in executables
diff --git a/panel-plugin/search-action.cpp b/panel-plugin/search-action.cpp
index 1d1efb0..7819494 100644
--- a/panel-plugin/search-action.cpp
+++ b/panel-plugin/search-action.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -256,14 +256,16 @@ void SearchAction::set_is_regex(bool is_regex)
void SearchAction::update_text()
{
const gchar* direction = (gtk_widget_get_default_direction() != GTK_TEXT_DIR_RTL) ? "\342\200\216" : "\342\200\217";
+ const gchar* description = _("Search Action");
if (m_show_description)
{
- set_text(g_markup_printf_escaped("%s<b>%s</b>\n%s%s", direction, m_name.c_str(), direction, _("Search Action")));
+ set_text(g_markup_printf_escaped("%s<b>%s</b>\n%s%s", direction, m_name.c_str(), direction, description));
}
else
{
set_text(g_markup_printf_escaped("%s%s", direction, m_name.c_str()));
}
+ set_tooltip(description);
}
//-----------------------------------------------------------------------------
diff --git a/panel-plugin/search-page.cpp b/panel-plugin/search-page.cpp
index 6934daa..d85f165 100644
--- a/panel-plugin/search-page.cpp
+++ b/panel-plugin/search-page.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -111,6 +111,7 @@ void SearchPage::set_filter(const gchar* filter)
LauncherView::N_COLUMNS,
G_TYPE_STRING,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_POINTER);
Element* element;
for (std::vector<Match>::size_type i = 0, end = search_action_matches.size(); i < end; ++i)
@@ -120,6 +121,7 @@ void SearchPage::set_filter(const gchar* filter)
store, NULL, G_MAXINT,
LauncherView::COLUMN_ICON, element->get_icon(),
LauncherView::COLUMN_TEXT, element->get_text(),
+ LauncherView::COLUMN_TOOLTIP, element->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, element,
-1);
}
@@ -130,6 +132,7 @@ void SearchPage::set_filter(const gchar* filter)
store, NULL, G_MAXINT,
LauncherView::COLUMN_ICON, element->get_icon(),
LauncherView::COLUMN_TEXT, element->get_text(),
+ LauncherView::COLUMN_TOOLTIP, element->get_tooltip(),
LauncherView::COLUMN_LAUNCHER, element,
-1);
}
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index 584c5d3..13f7e6e 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -90,6 +90,7 @@ Settings::Settings() :
launcher_show_name(true),
launcher_show_description(true),
+ launcher_show_tooltip(true),
launcher_icon_size(IconSize::Small),
category_hover_activate(false),
@@ -173,6 +174,7 @@ void Settings::load(char* file)
launcher_show_name = xfce_rc_read_bool_entry(rc, "launcher-show-name", launcher_show_name);
launcher_show_description = xfce_rc_read_bool_entry(rc, "launcher-show-description", launcher_show_description);
+ launcher_show_tooltip = xfce_rc_read_bool_entry(rc, "launcher-show-tooltip", launcher_show_tooltip);
launcher_icon_size = xfce_rc_read_int_entry(rc, "item-icon-size", launcher_icon_size);
category_hover_activate = xfce_rc_read_bool_entry(rc, "hover-switch-category", category_hover_activate);
@@ -269,6 +271,7 @@ void Settings::save(char* file)
xfce_rc_write_bool_entry(rc, "launcher-show-name", launcher_show_name);
xfce_rc_write_bool_entry(rc, "launcher-show-description", launcher_show_description);
+ xfce_rc_write_bool_entry(rc, "launcher-show-tooltip", launcher_show_tooltip);
xfce_rc_write_int_entry(rc, "item-icon-size", launcher_icon_size);
xfce_rc_write_bool_entry(rc, "hover-switch-category", category_hover_activate);
diff --git a/panel-plugin/settings.h b/panel-plugin/settings.h
index 506d259..e3c9724 100644
--- a/panel-plugin/settings.h
+++ b/panel-plugin/settings.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -67,6 +67,7 @@ public:
bool launcher_show_name;
bool launcher_show_description;
+ bool launcher_show_tooltip;
IconSize launcher_icon_size;
bool category_hover_activate;
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 0722b25..b2e6041 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -288,6 +288,22 @@ void WhiskerMenu::Window::show(GtkWidget* parent, bool horizontal)
m_recent->get_view()->reload_icon_size();
m_applications->get_view()->reload_icon_size();
+ // Handle showing tooltips
+ if (wm_settings->launcher_show_tooltip)
+ {
+ m_search_results->get_view()->show_tooltips();
+ m_favorites->get_view()->show_tooltips();
+ m_recent->get_view()->show_tooltips();
+ m_applications->get_view()->show_tooltips();
+ }
+ else
+ {
+ m_search_results->get_view()->hide_tooltips();
+ m_favorites->get_view()->hide_tooltips();
+ m_recent->get_view()->hide_tooltips();
+ m_applications->get_view()->hide_tooltips();
+ }
+
// Make sure commands are valid and visible
for (int i = 0; i < Settings::CountCommands; ++i)
{
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list