on xenial help sign in
Do not show a divider between each quicklist entry but just between each section, similar to how unity7 does. (LP: #1637478)

Approved by: Albert Astals Cid, Unity8 CI Bot

commit4833f303ab2c22fe987758ea6da594ed26acc3a7 authorAndrea Azzarone <azzaronea@gmail.com> dateTue 29 Nov 2016, 09:38 (10 years ago) parent748ab6c9e563a3
12 files changed+29−8
debian/control+3−3 plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 plugins/Unity/Launcher/CMakeLists.txt+1−1 plugins/Unity/Launcher/launcheritem.cpp+1 plugins/Unity/Launcher/quicklistentry.cpp+11 plugins/Unity/Launcher/quicklistentry.h+4 plugins/Unity/Launcher/quicklistmodel.cpp+2 qml/Launcher/LauncherPanel.qml+1 tests/mocks/Unity/Launcher/CMakeLists.txt+1−1 tests/mocks/Unity/Launcher/MockQuickListModel.cpp+2 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
debian/control+3−3
@@ -38,7 +38,7 @@ Build-Depends: cmake,
3838 libubuntugestures5-private-dev (>= 1.3.2030),
3939 libudev-dev,
4040 libudm-common-dev,
41− libunity-api-dev (>= 7.119),
41+ libunity-api-dev (>= 7.120),
4242 libusermetricsoutput1-dev,
4343# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
4444 libx11-dev[!arm64 !armhf],
@@ -128,7 +128,7 @@ Depends: dmz-cursor-theme,
128128 qtdeclarative5-ubuntu-telephony0.1,
129129 qtdeclarative5-ubuntu-web-plugin,
130130 ubuntu-system-settings (>= 0.4),
131− unity-launcher-impl-7,
131+ unity-launcher-impl-10,
132132 unity8-common (= ${source:Version}),
133133 unity8-private (= ${binary:Version}),
134134 unity8-private | unity-launcher-impl,
@@ -225,7 +225,7 @@ Depends: accountsservice-ubuntu-schemas (>= 0.0.7),
225225 ${misc:Depends},
226226 ${shlibs:Depends},
227227Provides: unity-launcher-impl,
228− unity-launcher-impl-7,
228+ unity-launcher-impl-10,
229229Description: Unity 8 private libs
230230 The Unity 8 shell is the primary user interface for Ubuntu devices.
231231 .
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=9)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
22pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
33
44add_definitions(-DSM_BUSNAME=systemBus)
plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=9)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
22pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
33
44add_definitions(-DSM_BUSNAME=systemBus)
plugins/Unity/Launcher/launcheritem.cpp+1
@@ -42,6 +42,7 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
4242 QuickListEntry nameAction;
4343 nameAction.setActionId(QStringLiteral("launch_item"));
4444 nameAction.setText(m_name);
45+ nameAction.setHasSeparator(true);
4546 m_quickList->appendAction(nameAction);
4647
4748 QuickListEntry pinningAction;
plugins/Unity/Launcher/quicklistentry.cpp+11
@@ -19,6 +19,7 @@
1919#include "quicklistentry.h"
2020
2121QuickListEntry::QuickListEntry()
22+ : m_hasSeparator(false)
2223{
2324}
2425
@@ -57,6 +58,16 @@ bool QuickListEntry::clickable() const
5758 return !m_actionId.isEmpty();
5859}
5960
61+void QuickListEntry::setHasSeparator(bool hasSeparator)
62+{
63+ m_hasSeparator = hasSeparator;
64+}
65+
66+bool QuickListEntry::hasSeparator() const
67+{
68+ return m_hasSeparator;
69+}
70+
6071bool QuickListEntry::operator==(const QuickListEntry &other)
6172{
6273 return !other.actionId().isEmpty() && other.actionId() == m_actionId;
plugins/Unity/Launcher/quicklistentry.h+4
@@ -37,12 +37,16 @@ public:
3737
3838 bool clickable() const;
3939
40+ void setHasSeparator(bool hasSeparator);
41+ bool hasSeparator() const;
42+
4043 bool operator==(const QuickListEntry & other);
4144
4245private:
4346 QString m_actionId;
4447 QString m_text;
4548 QString m_icon;
49+ bool m_hasSeparator;
4650};
4751
4852#endif // QUICKLISTENTRY
plugins/Unity/Launcher/quicklistmodel.cpp+2
@@ -79,6 +79,8 @@ QVariant QuickListModel::data(const QModelIndex &index, int role) const
7979 return m_list.at(index.row()).icon();
8080 case RoleClickable:
8181 return m_list.at(index.row()).clickable();
82+ case RoleHasSeparator:
83+ return m_list.at(index.row()).hasSeparator();
8284 }
8385 return QVariant();
8486}
qml/Launcher/LauncherPanel.qml+1
@@ -795,6 +795,7 @@ Rectangle {
795795 highlightColor: !model.clickable ? quickList.color : undefined // make disabled items visually unclickable
796796 divider.colorFrom: UbuntuColors.inkstone
797797 divider.colorTo: UbuntuColors.inkstone
798+ divider.visible: model.hasSeparator
798799
799800 Label {
800801 id: label
tests/mocks/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=9)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
22
33include_directories(
44 ${CMAKE_CURRENT_SOURCE_DIR}
tests/mocks/Unity/Launcher/MockQuickListModel.cpp+2
@@ -37,6 +37,8 @@ QVariant MockQuickListModel::data(const QModelIndex &index, int role) const
3737 return QLatin1String("copy.png");
3838 case RoleClickable:
3939 return index.row() == 1 ? false : true;
40+ case RoleHasSeparator:
41+ return index.row() <= 1 ? true : false;
4042 }
4143 return QVariant();
4244}
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
22
33include_directories(
44 ${CMAKE_CURRENT_SOURCE_DIR}
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
11pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
2−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
2+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=10)
33
44include_directories(
55 ${CMAKE_CURRENT_SOURCE_DIR}