Merge lp:~3v1n0/unity/quicklist-markup-support into lp:unity
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1773 |
Proposed branch: | lp:~3v1n0/unity/quicklist-markup-support |
Merge into: | lp:unity |
Diff against target: |
595 lines (+166/-151) 12 files modified
plugins/unityshell/src/BFBLauncherIcon.cpp (+2/-4) plugins/unityshell/src/BamfLauncherIcon.cpp (+8/-4) plugins/unityshell/src/LauncherIcon.cpp (+8/-8) plugins/unityshell/src/QuicklistMenuItem.cpp (+103/-38) plugins/unityshell/src/QuicklistMenuItem.h (+7/-3) plugins/unityshell/src/QuicklistMenuItemCheckmark.cpp (+9/-30) plugins/unityshell/src/QuicklistMenuItemCheckmark.h (+1/-1) plugins/unityshell/src/QuicklistMenuItemLabel.cpp (+9/-30) plugins/unityshell/src/QuicklistMenuItemLabel.h (+1/-1) plugins/unityshell/src/QuicklistMenuItemRadio.cpp (+9/-31) plugins/unityshell/src/QuicklistMenuItemRadio.h (+1/-1) tests/unit/TestQuicklistMenuitems.cpp (+8/-0) |
To merge this branch: | bzr merge lp:~3v1n0/unity/quicklist-markup-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mirco Müller (community) | Approve | ||
Tim Penhey (community) | Approve | ||
Review via email: mp+84695@code.launchpad.net |
Commit message
QuicklistMenuItem code cleanup and support for markup text and bold application titles.
Description of the change
In order to fix the bug #899677, as the quicklist uses the pango markup to draw its label, I made the quicklist to always escape the label text by default.
Actually this could have been done also making pango to just draw text, but since the design team asked me to still support the "_" (underscore) to show menu-items accelerators, I had to use this way.
Also, now a quicklist item can use markup only if the related dbusmenuitem has a "unity-use-markup" property that can be set only internally (i.e. it doesn't work if used through libunity) and that currently we only use to make every application name bold (to fix bug #900400).
I've also made a code cleanup of the QuicklistMenuItem* to reduce the code duplication, however I've not changed too much the types used not to change too much what has been already done.
Some basic tests have also been added.
OK, lets make:
gchar* app_name; escape_ text(BamfName( ), -1); printf( "<b>%s< /b>", tmp);
gchar* tmp;
tmp = g_markup_
app_name = g_strdup_
g_free(tmp);
less C and more C++ :)
#include <sstream>
glib::String app_name( g_markup_ escape_ text(BamfName( ), -1)); ostringstream sout;
std::
sout << "<b>" << app_name << "</b>";
// use sout.str().c_str(); to get a const char*
No need for g_free(app_name).
Why did you remove the texture unreferencing?