panels: Fix panels having partial opacity and convoluted vkbd colors

A custom 0.95 opacity was added to the panels in
https://invent.kde.org/plasma/plasma-mobile/-/merge_requests/642 for
overlaying applications. This
required some complicated logic and layering to mix with other modes of
operation. Since this broke at some point, simplify the logic completely
so that it's just a flat colour. This also fixes the navigation panel
not having a colour when the keyboard is shown over the homescreen.
This commit is contained in:
Devin Lin 2025-09-13 22:18:32 -04:00
parent 0f7ce1f2ad
commit a95598d5e4
4 changed files with 13 additions and 25 deletions

View file

@ -50,8 +50,6 @@ Item {
*/
property bool disableSystemTray: false
property color colorScopeColor: Kirigami.Theme.backgroundColor
readonly property real textPixelSize: Math.round(11 * ShellSettings.Settings.statusBarScaleFactor)
readonly property real smallerTextPixelSize: Math.round(9 * ShellSettings.Settings.statusBarScaleFactor)
readonly property real elementSpacing: Math.round(Kirigami.Units.smallSpacing * 1.5)

View file

@ -38,17 +38,7 @@ Item {
showTime: !MobileShellState.LockscreenDBusClient.lockscreenActive // Don't show time on the lockscreen, since we already have a massive clock
showDropShadow: root.transparentBackground
backgroundColor: {
if (root.transparentBackground) {
return "transparent";
}
if (state == "default") {
return Kirigami.Theme.backgroundColor;
} else {
return Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.95);
}
}
backgroundColor: root.transparentBackground ? "transparent" : Kirigami.Theme.backgroundColor
transform: [
Translate {
@ -97,4 +87,4 @@ Item {
}
}
}
}
}

View file

@ -21,13 +21,12 @@ import org.kde.kirigami as Kirigami
MobileShell.NavigationPanel {
id: root
required property bool opaqueBar
required property var navbarState
// background is:
// - opaque if an app is shown or vkbd is shown
// - translucent if the task switcher is open
// - transparent if on the homescreen
backgroundColor: navbarState != "default" && opaqueBar ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.95) : "transparent"
backgroundColor: opaqueBar ? Kirigami.Theme.backgroundColor : "transparent"
foregroundColorGroup: opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.Complementary
shadow: !opaqueBar

View file

@ -137,7 +137,12 @@ ContainmentItem {
// only opaque if there are no maximized windows on this screen
readonly property bool showingStartupFeedback: MobileShellState.ShellDBusObject.startupFeedbackModel.activeWindowIsStartupFeedback && startupFeedbackColorAnimation.visible && windowMaximizedTracker.windowCount === 1
readonly property bool opaqueBar: (windowMaximizedTracker.showingWindow || isCurrentWindowFullscreen) && !showingStartupFeedback
readonly property bool opaqueBar: {
if (Keyboards.KWinVirtualKeyboard.visible) {
return true;
}
return (windowMaximizedTracker.showingWindow || isCurrentWindowFullscreen) && !showingStartupFeedback
}
readonly property alias isCurrentWindowFullscreen: windowMaximizedTracker.isCurrentWindowFullscreen
readonly property bool fullscreen: isCurrentWindowFullscreen || (ShellSettings.Settings.autoHidePanelsEnabled && opaqueBar)
@ -165,14 +170,9 @@ ContainmentItem {
visible: !root.fullscreen
}
Rectangle {
Item {
id: navigationPanel
anchors.fill: parent
// contrasting colour
Kirigami.Theme.colorSet: root.opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.Complementary
Kirigami.Theme.inherit: false
color: navigationPanel.state == "default" && (Keyboards.KWinVirtualKeyboard.visible || root.opaqueBar) ? Kirigami.Theme.backgroundColor : "transparent"
property real offset: 0
@ -181,7 +181,6 @@ ContainmentItem {
anchors.fill: parent
opaqueBar: root.opaqueBar
isVertical: root.inLandscape
navbarState: navigationPanel.state
transform: [
Translate {
@ -223,7 +222,9 @@ ContainmentItem {
SequentialAnimation {
ParallelAnimation {
PropertyAnimation {
properties: "offset"; easing.type: navigationPanel.state === "hidden" ? Easing.InExpo : Easing.OutExpo; duration: Kirigami.Units.longDuration
properties: "offset"
easing.type: navigationPanel.state === "hidden" ? Easing.InExpo : Easing.OutExpo
duration: Kirigami.Units.longDuration
}
}
ScriptAction {