[gnote] Use mnemonic/underlines on the toolbar buttons. (Closes #590590)
- From: Hubert Figuière <hub src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnote] Use mnemonic/underlines on the toolbar buttons. (Closes #590590)
- Date: Tue, 4 Aug 2009 17:13:58 +0000 (UTC)
commit ee16a8ef0af522d4504250bb22f11b14988fed56
Author: Hubert Figuiere <hub figuiere net>
Date: Tue Aug 4 13:10:57 2009 -0400
Use mnemonic/underlines on the toolbar buttons. (Closes #590590)
src/utils.cpp | 13 ++++++++-----
src/utils.hpp | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/utils.cpp b/src/utils.cpp
index 80f22fa..1c3c78c 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -34,6 +34,7 @@
#include <glibmm/spawn.h>
#include <gtkmm/icontheme.h>
#include <gtkmm/image.h>
+#include <gtkmm/label.h>
#include <gtkmm/stock.h>
#include <gtkmm/textbuffer.h>
@@ -693,25 +694,27 @@ namespace gnote {
ToolMenuButton::ToolMenuButton(Gtk::Toolbar& toolbar, const Gtk::BuiltinStockID& stock_image,
const Glib::ustring & label,
Gtk::Menu * menu)
- : Gtk::ToggleToolButton(label)
+ : Gtk::ToggleToolButton()
, m_menu(menu)
{
- _common_init(*manage(new Gtk::Image(stock_image, toolbar.get_icon_size())));
+ _common_init(*manage(new Gtk::Image(stock_image, toolbar.get_icon_size())),
+ label);
}
ToolMenuButton::ToolMenuButton(Gtk::Image& image,
const Glib::ustring & label,
Gtk::Menu * menu)
- : Gtk::ToggleToolButton(label)
+ : Gtk::ToggleToolButton()
, m_menu(menu)
{
- _common_init(image);
+ _common_init(image, label);
}
- void ToolMenuButton::_common_init(Gtk::Image& image)
+ void ToolMenuButton::_common_init(Gtk::Image& image, const Glib::ustring & label)
{
set_icon_widget(image);
+ set_label_widget(*manage(new Gtk::Label(label, true)));
property_can_focus() = true;
gtk_menu_attach_to_widget(m_menu->gobj(), static_cast<Gtk::Widget*>(this)->gobj(),
NULL);
diff --git a/src/utils.hpp b/src/utils.hpp
index fc8dd59..62040e2 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -235,7 +235,7 @@ namespace gnote {
virtual bool on_mnemonic_activate(bool group_cycling);
private:
- void _common_init(Gtk::Image& image);
+ void _common_init(Gtk::Image& image, const Glib::ustring & l);
// managed by gtkmm
Gtk::Menu *m_menu;
void release_button();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]