Port to use IconItem again

This commit is contained in:
Aleix Pol 2021-03-02 16:17:52 +01:00 committed by Aleix Pol Gonzalez
parent 31fceb18f8
commit 13f21bf23b
2 changed files with 11 additions and 48 deletions

View file

@ -20,6 +20,7 @@ Item {
property MouseArea mouseArea
readonly property bool pressed: mouseArea.pressed && mouseArea.activeButton == button
property alias iconSource: icon.source
property alias colorGroup: icon.colorGroup
signal clicked()
Rectangle {
@ -64,7 +65,10 @@ Item {
}
PlasmaCore.IconItem {
id: icon
anchors.fill: parent
anchors {
fill: parent
margins: parent.height * 0.25
}
colorGroup: PlasmaCore.ColorScope.colorGroup
//enabled: button.enabled && button.clickable
}

View file

@ -169,17 +169,6 @@ PlasmaCore.ColorScope {
visible: plasmoid.configuration.PanelButtonsVisible
PlasmaCore.Svg {
id: panelSvg
imagePath: "icons/mobile"
colorGroup: root.showingApp ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
}
PlasmaCore.Svg {
id: startSvg
imagePath: "icons/start"
colorGroup: root.showingApp ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
}
Rectangle {
anchors.fill: parent
gradient: Gradient {
@ -211,18 +200,8 @@ PlasmaCore.ColorScope {
plasmoid.nativeInterface.showDesktop = false;
taskSwitcher.visible ? taskSwitcher.hide() : taskSwitcher.show();
}
PlasmaCore.SvgItem {
anchors.centerIn: parent
implicitHeight: 0.75 * parent.height * 0.6 // 0.75 sizing adjustment fix needed
implicitWidth: implicitHeight
opacity: parent.enabled ? 1 : 0.5
svg: panelSvg
elementId: "mobile-task-switcher"
Behavior on opacity {
NumberAnimation { duration: units.shortDuration }
}
}
iconSource: "mobile-task-switcher"
colorGroup: root.showingApp ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
}
Button {
@ -243,18 +222,8 @@ PlasmaCore.ColorScope {
MobileShell.HomeScreenControls.resetHomeScreenPosition();
plasmoid.nativeInterface.allMinimizedChanged();
}
PlasmaCore.SvgItem {
anchors.centerIn: parent
implicitHeight: parent.height * 0.6
implicitWidth: implicitHeight
opacity: parent.enabled ? 1 : 0.5
svg: startSvg
elementId: "16-16-start-here-kde"
Behavior on opacity {
NumberAnimation { duration: units.shortDuration }
}
}
iconSource: "start-here-kde"
colorGroup: root.showingApp ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
}
Button {
@ -284,18 +253,8 @@ PlasmaCore.ColorScope {
}
}
PlasmaCore.SvgItem {
anchors.centerIn: parent
implicitHeight: 0.75 * parent.height * 0.6 // 0.75 sizing adjustment fix needed
implicitWidth: implicitHeight
opacity: parent.enabled ? 1 : 0.5
svg: panelSvg
elementId: TaskPanel.KWinVirtualKeyboard.active ? "go-down" : "mobile-close-app"
Behavior on opacity {
NumberAnimation { duration: units.shortDuration }
}
}
iconSource: TaskPanel.KWinVirtualKeyboard.active ? "go-down" : "mobile-close-app"
colorGroup: root.showingApp ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
}
}
}