[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 230/473: Remove mnemonics fromn command tooltips.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:56:40 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 c7c18104d0d0d6bf40d95ecc6c1d4bbd56c344f7
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sun Nov 10 14:27:25 2013 -0500

    Remove mnemonics fromn command tooltips.
---
 panel-plugin/command.cpp  |   15 ++++++++++++++-
 panel-plugin/settings.cpp |    8 ++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/panel-plugin/command.cpp b/panel-plugin/command.cpp
index b10c866..1f3a4be 100644
--- a/panel-plugin/command.cpp
+++ b/panel-plugin/command.cpp
@@ -17,6 +17,8 @@
 
 #include "command.h"
 
+#include <string>
+
 extern "C"
 {
 #include <libxfce4ui/libxfce4ui.h>
@@ -75,9 +77,20 @@ GtkWidget* Command::get_button()
 		return m_button;
 	}
 
+	std::string tooltip(m_text ? m_text : "");
+	for (std::string::size_type i = 0, length = tooltip.length(); i < length; ++i)
+	{
+		if (tooltip[i] == '_')
+		{
+			tooltip.erase(i, 1);
+			--length;
+			--i;
+		}
+	}
+
 	m_button = gtk_button_new();
 	gtk_button_set_relief(GTK_BUTTON(m_button), GTK_RELIEF_NONE);
-	gtk_widget_set_tooltip_text(m_button, m_text);
+	gtk_widget_set_tooltip_text(m_button, tooltip.c_str());
 	g_signal_connect(m_button, "clicked", G_CALLBACK(Command::clicked_slot), this);
 
 	GtkWidget* image = gtk_image_new_from_icon_name(m_icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index 5950496..8cc78fe 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -98,10 +98,10 @@ Settings::Settings() :
 	favorites.push_back("exo-mail-reader.desktop");
 	favorites.push_back("exo-web-browser.desktop");
 
-	command_settings = new Command("preferences-desktop", _("All Settings"), "xfce4-settings-manager", _("Failed to open settings manager."));
-	command_lockscreen = new Command("system-lock-screen", _("Lock Screen"), "xflock4", _("Failed to lock screen."));
-	command_logout = new Command("system-log-out", _("Log Out"), "xfce4-session-logout", _("Failed to log out."));
-	command_menueditor = new Command("xfce4-menueditor", _("Edit _Applications"), "menulibre", _("Failed to launch menu editor."));
+	command_settings = new Command("preferences-desktop", _("All _Settings"), "xfce4-settings-manager", _("Failed to open settings manager."));
+	command_lockscreen = new Command("system-lock-screen", _("_Lock Screen"), "xflock4", _("Failed to lock screen."));
+	command_logout = new Command("system-log-out", _("Log _Out"), "xfce4-session-logout", _("Failed to log out."));
+	command_menueditor = new Command("xfce4-menueditor", _("_Edit Applications"), "menulibre", _("Failed to launch menu editor."));
 }
 
 //-----------------------------------------------------------------------------

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


More information about the Xfce4-commits mailing list