on xenial help sign in
Add custom bfb icon in /custom/graphics

With this commit, a custom SVG file will be loaded from /custom/graphics/homebutton.svg and used rather than the default icon. This allows distributors to have their own logo or another symbol as the bfb icon. This repurposes the WallpaperResolver, so I've renamed it to ImageResolver to better suit its new job.

commit26739af65b25c3494bdda71f99a23eb6519a9b1c authorDalton Durst <dalton@ubports.com> dateSun 26 Apr 2020, 13:12 (6 years ago) parent0db5b3b
5 files changed+22−11
qml/Components/WallpaperResolver.qml → qml/Components/ImageResolver.qml qml/Launcher/LauncherPanel.qml+14−3 qml/Shell.qml+1−1 tests/qmltests/CMakeLists.txt+1−1 tests/qmltests/Components/tst_WallpaperResolver.qml → tests/qmltests/Components/tst_ImageResolver.qml+6−6
qml/Components/WallpaperResolver.qml → qml/Components/ImageResolver.qmlrenamed

The content is the same.

qml/Launcher/LauncherPanel.qml+14−3
@@ -90,16 +90,27 @@ Rectangle {
9090 color: UbuntuColors.orange
9191 readonly property bool highlighted: root.highlightIndex == -1;
9292
93− Icon {
93+ Image {
9494 objectName: "dashItem"
9595 width: parent.width * .6
9696 height: width
9797 anchors.centerIn: parent
98− source: "graphics/home.svg"
99− color: "white"
98+ source: homeIconResolver.background
10099 rotation: root.rotation
101100 }
102101
102+ ImageResolver {
103+ id: homeIconResolver
104+ objectName: "homeIconResolver"
105+
106+ readonly property url defaultHomeIcon: "graphics/home.svg"
107+
108+ candidates: [
109+ "file:///custom/graphics/homebutton.svg",
110+ defaultHomeIcon
111+ ]
112+ }
113+
103114 AbstractButton {
104115 id: dashItem
105116 anchors.fill: parent
qml/Shell.qml+1−1
@@ -157,7 +157,7 @@ StyledItem {
157157
158158 property real edgeSize: units.gu(settings.edgeDragWidth)
159159
160− WallpaperResolver {
160+ ImageResolver {
161161 id: wallpaperResolver
162162 objectName: "wallpaperResolver"
163163
tests/qmltests/CMakeLists.txt+1−1
@@ -24,7 +24,7 @@ add_unity8_qmltest(Components ResponsiveGridView)
2424add_unity8_qmltest(Components SharingPicker)
2525add_unity8_qmltest(Components Showable)
2626add_unity8_qmltest(Components VirtualTouchPad)
27−add_unity8_qmltest(Components WallpaperResolver)
27+add_unity8_qmltest(Components ImageResolver)
2828add_unity8_qmltest(Components ZoomableImage)
2929add_unity8_qmltest(Greeter Clock)
3030add_unity8_qmltest(Greeter Greeter)
tests/qmltests/Components/tst_WallpaperResolver.qml → tests/qmltests/Components/tst_ImageResolver.qmlrenamed+6−6
@@ -26,15 +26,15 @@ Image {
2626 width: units.gu(70)
2727 height: units.gu(70)
2828
29− source: wallpaperResolver.background
29+ source: imageResolver.background
3030
31− WallpaperResolver {
32− id: wallpaperResolver
31+ ImageResolver {
32+ id: imageResolver
3333 }
3434
3535 UnityTestCase {
3636 id: testCase
37− name: "WallpaperResolver"
37+ name: "ImageResolver"
3838 when: windowShown
3939
4040 function test_background_data() {
@@ -68,8 +68,8 @@ Image {
6868 }
6969
7070 function test_background(data) {
71− wallpaperResolver.candidates = data.list;
72− tryCompare(wallpaperResolver, "background", data.output);
71+ imageResolver.candidates = data.list;
72+ tryCompare(imageResolver, "background", data.output);
7373 }
7474 }
7575}