[goffice] Pixmap Selector: fix tooltip here too.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Pixmap Selector: fix tooltip here too.
- Date: Sun, 3 Mar 2013 19:52:32 +0000 (UTC)
commit 249e71d8199e518b6f81d3631a14b8d0b036ea58
Author: Morten Welinder <terra gnome org>
Date: Sun Mar 3 14:52:12 2013 -0500
Pixmap Selector: fix tooltip here too.
ChangeLog | 3 +++
NEWS | 1 +
goffice/gtk/go-action-combo-pixmaps.c | 12 +++++++-----
goffice/gtk/go-combo-pixmaps.c | 6 +++++-
goffice/gtk/go-combo-pixmaps.h | 3 ++-
5 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0f1f6e6..8055de6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2013-03-03 Morten Welinder <terra gnome org>
+ * goffice/gtk/go-combo-pixmaps.c (go_menu_pixmaps_add_element):
+ Add extra tooltip argument.
+
* goffice/gtk/go-color-palette.c (go_color_palette_make_menu): Add
tooltip for menu mode too. Fixes #695032.
diff --git a/NEWS b/NEWS
index 371b452..94017b1 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Morten:
* Add efficient code for computing leverages. [#691913]
* Introspection fixes.
* Fix missing tooltip in color palette. [#695032]
+ * Fix missing tooltip in pixmap selector.
--------------------------------------------------------------------------
goffice 0.10.0:
diff --git a/goffice/gtk/go-action-combo-pixmaps.c b/goffice/gtk/go-action-combo-pixmaps.c
index f2b3b54..cd1ccdf 100644
--- a/goffice/gtk/go-action-combo-pixmaps.c
+++ b/goffice/gtk/go-action-combo-pixmaps.c
@@ -174,11 +174,13 @@ go_action_combo_pixmaps_create_menu_item (GtkAction *a)
GtkWidget *item = gtk_image_menu_item_new ();
for ( ; el->stock_id != NULL ; el++)
- go_menu_pixmaps_add_element (submenu,
- gtk_widget_render_icon_pixbuf (GTK_WIDGET (item),
- el->stock_id,
- GTK_ICON_SIZE_MENU),
- el->id);
+ go_menu_pixmaps_add_element
+ (submenu,
+ gtk_widget_render_icon_pixbuf (GTK_WIDGET (item),
+ el->stock_id,
+ GTK_ICON_SIZE_MENU),
+ el->id,
+ gettext (el->untranslated_tooltip));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), GTK_WIDGET (submenu));
gtk_widget_show (GTK_WIDGET (submenu));
diff --git a/goffice/gtk/go-combo-pixmaps.c b/goffice/gtk/go-combo-pixmaps.c
index 7a83ed1..c051b94 100644
--- a/goffice/gtk/go-combo-pixmaps.c
+++ b/goffice/gtk/go-combo-pixmaps.c
@@ -351,7 +351,8 @@ cb_menu_item_toggle_size_request (GtkWidget *item, gint *requitision)
void
go_menu_pixmaps_add_element (GOMenuPixmaps *menu,
- GdkPixbuf *pixbuf, int id)
+ GdkPixbuf *pixbuf, int id,
+ const char *tooltip)
{
GtkWidget *button;
int col, row;
@@ -373,6 +374,9 @@ go_menu_pixmaps_add_element (GOMenuPixmaps *menu,
"activate",
G_CALLBACK (cb_menu_item_activate), menu);
+ if (tooltip != NULL)
+ gtk_widget_set_tooltip_text (button, tooltip);
+
/* Workaround for bug http://bugzilla.gnome.org/show_bug.cgi?id=585421 */
g_signal_connect (button, "toggle-size-request", G_CALLBACK (cb_menu_item_toggle_size_request), NULL);
}
diff --git a/goffice/gtk/go-combo-pixmaps.h b/goffice/gtk/go-combo-pixmaps.h
index 8cbade2..2c55c5f 100644
--- a/goffice/gtk/go-combo-pixmaps.h
+++ b/goffice/gtk/go-combo-pixmaps.h
@@ -49,7 +49,8 @@ GtkWidget *go_combo_pixmaps_get_preview (GOComboPixmaps const *combo);
GType go_menu_pixmaps_get_type (void);
GOMenuPixmaps *go_menu_pixmaps_new (int ncols);
void go_menu_pixmaps_add_element (GOMenuPixmaps *menu,
- GdkPixbuf *pixbuf, int id);
+ GdkPixbuf *pixbuf, int id,
+ const char *tooltip);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]