Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Add custom bfb icon in /custom/graphics
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
UniversalSuperBox committed Oct 14, 2020
1 parent 271e579 commit e9db69f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
File renamed without changes.
17 changes: 14 additions & 3 deletions qml/Launcher/LauncherPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,27 @@ Rectangle {
color: UbuntuColors.orange
readonly property bool highlighted: root.highlightIndex == -1;

Icon {
Image {
objectName: "dashItem"
width: parent.width * .6
height: width
anchors.centerIn: parent
source: "graphics/home.svg"
color: "white"
source: homeIconResolver.background
rotation: root.rotation
}

ImageResolver {
id: homeIconResolver
objectName: "homeIconResolver"

readonly property url defaultHomeIcon: "graphics/home.svg"

candidates: [
"file:///custom/graphics/homebutton.svg",
defaultHomeIcon
]
}

AbstractButton {
id: dashItem
anchors.fill: parent
Expand Down
2 changes: 1 addition & 1 deletion qml/Shell.qml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ StyledItem {

property real edgeSize: units.gu(settings.edgeDragWidth)

WallpaperResolver {
ImageResolver {
id: wallpaperResolver
objectName: "wallpaperResolver"

Expand Down
2 changes: 1 addition & 1 deletion tests/qmltests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ add_unity8_qmltest(Components ResponsiveGridView)
add_unity8_qmltest(Components SharingPicker)
add_unity8_qmltest(Components Showable)
add_unity8_qmltest(Components VirtualTouchPad)
add_unity8_qmltest(Components WallpaperResolver)
add_unity8_qmltest(Components ImageResolver)
add_unity8_qmltest(Components ZoomableImage)
add_unity8_qmltest(Greeter Clock)
add_unity8_qmltest(Greeter Greeter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Image {
width: units.gu(70)
height: units.gu(70)

source: wallpaperResolver.background
source: imageResolver.background

WallpaperResolver {
id: wallpaperResolver
ImageResolver {
id: imageResolver
}

UnityTestCase {
id: testCase
name: "WallpaperResolver"
name: "ImageResolver"
when: windowShown

function test_background_data() {
Expand Down Expand Up @@ -68,8 +68,8 @@ Image {
}

function test_background(data) {
wallpaperResolver.candidates = data.list;
tryCompare(wallpaperResolver, "background", data.output);
imageResolver.candidates = data.list;
tryCompare(imageResolver, "background", data.output);
}
}
}

0 comments on commit e9db69f

Please sign in to comment.