mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
This commit changes the action drawer colorsets to be contextually correct. The panel background would use the window background colors (instead of the view ones), and quicksettings delegates would use colors from the Button color set (rather than the view).
This also changes the background scrim to always be dark even in light mode. I think this is important to do because we have two views (notifications, and quick settings), which currently don't have much in the way of colours to distinguish the two.
This commit also makes some changes to the notifications widget in order for its card foreground to be the standard theme colors.
{width=200}
{width=200}
{width=300}
{width=200}
{width=200}
{width=300}
63 lines
2.4 KiB
QML
63 lines
2.4 KiB
QML
// SPDX-FileCopyrightText: 2021-2024 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import QtQuick.Window
|
|
|
|
import org.kde.kirigami 2.12 as Kirigami
|
|
|
|
import org.kde.plasma.core as PlasmaCore
|
|
import org.kde.plasma.plasma5support 2.0 as P5Support
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
|
|
|
/**
|
|
* Root element that contains all the ActionDrawer's contents, and is anchored to the screen.
|
|
*/
|
|
Item {
|
|
id: root
|
|
|
|
required property var actionDrawer
|
|
|
|
property alias quickSettings: quickSettingsPanel.quickSettings
|
|
property alias statusBar: quickSettingsPanel.statusBar
|
|
|
|
readonly property real minimizedQuickSettingsOffset: height
|
|
readonly property real maximizedQuickSettingsOffset: height
|
|
readonly property bool isOnLargeScreen: width > quickSettingsPanel.width * 2.5
|
|
readonly property real minWidthHeight: Math.min(root.width, root.height)
|
|
readonly property real opacityValue: Math.max(0, Math.min(1, actionDrawer.offsetResistance / root.minimizedQuickSettingsOffset))
|
|
readonly property double brightnessPressedValue: quickSettings.brightnessPressedValue
|
|
|
|
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
|
Kirigami.Theme.inherit: false
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
|
|
// dismiss drawer when background is clicked
|
|
onClicked: root.actionDrawer.close();
|
|
|
|
// right sidebar
|
|
MobileShell.QuickSettingsPanel {
|
|
id: quickSettingsPanel
|
|
height: quickSettingsPanel.contentImplicitHeight + quickSettingsPanel.topPadding + quickSettingsPanel.bottomPadding
|
|
width: intendedWidth
|
|
|
|
readonly property real columnWidth: 6 * Kirigami.Units.gridUnit
|
|
readonly property real intendedWidth: (columnWidth * ShellSettings.Settings.quickSettingsColumns) + Kirigami.Units.gridUnit
|
|
|
|
property real offsetRatio: quickSettingsPanel.height / root.height
|
|
anchors.topMargin: Math.min(root.actionDrawer.offsetResistance * offsetRatio - quickSettingsPanel.height, 0)
|
|
anchors.top: parent.top
|
|
anchors.right: parent.right
|
|
|
|
actionDrawer: root.actionDrawer
|
|
fullScreenHeight: root.height
|
|
}
|
|
}
|
|
}
|