mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
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:
parent
0f7ce1f2ad
commit
a95598d5e4
4 changed files with 13 additions and 25 deletions
|
|
@ -50,8 +50,6 @@ Item {
|
||||||
*/
|
*/
|
||||||
property bool disableSystemTray: false
|
property bool disableSystemTray: false
|
||||||
|
|
||||||
property color colorScopeColor: Kirigami.Theme.backgroundColor
|
|
||||||
|
|
||||||
readonly property real textPixelSize: Math.round(11 * ShellSettings.Settings.statusBarScaleFactor)
|
readonly property real textPixelSize: Math.round(11 * ShellSettings.Settings.statusBarScaleFactor)
|
||||||
readonly property real smallerTextPixelSize: Math.round(9 * ShellSettings.Settings.statusBarScaleFactor)
|
readonly property real smallerTextPixelSize: Math.round(9 * ShellSettings.Settings.statusBarScaleFactor)
|
||||||
readonly property real elementSpacing: Math.round(Kirigami.Units.smallSpacing * 1.5)
|
readonly property real elementSpacing: Math.round(Kirigami.Units.smallSpacing * 1.5)
|
||||||
|
|
|
||||||
|
|
@ -38,17 +38,7 @@ Item {
|
||||||
showTime: !MobileShellState.LockscreenDBusClient.lockscreenActive // Don't show time on the lockscreen, since we already have a massive clock
|
showTime: !MobileShellState.LockscreenDBusClient.lockscreenActive // Don't show time on the lockscreen, since we already have a massive clock
|
||||||
|
|
||||||
showDropShadow: root.transparentBackground
|
showDropShadow: root.transparentBackground
|
||||||
backgroundColor: {
|
backgroundColor: root.transparentBackground ? "transparent" : Kirigami.Theme.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transform: [
|
transform: [
|
||||||
Translate {
|
Translate {
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,12 @@ import org.kde.kirigami as Kirigami
|
||||||
MobileShell.NavigationPanel {
|
MobileShell.NavigationPanel {
|
||||||
id: root
|
id: root
|
||||||
required property bool opaqueBar
|
required property bool opaqueBar
|
||||||
required property var navbarState
|
|
||||||
|
|
||||||
// background is:
|
// background is:
|
||||||
// - opaque if an app is shown or vkbd is shown
|
// - opaque if an app is shown or vkbd is shown
|
||||||
// - translucent if the task switcher is open
|
// - translucent if the task switcher is open
|
||||||
// - transparent if on the homescreen
|
// - 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
|
foregroundColorGroup: opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.Complementary
|
||||||
shadow: !opaqueBar
|
shadow: !opaqueBar
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,12 @@ ContainmentItem {
|
||||||
|
|
||||||
// only opaque if there are no maximized windows on this screen
|
// 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 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 alias isCurrentWindowFullscreen: windowMaximizedTracker.isCurrentWindowFullscreen
|
||||||
readonly property bool fullscreen: isCurrentWindowFullscreen || (ShellSettings.Settings.autoHidePanelsEnabled && opaqueBar)
|
readonly property bool fullscreen: isCurrentWindowFullscreen || (ShellSettings.Settings.autoHidePanelsEnabled && opaqueBar)
|
||||||
|
|
||||||
|
|
@ -165,14 +170,9 @@ ContainmentItem {
|
||||||
visible: !root.fullscreen
|
visible: !root.fullscreen
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: navigationPanel
|
id: navigationPanel
|
||||||
anchors.fill: parent
|
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
|
property real offset: 0
|
||||||
|
|
||||||
|
|
@ -181,7 +181,6 @@ ContainmentItem {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opaqueBar: root.opaqueBar
|
opaqueBar: root.opaqueBar
|
||||||
isVertical: root.inLandscape
|
isVertical: root.inLandscape
|
||||||
navbarState: navigationPanel.state
|
|
||||||
|
|
||||||
transform: [
|
transform: [
|
||||||
Translate {
|
Translate {
|
||||||
|
|
@ -223,7 +222,9 @@ ContainmentItem {
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
PropertyAnimation {
|
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 {
|
ScriptAction {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue