Merge lp:~attente/unity-gtk-module/stock-image-items into lp:unity-gtk-module/13.10

Proposed by William Hua
Status: Merged
Approved by: Lars Karlitski
Approved revision: 296
Merged at revision: 301
Proposed branch: lp:~attente/unity-gtk-module/stock-image-items
Merge into: lp:unity-gtk-module/13.10
Diff against target: 25 lines (+16/-0)
1 file modified
lib/unity-gtk-menu-item.c (+16/-0)
To merge this branch: bzr merge lp:~attente/unity-gtk-module/stock-image-items
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+172093@code.launchpad.net

Commit message

Handle GtkImageMenuItems with stock ids.

Description of the change

Handle GtkImageMenuItems with stock ids.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/unity-gtk-menu-item.c'
2--- lib/unity-gtk-menu-item.c 2013-06-17 17:32:33 +0000
3+++ lib/unity-gtk-menu-item.c 2013-06-28 16:09:26 +0000
4@@ -396,6 +396,22 @@
5
6 label = gtk_menu_item_get_label (item->menu_item);
7
8+ if (label != NULL && label[0] != '\0')
9+ {
10+ if (GTK_IS_IMAGE_MENU_ITEM (item->menu_item))
11+ {
12+ GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (item->menu_item);
13+
14+ if (gtk_image_menu_item_get_use_stock (image_menu_item))
15+ {
16+ GtkStockItem stock_item;
17+
18+ if (gtk_stock_lookup (label, &stock_item))
19+ label = stock_item.label;
20+ }
21+ }
22+ }
23+
24 if (label == NULL || label[0] == '\0')
25 label = gtk_menu_item_get_nth_label (item->menu_item, 0);
26

Subscribers

People subscribed via source and target branches