Merge lp:~lukas-vacek/unity/bamficon_windowlist-raring into lp:unity

Proposed by Adolfo Jayme Barrientos
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3143
Proposed branch: lp:~lukas-vacek/unity/bamficon_windowlist-raring
Merge into: lp:unity
Diff against target: 308 lines (+191/-1)
7 files modified
launcher/ApplicationLauncherIcon.cpp (+59/-0)
launcher/ApplicationLauncherIcon.h (+2/-0)
launcher/QuicklistMenuItem.cpp (+24/-1)
launcher/QuicklistMenuItem.h (+3/-0)
tests/mock-application.h (+1/-0)
tests/test_application_launcher_icon.cpp (+82/-0)
tests/test_quicklist_menu_item.cpp (+20/-0)
To merge this branch: bzr merge lp:~lukas-vacek/unity/bamficon_windowlist-raring
Reviewer Review Type Date Requested Status
John Lea (community) design Approve
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+145676@code.launchpad.net

Commit message

ApplicationLauncherIcon: Show a list of related windows in a Launcher icon's Quicklist

(LP: #1107866)

Description of the change

Show a list of windows in a Launcher icon's Quicklist. (LP: #1107866)

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Seems like it could use a test.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

10 + WindowManager& wm = WindowManager::Default();
11 + // delete all menu items for windows

29 + char menu_item_name[name_size];
30 + sprintf(menu_item_name,"w_list_%d",i);

44 + _menu_items[menu_item_name] = menu_item;

Please, don't add these items to _menu_items. Use instead another container (such as
std::vector<glib::Object<DbusmenuMenuitem>> _windows_menu_items and add the items you generate there in AddMenuItemsWindowList.

22 + for ( auto w: Windows() ) {

Use for (auto const& w : Windows())

At that point call it into GetMenus() putting the items you computed into the result list.

36 + _gsignals.Add(
37 + new glib::Signal<void, DbusmenuMenuitem*, int>(menu_item,

You can use the utility Add function to save some space:
_gsignals.Add<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED ...

39 + [w,&wm] (DbusmenuMenuitem*,int) -> void {

Just pass w, while generate the WM inside the lambda body (even if that pointer won't change, it's safer not to pass by reference inside a lambda that is going to be executed when the local variable is dead). Also it's not needed to specify the "-> void" return type. g++ will guess it for you.

45 + std::string winName( ( wm.GetWindowName( w->window_id() ) ) );
46 + dbusmenu_menuitem_property_set(menu_item,
47 + DBUSMENU_MENUITEM_PROP_LABEL, winName.c_str() );

Only use:
dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, w->title().c_str());

51 + if (windows_added) {
52 + // add seperator

65 + }

Do this into GetMenus.

Also, long quicklist items should be cut. I'll provide I way to do it as I need it also on another branch, please ping me on IRC in case you'd need help.

Fix the style to match the one we use in unity (2 spaces indentation, brackets on next line)

Need tests.

review: Needs Fixing
Revision history for this message
John Lea (johnlea) wrote :

Also the maximum string length of each Window title should be limited to 45 characters including spaces. Anything more than 45 characters should be chopped at 43 characters and have "..." applied to the end e.g.

"bamficon_windowlist_rearing : Code : Unity..." (In the case of this window)

review: Needs Fixing (design)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Also the maximum string length of each Window title should be limited to 45
> characters including spaces. Anything more than 45 characters should be
> chopped at 43 characters and have "..." applied to the end e.g.
>
> "bamficon_windowlist_rearing : Code : Unity..." (In the case of this window)

Yes, I agree with this (as I wrote above).
The fix for that is needed also by bug #893652 and will be provided by lp:~3v1n0/unity/quicklist-max-label-width.

Just set the QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY DBusMenuItem int property (wanted px-width will be provided by design).

Revision history for this message
John Lea (johnlea) wrote :

Update to my comment above:

- The max width should be 300px
- The window title should be ellipsized at the end
- This entry should only be displayed if there are 2 or more windows. If the application only has 1 or 0 windows open nothing should be displayed.

The format of the option should be:

====================
[application specific quicklist options area]
--------------
[application name]
--------------
Windows:
[window title 1]
[window title 2]
[window title 3]
--------------
Most recent files:
file one.odt
file two.odt
file three.odt
file four.odt
file five.odt
--------------
Keep in launcher
Quit
====================

thanks!

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

36 + // delete all menu items for windows
37 + _menu_items_windows.clear();

Please do this on EnsureMenuItemsWindowsReady

17 + _gsignals.Add<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
18 + [w] (DbusmenuMenuitem*,int) {

This is ok, but since using [w] means copying the the WindowPtr, I'd prefer if you instead do:

Window xid = w->window_id();
_gsignals.Add<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, [xid] (DbusmenuMenuitem*,int) {
...
wm.Raise(xid);
}

22 + } );

Remove this padding, please (use also for the lambda two spaces for indenting).

24 + dbusmenu_menuitem_property_set(menu_item, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, "300");

That property is an integer, you should do instead:

dbusmenu_menuitem_property_set_int(menu_item, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, MAXIMUM_QUICKLIST_WIDTH);

Where MAXIMUM_QUICKLIST_WIDTH is a const int that you should define in the unnamed namespace that we have at the top of the ApplicationLauncherIcon.cpp file ;).

40 + // add windows menu items
41 + if (_menu_items_windows.size() > 1 )

Mh, I'd prefer to iterate one more time than allocating some extra memory here, so just use if (Windows().size() > 1), and move EnsureMenuItemsWindowsReady under this check.

Thanks ;)

Revision history for this message
Lukas Vacek (lukas-vacek) wrote :

Thanks for your fast reply. I will fix that and push the changes tonight.

> 24 + dbusmenu_menuitem_property_set(menu_item,
> QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, "300");
>
> That property is an integer, you should do instead:
>
> dbusmenu_menuitem_property_set_int(menu_item,
> QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, MAXIMUM_QUICKLIST_WIDTH);
>
> Where MAXIMUM_QUICKLIST_WIDTH is a const int that you should define in the
> unnamed namespace that we have at the top of the ApplicationLauncherIcon.cpp
> file ;).
>

I am not sure about this one - to me it seems the property is const char* and it won't compile if I set it to an integer. I am not sure how to fix my code here.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Thanks for your fast reply. I will fix that and push the changes tonight.
>
> > 24 + dbusmenu_menuitem_property_set(menu_item,
> > QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, "300");
> >
> > That property is an integer, you should do instead:
> >
> > dbusmenu_menuitem_property_set_int(menu_item,
> > QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, MAXIMUM_QUICKLIST_WIDTH);
> >
> > Where MAXIMUM_QUICKLIST_WIDTH is a const int that you should define in the
> > unnamed namespace that we have at the top of the ApplicationLauncherIcon.cpp
> > file ;).
> >
>
> I am not sure about this one - to me it seems the property is const char* and
> it won't compile if I set it to an integer. I am not sure how to fix my code
> here.

Keep in mind you need to use dbusmenu_menuitem_property_***set_int***

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ah, also... It would be needed an unit-test or AP test. If you need some guidance, ping me on IRC.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I think it's now ready to go in trunk... We have tests and correctly cut long entries!

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

New screenshot for design re-review: http://i.imgur.com/NUfgdKm.png

Revision history for this message
John Lea (johnlea) wrote :

Looks good to me now, thanks!

review: Approve (design)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/ApplicationLauncherIcon.cpp'
2--- launcher/ApplicationLauncherIcon.cpp 2013-02-05 02:14:32 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2013-02-08 15:07:28 +0000
4@@ -51,6 +51,7 @@
5 const std::string ICON_REMOVE_TIMEOUT = "bamf-icon-remove";
6 //const std::string ICON_DND_OVER_TIMEOUT = "bamf-icon-dnd-over";
7 const std::string DEFAULT_ICON = "application-default-icon";
8+const int MAXIMUM_QUICKLIST_WIDTH = 300;
9 }
10
11 NUX_IMPLEMENT_OBJECT_TYPE(ApplicationLauncherIcon);
12@@ -692,6 +693,42 @@
13 EmitNeedsRedraw();
14 }
15
16+void ApplicationLauncherIcon::EnsureMenuItemsWindowsReady()
17+{
18+ // delete all menu items for windows
19+ _menu_items_windows.clear();
20+
21+ auto const& windows = Windows();
22+
23+ // We only add quicklist menu-items for windows if we have more than one window
24+ if (windows.size() < 2)
25+ return;
26+
27+ // add menu items for all open windows
28+ for (auto const& w : windows)
29+ {
30+ if (w->title().empty())
31+ continue;
32+
33+ glib::Object<DbusmenuMenuitem> menu_item(dbusmenu_menuitem_new());
34+ dbusmenu_menuitem_property_set(menu_item, DBUSMENU_MENUITEM_PROP_LABEL, w->title().c_str());
35+ dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
36+ dbusmenu_menuitem_property_set_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE, true);
37+ dbusmenu_menuitem_property_set_bool(menu_item, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY, true);
38+ dbusmenu_menuitem_property_set_int(menu_item, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY, MAXIMUM_QUICKLIST_WIDTH);
39+
40+ Window xid = w->window_id();
41+ _gsignals.Add<void, DbusmenuMenuitem*, int>(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
42+ [xid] (DbusmenuMenuitem*, int) {
43+ WindowManager& wm = WindowManager::Default();
44+ wm.Activate(xid);
45+ wm.Raise(xid);
46+ });
47+
48+ _menu_items_windows.push_back(menu_item);
49+ }
50+}
51+
52 void ApplicationLauncherIcon::UpdateMenus()
53 {
54 // add dynamic quicklist
55@@ -926,6 +963,28 @@
56 }
57 result.push_back(item);
58
59+ EnsureMenuItemsWindowsReady();
60+
61+ if (!_menu_items_windows.empty())
62+ {
63+ for (auto const& it : _menu_items_windows)
64+ result.push_back(it);
65+
66+ auto third_sep = _menu_items_extra.find("ThirdSeparator");
67+ if (third_sep != _menu_items_extra.end())
68+ {
69+ item = third_sep->second;
70+ }
71+ else
72+ {
73+ item = dbusmenu_menuitem_new();
74+ dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR);
75+ _menu_items_extra["ThirdSeparator"] = glib::Object<DbusmenuMenuitem>(item);
76+ }
77+
78+ result.push_back(item);
79+ }
80+
81 EnsureMenuItemsReady();
82
83 for (auto it : _menu_items)
84
85=== modified file 'launcher/ApplicationLauncherIcon.h'
86--- launcher/ApplicationLauncherIcon.h 2013-02-05 02:14:32 +0000
87+++ launcher/ApplicationLauncherIcon.h 2013-02-08 15:07:28 +0000
88@@ -108,6 +108,7 @@
89 };
90
91 void EnsureWindowState();
92+ void EnsureMenuItemsWindowsReady();
93 void EnsureMenuItemsReady();
94 void UpdateBackgroundColor();
95 void UpdateMenus();
96@@ -130,6 +131,7 @@
97 std::map<std::string, glib::Object<DbusmenuClient>> _menu_clients;
98 std::map<std::string, glib::Object<DbusmenuMenuitem>> _menu_items;
99 std::map<std::string, glib::Object<DbusmenuMenuitem>> _menu_items_extra;
100+ std::vector<glib::Object<DbusmenuMenuitem>> _menu_items_windows;
101 glib::Object<IndicatorDesktopShortcuts> _desktop_shortcuts;
102 glib::Object<DbusmenuMenuitem> _menu_desktop_shortcuts;
103 glib::Object<GFileMonitor> _desktop_file_monitor;
104
105=== modified file 'launcher/QuicklistMenuItem.cpp'
106--- launcher/QuicklistMenuItem.cpp 2013-01-31 14:54:19 +0000
107+++ launcher/QuicklistMenuItem.cpp 2013-02-08 15:07:28 +0000
108@@ -29,6 +29,7 @@
109 namespace unity
110 {
111 const char* QuicklistMenuItem::MARKUP_ENABLED_PROPERTY = "unity-use-markup";
112+const char* QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY = "unity-disable-accel";
113 const char* QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY = "unity-max-label-width";
114 const char* QuicklistMenuItem::OVERLAY_MENU_ITEM_PROPERTY = "unity-overlay-item";
115
116@@ -280,7 +281,11 @@
117 std::shared_ptr<PangoFontDescription> desc(pango_font_description_from_string(font_name), pango_font_description_free);
118 pango_layout_set_font_description(layout, desc.get());
119 pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
120- pango_layout_set_markup_with_accel(layout, _text.c_str(), -1, '_', nullptr);
121+
122+ if (IsMarkupAccelEnabled())
123+ pango_layout_set_markup_with_accel(layout, _text.c_str(), -1, '_', nullptr);
124+ else
125+ pango_layout_set_markup(layout, _text.c_str(), -1);
126
127 if (GetMaxLabelWidth() > 0)
128 {
129@@ -360,6 +365,24 @@
130 return (markup != FALSE);
131 }
132
133+void QuicklistMenuItem::EnableLabelMarkupAccel(bool enabled)
134+{
135+ if (IsMarkupAccelEnabled() != enabled)
136+ {
137+ dbusmenu_menuitem_property_set_bool(_menu_item, MARKUP_ACCEL_DISABLED_PROPERTY, enabled ? FALSE : TRUE);
138+ InitializeText();
139+ }
140+}
141+
142+bool QuicklistMenuItem::IsMarkupAccelEnabled() const
143+{
144+ if (!_menu_item)
145+ return false;
146+
147+ gboolean disabled = dbusmenu_menuitem_property_get_bool(_menu_item, MARKUP_ACCEL_DISABLED_PROPERTY);
148+ return (disabled == FALSE);
149+}
150+
151 void QuicklistMenuItem::SetMaxLabelWidth(int max_width)
152 {
153 if (GetMaxLabelWidth() != max_width)
154
155=== modified file 'launcher/QuicklistMenuItem.h'
156--- launcher/QuicklistMenuItem.h 2013-01-31 13:41:35 +0000
157+++ launcher/QuicklistMenuItem.h 2013-02-08 15:07:28 +0000
158@@ -61,6 +61,8 @@
159
160 void EnableLabelMarkup(bool enabled);
161 bool IsMarkupEnabled() const;
162+ void EnableLabelMarkupAccel(bool enabled);
163+ bool IsMarkupAccelEnabled() const;
164
165 void SetMaxLabelWidth(int max_width);
166 int GetMaxLabelWidth() const;
167@@ -85,6 +87,7 @@
168 sigc::signal<void, QuicklistMenuItem*, int, int> sigMouseDrag;
169
170 static const char* MARKUP_ENABLED_PROPERTY;
171+ static const char* MARKUP_ACCEL_DISABLED_PROPERTY;
172 static const char* MAXIMUM_LABEL_WIDTH_PROPERTY;
173 static const char* OVERLAY_MENU_ITEM_PROPERTY;
174
175
176=== modified file 'tests/mock-application.h'
177--- tests/mock-application.h 2013-02-05 02:10:45 +0000
178+++ tests/mock-application.h 2013-02-08 15:07:28 +0000
179@@ -30,6 +30,7 @@
180 MockApplicationWindow(Window xid)
181 : xid_(xid)
182 , monitor_(0)
183+ , title_("MockApplicationWindow "+std::to_string(xid_))
184 , type_("window")
185 , visible_(true)
186 , active_(false)
187
188=== modified file 'tests/test_application_launcher_icon.cpp'
189--- tests/test_application_launcher_icon.cpp 2013-02-05 02:14:46 +0000
190+++ tests/test_application_launcher_icon.cpp 2013-02-08 15:07:28 +0000
191@@ -180,4 +180,86 @@
192 EXPECT_TRUE(mock_icon->IsActive());
193 }
194
195+TEST_F(TestApplicationLauncherIcon, NoWindowListMenusWithOneWindow)
196+{
197+ auto win = std::make_shared<MockApplicationWindow>(g_random_int());
198+ mock_app->window_list_ = { win };
199+
200+ auto const& menus = mock_icon->Menus();
201+ auto menu_it = std::find_if(menus.begin(), menus.end(), [win] (glib::Object<DbusmenuMenuitem> it) {
202+ auto* label = dbusmenu_menuitem_property_get(it, DBUSMENU_MENUITEM_PROP_LABEL);
203+ return (label && std::string(label) == win->title());
204+ });
205+
206+ EXPECT_EQ(menu_it, menus.end());
207+}
208+
209+TEST_F(TestApplicationLauncherIcon, WindowListMenusWithTwoWindows)
210+{
211+ auto win1 = std::make_shared<MockApplicationWindow>(1);
212+ auto wm_win1 = std::make_shared<StandaloneWindow>(win1->window_id());
213+ auto win2 = std::make_shared<MockApplicationWindow>(2);
214+ auto wm_win2 = std::make_shared<StandaloneWindow>(win2->window_id());
215+
216+ mock_app->window_list_ = { win1, win2 };
217+ WM->AddStandaloneWindow(wm_win1);
218+ WM->AddStandaloneWindow(wm_win2);
219+ ASSERT_TRUE(wm_win2->active());
220+
221+ auto const& menus = mock_icon->Menus();
222+
223+ auto menu1_it = std::find_if(menus.begin(), menus.end(), [win1] (glib::Object<DbusmenuMenuitem> it) {
224+ auto* label = dbusmenu_menuitem_property_get(it, DBUSMENU_MENUITEM_PROP_LABEL);
225+ return (label && std::string(label) == win1->title());
226+ });
227+
228+ ASSERT_NE(menu1_it, menus.end());
229+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu1_it, DBUSMENU_MENUITEM_PROP_ENABLED));
230+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu1_it, DBUSMENU_MENUITEM_PROP_VISIBLE));
231+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu1_it, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY));
232+ EXPECT_EQ(dbusmenu_menuitem_property_get_int(*menu1_it, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY), 300);
233+
234+ auto menu2_it = std::find_if(menus.begin(), menus.end(), [win2] (glib::Object<DbusmenuMenuitem> it) {
235+ auto* label = dbusmenu_menuitem_property_get(it, DBUSMENU_MENUITEM_PROP_LABEL);
236+ return (label && std::string(label) == win2->title());
237+ });
238+
239+ ASSERT_NE(menu2_it, menus.end());
240+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu2_it, DBUSMENU_MENUITEM_PROP_ENABLED));
241+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu2_it, DBUSMENU_MENUITEM_PROP_VISIBLE));
242+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(*menu2_it, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY));
243+ EXPECT_EQ(dbusmenu_menuitem_property_get_int(*menu2_it, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY), 300);
244+
245+ bool activated = false;
246+ wm_win1->active.changed.connect([&activated] (bool a) { activated = a; });
247+ g_signal_emit_by_name(*menu1_it, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, 0);
248+
249+ EXPECT_TRUE(wm_win1->active());
250+ EXPECT_TRUE(activated);
251+
252+ activated = false;
253+ wm_win2->active.changed.connect([&activated] (bool a) { activated = a; });
254+ g_signal_emit_by_name(*menu2_it, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, 0);
255+
256+ EXPECT_TRUE(wm_win2->active());
257+ EXPECT_TRUE(activated);
258+}
259+
260+TEST_F(TestApplicationLauncherIcon, WindowListMenusWithEmptyTitles)
261+{
262+ auto win1 = std::make_shared<MockApplicationWindow>(1);
263+ auto win2 = std::make_shared<MockApplicationWindow>(2);
264+ win1->title_.clear();
265+
266+ mock_app->window_list_ = { win1, win2 };
267+ auto const& menus = mock_icon->Menus();
268+
269+ auto menu1_it = std::find_if(menus.begin(), menus.end(), [win1] (glib::Object<DbusmenuMenuitem> it) {
270+ auto* label = dbusmenu_menuitem_property_get(it, DBUSMENU_MENUITEM_PROP_LABEL);
271+ return (label && std::string(label) == win1->title());
272+ });
273+
274+ ASSERT_EQ(menu1_it, menus.end());
275+}
276+
277 }
278
279=== modified file 'tests/test_quicklist_menu_item.cpp'
280--- tests/test_quicklist_menu_item.cpp 2013-01-31 13:43:13 +0000
281+++ tests/test_quicklist_menu_item.cpp 2013-02-08 15:07:28 +0000
282@@ -139,6 +139,26 @@
283 EXPECT_EQ(dbusmenu_menuitem_property_get_int(item, QuicklistMenuItem::MAXIMUM_LABEL_WIDTH_PROPERTY), max_width);
284 }
285
286+TEST_F(TestQuicklistMenuItem, MarkupAccelEnabled)
287+{
288+ dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Label");
289+ dbusmenu_menuitem_property_set_bool(item, DBUSMENU_MENUITEM_PROP_ENABLED, true);
290+
291+ nux::ObjectPtr<QuicklistMenuItemLabel> qlitem(new QuicklistMenuItemLabel(item));
292+ EXPECT_TRUE(qlitem->IsMarkupAccelEnabled());
293+
294+ dbusmenu_menuitem_property_set_bool(item, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY, true);
295+ EXPECT_FALSE(qlitem->IsMarkupAccelEnabled());
296+
297+ qlitem->EnableLabelMarkupAccel(true);
298+ EXPECT_TRUE(qlitem->IsMarkupAccelEnabled());
299+ EXPECT_FALSE(dbusmenu_menuitem_property_get_bool(item, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY));
300+
301+ qlitem->EnableLabelMarkupAccel(false);
302+ EXPECT_FALSE(qlitem->IsMarkupAccelEnabled());
303+ EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(item, QuicklistMenuItem::MARKUP_ACCEL_DISABLED_PROPERTY));
304+}
305+
306 TEST_F(TestQuicklistMenuItem, ItemActivate)
307 {
308 dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Label");