1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

refactor all modals and popouts so they retain animations on exit

This commit is contained in:
bbedward
2025-08-19 15:44:43 -04:00
parent 5fba96f345
commit 2a28f99831
36 changed files with 1499 additions and 1452 deletions

View File

@@ -10,18 +10,14 @@ import qs.Modules.AppDrawer
import qs.Services
import qs.Widgets
PanelWindow {
DankPopout {
id: appDrawerPopout
property bool isVisible: false
property real triggerX: Theme.spacingL
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
property real triggerWidth: 40
property string triggerSection: "left"
property var triggerScreen: null
function show() {
appDrawerPopout.isVisible = true
open()
appLauncher.searchQuery = ""
appLauncher.selectedIndex = 0
appLauncher.setCategory("All")
@@ -29,14 +25,7 @@ PanelWindow {
}
function hide() {
appDrawerPopout.isVisible = false
}
function toggle() {
if (appDrawerPopout.isVisible)
hide()
else
show()
close()
}
function setTriggerPosition(x, y, width, section, screen) {
@@ -47,21 +36,15 @@ PanelWindow {
triggerScreen = screen
}
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
popupWidth: 520
popupHeight: 600
triggerX: Theme.spacingL
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
triggerWidth: 40
positioning: "center"
WlrLayershell.namespace: "quickshell-launcher"
visible: isVisible
color: "transparent"
screen: triggerScreen
anchors {
top: true
left: true
right: true
bottom: true
}
AppLauncher {
id: appLauncher
@@ -73,67 +56,8 @@ PanelWindow {
}
}
MouseArea {
anchors.fill: parent
enabled: appDrawerPopout.isVisible
onClicked: function (mouse) {
var localPos = mapToItem(launcherLoader, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > launcherLoader.width || localPos.y < 0
|| localPos.y > launcherLoader.height)
appDrawerPopout.hide()
}
}
Loader {
id: launcherLoader
readonly property real popupWidth: 520
readonly property real popupHeight: 600
readonly property real screenWidth: appDrawerPopout.screen ? appDrawerPopout.screen.width : Screen.width
readonly property real screenHeight: appDrawerPopout.screen ? appDrawerPopout.screen.height : Screen.height
readonly property real calculatedX: {
var centerX = appDrawerPopout.triggerX + (appDrawerPopout.triggerWidth / 2) - (popupWidth / 2)
if (centerX >= Theme.spacingM
&& centerX + popupWidth <= screenWidth - Theme.spacingM)
return centerX
if (centerX < Theme.spacingM)
return Theme.spacingM
if (centerX + popupWidth > screenWidth - Theme.spacingM)
return screenWidth - popupWidth - Theme.spacingM
return centerX
}
readonly property real calculatedY: appDrawerPopout.triggerY
asynchronous: true
active: appDrawerPopout.isVisible
width: popupWidth
height: popupHeight
x: calculatedX
y: calculatedY
opacity: appDrawerPopout.isVisible ? 1 : 0
scale: appDrawerPopout.isVisible ? 1 : 0.9
Behavior on opacity {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on scale {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
sourceComponent: Rectangle {
content: Component {
Rectangle {
id: launcherPanel
color: Theme.popupBackground()
@@ -177,12 +101,12 @@ PanelWindow {
anchors.fill: parent
focus: true
Component.onCompleted: {
if (appDrawerPopout.isVisible)
if (appDrawerPopout.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
appDrawerPopout.hide()
appDrawerPopout.close()
event.accepted = true
} else if (event.key === Qt.Key_Down) {
appLauncher.selectNext()
@@ -262,15 +186,17 @@ PanelWindow {
leftIconFocusedColor: Theme.primary
showClearButton: true
font.pixelSize: Theme.fontSizeLarge
enabled: appDrawerPopout.isVisible
placeholderText: "Search applications..."
enabled: appDrawerPopout.shouldBeVisible
ignoreLeftRightKeys: true
keyForwardTargets: [keyHandler]
onTextEdited: {
appLauncher.searchQuery = text
}
Keys.onPressed: function (event) {
if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
if (event.key === Qt.Key_Escape) {
appDrawerPopout.close()
event.accepted = true
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
&& text.length > 0) {
if (appLauncher.keyboardNavigationActive
&& appLauncher.model.count > 0) {
@@ -288,13 +214,13 @@ PanelWindow {
}
}
Component.onCompleted: {
if (appDrawerPopout.isVisible)
if (appDrawerPopout.shouldBeVisible)
searchField.forceActiveFocus()
}
Connections {
function onIsVisibleChanged() {
if (appDrawerPopout.isVisible)
function onShouldBeVisibleChanged() {
if (appDrawerPopout.shouldBeVisible)
Qt.callLater(function () {
searchField.forceActiveFocus()
})
@@ -560,10 +486,10 @@ PanelWindow {
if (mouse.button === Qt.LeftButton) {
appList.itemClicked(index, model)
} else if (mouse.button === Qt.RightButton) {
var globalPos = mapToGlobal(mouse.x, mouse.y)
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
appList.itemRightClicked(index, model,
globalPos.x,
globalPos.y)
panelPos.x,
panelPos.y)
}
}
}
@@ -737,10 +663,10 @@ PanelWindow {
if (mouse.button === Qt.LeftButton) {
appGrid.itemClicked(index, model)
} else if (mouse.button === Qt.RightButton) {
var globalPos = mapToGlobal(mouse.x, mouse.y)
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
appGrid.itemRightClicked(index, model,
globalPos.x,
globalPos.y)
panelPos.x,
panelPos.y)
}
}
}
@@ -752,205 +678,237 @@ PanelWindow {
}
}
Popup {
Rectangle {
id: contextMenu
property var currentApp: null
property bool menuVisible: false
function show(x, y, app) {
currentApp = app
if (!contextMenu.parent && typeof Overlay !== "undefined"
&& Overlay.overlay)
contextMenu.parent = Overlay.overlay
const menuWidth = 180
const menuHeight = menuColumn.implicitHeight + Theme.spacingS * 2
const screenWidth = Screen.width
const screenHeight = Screen.height
let finalX = x
let finalY = y
if (x + menuWidth > screenWidth - 20)
finalX = x - menuWidth
if (y + menuHeight > screenHeight - 20)
finalY = y - menuHeight
contextMenu.x = Math.max(20, finalX)
contextMenu.y = Math.max(20, finalY)
open()
let finalX = x + 8
let finalY = y + 8
if (finalX + menuWidth > appDrawerPopout.popupWidth) {
finalX = x - menuWidth - 8
}
if (finalY + menuHeight > appDrawerPopout.popupHeight) {
finalY = y - menuHeight - 8
}
finalX = Math.max(8, Math.min(finalX, appDrawerPopout.popupWidth - menuWidth - 8))
finalY = Math.max(8, Math.min(finalY, appDrawerPopout.popupHeight - menuHeight - 8))
contextMenu.x = finalX
contextMenu.y = finalY
contextMenu.visible = true
contextMenu.menuVisible = true
}
function close() {
contextMenu.menuVisible = false
Qt.callLater(() => {
contextMenu.visible = false
})
}
visible: false
width: 180
height: menuColumn.implicitHeight + Theme.spacingS * 2
padding: 0
modal: false
closePolicy: Popup.CloseOnEscape
onClosed: {
closePolicy = Popup.CloseOnEscape
}
onOpened: {
outsideClickTimer.start()
radius: Theme.cornerRadius
color: Theme.popupBackground()
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
border.width: 1
z: 1000
opacity: menuVisible ? 1 : 0
scale: menuVisible ? 1 : 0.85
Rectangle {
anchors.fill: parent
anchors.topMargin: 4
anchors.leftMargin: 2
anchors.rightMargin: -2
anchors.bottomMargin: -4
radius: parent.radius
color: Qt.rgba(0, 0, 0, 0.15)
z: parent.z - 1
}
Timer {
id: outsideClickTimer
Column {
id: menuColumn
interval: 100
onTriggered: {
contextMenu.closePolicy = Popup.CloseOnEscape | Popup.CloseOnPressOutside
}
}
anchors.fill: parent
anchors.margins: Theme.spacingS
spacing: 1
background: Rectangle {
color: "transparent"
}
Rectangle {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
contentItem: Rectangle {
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.08)
border.width: 1
Row {
anchors.left: parent.left
anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingS
Column {
id: menuColumn
anchors.fill: parent
anchors.margins: Theme.spacingS
spacing: 1
Rectangle {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
Row {
anchors.left: parent.left
anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingS
DankIcon {
name: {
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return "push_pin"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
}
size: Theme.iconSize - 2
color: Theme.surfaceText
opacity: 0.7
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: {
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return "Pin to Dock"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(
appId) ? "Unpin from Dock" : "Pin to Dock"
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: pinMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
DankIcon {
name: {
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return
return "push_pin"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
if (SessionData.isPinnedApp(appId))
SessionData.removePinnedApp(appId)
else
SessionData.addPinnedApp(appId)
contextMenu.close()
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
}
}
}
Rectangle {
width: parent.width - Theme.spacingS * 2
height: 5
anchors.horizontalCenter: parent.horizontalCenter
color: "transparent"
Rectangle {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
Rectangle {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
Row {
anchors.left: parent.left
anchors.leftMargin: Theme.spacingS
size: Theme.iconSize - 2
color: Theme.surfaceText
opacity: 0.7
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingS
DankIcon {
name: "launch"
size: Theme.iconSize - 2
color: Theme.surfaceText
opacity: 0.7
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Launch"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: launchMouseArea
StyledText {
text: {
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return "Pin to Dock"
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (contextMenu.currentApp)
appLauncher.launchApp(contextMenu.currentApp)
contextMenu.close()
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(
appId) ? "Unpin from Dock" : "Pin to Dock"
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: pinMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
if (SessionData.isPinnedApp(appId))
SessionData.removePinnedApp(appId)
else
SessionData.addPinnedApp(appId)
contextMenu.close()
}
}
}
Rectangle {
width: parent.width - Theme.spacingS * 2
height: 5
anchors.horizontalCenter: parent.horizontalCenter
color: "transparent"
Rectangle {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
}
}
Rectangle {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
Row {
anchors.left: parent.left
anchors.leftMargin: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
spacing: Theme.spacingS
DankIcon {
name: "launch"
size: Theme.iconSize - 2
color: Theme.surfaceText
opacity: 0.7
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Launch"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: launchMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (contextMenu.currentApp)
appLauncher.launchApp(contextMenu.currentApp)
contextMenu.close()
}
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on scale {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
MouseArea {
anchors.fill: parent
visible: contextMenu.visible
z: 999
onClicked: {
contextMenu.close()
}
MouseArea {
x: contextMenu.x
y: contextMenu.y
width: contextMenu.width
height: contextMenu.height
onClicked: {
// Prevent closing when clicking on the menu itself
}
}
}

View File

@@ -14,6 +14,7 @@ PanelWindow {
readonly property bool hasActiveMedia: MprisController.activePlayer !== null
property bool calendarVisible: false
property bool shouldBeVisible: false
property real triggerX: (Screen.width - 480) / 2
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + 4
property real triggerWidth: 80
@@ -28,13 +29,29 @@ PanelWindow {
triggerScreen = screen
}
visible: calendarVisible
visible: calendarVisible || closeTimer.running
screen: triggerScreen
onCalendarVisibleChanged: {
if (calendarVisible) {
closeTimer.stop()
shouldBeVisible = true
visible = true
Qt.callLater(() => {
calendarGrid.loadEventsForMonth()
})
} else {
shouldBeVisible = false
closeTimer.restart()
}
}
Timer {
id: closeTimer
interval: Theme.mediumDuration + 50
onTriggered: {
if (!shouldBeVisible) {
visible = false
}
}
}
onVisibleChanged: {
@@ -45,7 +62,7 @@ PanelWindow {
implicitHeight: 600
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
WlrLayershell.keyboardFocus: shouldBeVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
color: "transparent"
anchors {
@@ -123,8 +140,8 @@ PanelWindow {
Theme.outline.b, 0.08)
border.width: 1
layer.enabled: true
opacity: calendarVisible ? 1 : 0
scale: calendarVisible ? 1 : 0.9
opacity: shouldBeVisible ? 1 : 0
scale: shouldBeVisible ? 1 : 0.9
x: calculatedX
y: root.triggerY
onOpacityChanged: {
@@ -166,7 +183,7 @@ PanelWindow {
radius: parent.radius
SequentialAnimation on opacity {
running: calendarVisible
running: shouldBeVisible
loops: Animation.Infinite
NumberAnimation {
@@ -296,7 +313,7 @@ PanelWindow {
MouseArea {
anchors.fill: parent
z: -1
enabled: calendarVisible
enabled: shouldBeVisible
onClicked: function (mouse) {
var localPos = mapToItem(mainContainer, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > mainContainer.width || localPos.y < 0

View File

@@ -11,17 +11,13 @@ import qs.Modules.ControlCenter
import qs.Services
import qs.Widgets
PanelWindow {
DankPopout {
id: root
property bool controlCenterVisible: false
property string currentTab: "network"
property bool powerOptionsExpanded: false
property var triggerScreen: null
property real triggerX: Screen.width - 600 - Theme.spacingL
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
property real triggerWidth: 80
property string triggerSection: "right"
property var triggerScreen: null
function setTriggerPosition(x, y, width, section, screen) {
triggerX = x
@@ -34,82 +30,42 @@ PanelWindow {
signal powerActionRequested(string action, string title, string message)
signal lockRequested
visible: controlCenterVisible
popupWidth: 600
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : (powerOptionsExpanded ? 570 : 500)
triggerX: Screen.width - 600 - Theme.spacingL
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
triggerWidth: 80
positioning: "center"
WlrLayershell.namespace: "quickshell-controlcenter"
screen: triggerScreen
onVisibleChanged: {
NetworkService.autoRefreshEnabled = visible && NetworkService.wifiEnabled
if (!visible && BluetoothService.adapter
&& BluetoothService.adapter.discovering)
BluetoothService.adapter.discovering = false
shouldBeVisible: false
visible: shouldBeVisible
if (visible && UserInfoService)
UserInfoService.getUptime()
}
implicitWidth: 600
implicitHeight: 500
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
color: "transparent"
anchors {
top: true
left: true
right: true
bottom: true
onShouldBeVisibleChanged: {
if (shouldBeVisible) {
NetworkService.autoRefreshEnabled = NetworkService.wifiEnabled
if (UserInfoService)
UserInfoService.getUptime()
} else {
NetworkService.autoRefreshEnabled = false
if (BluetoothService.adapter && BluetoothService.adapter.discovering)
BluetoothService.adapter.discovering = false
}
}
Loader {
id: contentLoader
readonly property real screenWidth: root.screen ? root.screen.width : Screen.width
readonly property real screenHeight: root.screen ? root.screen.height : Screen.height
readonly property real targetWidth: Math.min(
600, screenWidth - Theme.spacingL * 2)
asynchronous: true
active: controlCenterVisible
width: targetWidth
height: root.powerOptionsExpanded ? 570 : 500
y: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
x: {
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2)
if (centerX >= Theme.spacingM
&& centerX + targetWidth <= screenWidth - Theme.spacingM) {
return centerX
content: Component {
Rectangle {
id: controlContent
implicitHeight: {
let baseHeight = Theme.spacingL * 2
baseHeight += 90 // user header
baseHeight += (powerOptionsExpanded ? 60 : 0) + Theme.spacingL // power options
baseHeight += 52 + Theme.spacingL // tab bar
baseHeight += 280 // tab content area
return baseHeight
}
if (centerX < Theme.spacingM) {
return Theme.spacingM
}
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
return screenWidth - targetWidth - Theme.spacingM
}
return centerX
}
opacity: controlCenterVisible ? 1 : 0
scale: controlCenterVisible ? 1 : 0.9
Behavior on opacity {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on scale {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
sourceComponent: Rectangle {
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
@@ -118,13 +74,15 @@ PanelWindow {
antialiasing: true
smooth: true
focus: true
Component.onCompleted: {
if (controlCenterVisible)
if (root.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
controlCenterVisible = false
root.close()
event.accepted = true
} else {
event.accepted = false
@@ -132,10 +90,10 @@ PanelWindow {
}
Connections {
function onControlCenterVisibleChanged() {
if (controlCenterVisible)
function onShouldBeVisibleChanged() {
if (root.shouldBeVisible)
Qt.callLater(function () {
parent.forceActiveFocus()
controlContent.forceActiveFocus()
})
}
target: root
@@ -294,7 +252,7 @@ PanelWindow {
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
controlCenterVisible = false
root.close()
root.lockRequested()
}
}
@@ -363,7 +321,7 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.powerOptionsExpanded = !root.powerOptionsExpanded
}
}
@@ -387,7 +345,7 @@ PanelWindow {
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
controlCenterVisible = false
root.close()
settingsModal.show()
}
}
@@ -451,8 +409,9 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.powerOptionsExpanded = false
root.close()
root.powerActionRequested(
"logout", "Logout",
"Are you sure you want to logout?")
@@ -506,8 +465,9 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.powerOptionsExpanded = false
root.close()
root.powerActionRequested(
"reboot", "Restart",
"Are you sure you want to restart?")
@@ -561,8 +521,9 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.powerOptionsExpanded = false
root.close()
root.powerActionRequested(
"suspend", "Suspend",
"Are you sure you want to suspend?")
@@ -616,8 +577,9 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.powerOptionsExpanded = false
root.close()
root.powerActionRequested(
"poweroff", "Shutdown",
"Are you sure you want to shutdown?")
@@ -768,23 +730,12 @@ PanelWindow {
}
}
Behavior on height {
Behavior on implicitHeight {
NumberAnimation {
duration: Theme.shortDuration // Faster for height changes
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
MouseArea {
anchors.fill: parent
z: -1
onClicked: function (mouse) {
var localPos = mapToItem(contentLoader, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > contentLoader.width || localPos.y < 0
|| localPos.y > contentLoader.height)
controlCenterVisible = false
}
}
}
}

View File

@@ -131,9 +131,7 @@ Rectangle {
wifiContextMenuWindow.networkData.ssid)
} else if (wifiContextMenuWindow.networkData.secured) {
if (wifiPasswordModalRef) {
wifiPasswordModalRef.wifiPasswordSSID = wifiContextMenuWindow.networkData.ssid
wifiPasswordModalRef.wifiPasswordInput = ""
wifiPasswordModalRef.wifiPasswordModalVisible = true
wifiPasswordModalRef.show(wifiContextMenuWindow.networkData.ssid)
}
} else {
NetworkService.connectToWifi(

View File

@@ -303,9 +303,7 @@ Column {
NetworkService.connectToWifi(modelData.ssid)
} else if (modelData.secured) {
if (wifiPasswordModalRef) {
wifiPasswordModalRef.wifiPasswordSSID = modelData.ssid
wifiPasswordModalRef.wifiPasswordInput = ""
wifiPasswordModalRef.wifiPasswordModalVisible = true
wifiPasswordModalRef.show(modelData.ssid)
}
} else {
NetworkService.connectToWifi(modelData.ssid)

View File

@@ -11,10 +11,7 @@ PanelWindow {
id: root
property bool powerMenuVisible: false
property bool powerConfirmVisible: false
property string powerConfirmAction: ""
property string powerConfirmTitle: ""
property string powerConfirmMessage: ""
signal powerActionRequested(string action, string title, string message)
visible: powerMenuVisible
implicitWidth: 400
@@ -137,10 +134,7 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerConfirmAction = "logout"
root.powerConfirmTitle = "Log Out"
root.powerConfirmMessage = "Are you sure you want to log out?"
root.powerConfirmVisible = true
root.powerActionRequested("logout", "Log Out", "Are you sure you want to log out?")
}
}
}
@@ -187,10 +181,7 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerConfirmAction = "suspend"
root.powerConfirmTitle = "Suspend"
root.powerConfirmMessage = "Are you sure you want to suspend the system?"
root.powerConfirmVisible = true
root.powerActionRequested("suspend", "Suspend", "Are you sure you want to suspend the system?")
}
}
}
@@ -237,10 +228,7 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerConfirmAction = "reboot"
root.powerConfirmTitle = "Reboot"
root.powerConfirmMessage = "Are you sure you want to reboot the system?"
root.powerConfirmVisible = true
root.powerActionRequested("reboot", "Reboot", "Are you sure you want to reboot the system?")
}
}
}
@@ -287,10 +275,7 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerConfirmAction = "poweroff"
root.powerConfirmTitle = "Power Off"
root.powerConfirmMessage = "Are you sure you want to power off the system?"
root.powerConfirmVisible = true
root.powerActionRequested("poweroff", "Power Off", "Are you sure you want to power off the system?")
}
}
}

View File

@@ -187,8 +187,7 @@ PanelWindow {
}
Rectangle {
visible: root.appData && root.appData.windows
&& root.appData.windows.count > 0
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 0)
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
@@ -236,16 +235,14 @@ PanelWindow {
}
Rectangle {
visible: root.appData && root.appData.windows
&& root.appData.windows.count > 1
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 1)
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
}
Rectangle {
visible: root.appData && root.appData.windows
&& root.appData.windows.count > 1
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 1)
width: parent.width
height: 28
radius: Theme.cornerRadius

View File

@@ -9,14 +9,12 @@ import qs.Services
import qs.Widgets
import qs.Modules.Notifications.Center
PanelWindow {
DankPopout {
id: root
property bool notificationHistoryVisible: false
property real triggerX: Screen.width - 400 - Theme.spacingL
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
property real triggerWidth: 40
property string triggerSection: "right"
property var triggerScreen: null
NotificationKeyboardController {
id: keyboardController
@@ -25,185 +23,143 @@ PanelWindow {
onClose: function() { notificationHistoryVisible = false }
}
NotificationKeyboardHints {
id: keyboardHints
anchors.bottom: mainRect.bottom
anchors.left: mainRect.left
anchors.right: mainRect.right
anchors.margins: Theme.spacingL
showHints: keyboardController.showKeyboardHints
z: 200
}
function setTriggerPosition(x, y, width, section) {
function setTriggerPosition(x, y, width, section, screen) {
triggerX = x
triggerY = y
triggerWidth = width
triggerSection = section
triggerScreen = screen
}
visible: notificationHistoryVisible
popupWidth: 400
popupHeight: {
let baseHeight = Theme.spacingL * 2
baseHeight += 40 // notificationHeader height estimate
baseHeight += 0 // notificationSettings when collapsed
baseHeight += Theme.spacingM * 2
let listHeight = 200 // default list height
baseHeight += Math.min(listHeight, 600)
return Math.max(300, Math.min(baseHeight, Screen.height * 0.8))
}
triggerX: Screen.width - 400 - Theme.spacingL
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
triggerWidth: 40
positioning: "center"
WlrLayershell.namespace: "quickshell-notifications"
screen: triggerScreen
shouldBeVisible: notificationHistoryVisible
visible: shouldBeVisible
onNotificationHistoryVisibleChanged: {
NotificationService.disablePopups(notificationHistoryVisible)
}
implicitWidth: 400
implicitHeight: Math.min(Screen.height * 0.8, 400)
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: notificationHistoryVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
color: "transparent"
anchors {
top: true
left: true
right: true
bottom: true
}
MouseArea {
anchors.fill: parent
onClicked: {
notificationHistoryVisible = false
if (notificationHistoryVisible) {
open()
NotificationService.disablePopups(true)
} else {
close()
NotificationService.disablePopups(false)
}
}
Rectangle {
id: mainRect
readonly property real popupWidth: 400
readonly property real calculatedX: {
var centerX = root.triggerX + (root.triggerWidth / 2) - (popupWidth / 2)
if (centerX >= Theme.spacingM
&& centerX + popupWidth <= Screen.width - Theme.spacingM) {
return centerX
}
if (centerX < Theme.spacingM) {
return Theme.spacingM
}
if (centerX + popupWidth > Screen.width - Theme.spacingM) {
return Screen.width - popupWidth - Theme.spacingM
}
return centerX
}
width: popupWidth
height: {
let baseHeight = Theme.spacingL * 2
baseHeight += notificationHeader.height
// Use the final content height when expanded, not the animating height
baseHeight += (notificationSettings.expanded ? notificationSettings.contentHeight : 0)
baseHeight += Theme.spacingM * 2
let listHeight = notificationList.listContentHeight
if (NotificationService.groupedNotifications.length === 0)
listHeight = 200
baseHeight += Math.min(listHeight, 600)
return Math.max(300, Math.min(baseHeight, Screen.height * 0.8))
}
x: calculatedX
y: root.triggerY
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.08)
border.width: 1
opacity: notificationHistoryVisible ? 1 : 0
scale: notificationHistoryVisible ? 1 : 0.9
MouseArea {
anchors.fill: parent
onClicked: {
}
}
FocusScope {
id: contentColumn
anchors.fill: parent
anchors.margins: Theme.spacingL
focus: true
content: Component {
Rectangle {
id: notificationContent
implicitHeight: {
let baseHeight = Theme.spacingL * 2
baseHeight += notificationHeader.height
baseHeight += (notificationSettings.expanded ? notificationSettings.contentHeight : 0)
baseHeight += Theme.spacingM * 2
let listHeight = notificationList.listContentHeight
if (NotificationService.groupedNotifications.length === 0)
listHeight = 200
baseHeight += Math.min(listHeight, 600)
return Math.max(300, Math.min(baseHeight, root.screen ? root.screen.height * 0.8 : Screen.height * 0.8))
}
color: Theme.popupBackground()
radius: Theme.cornerRadius
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.08)
border.width: 1
focus: true
Component.onCompleted: {
if (notificationHistoryVisible)
if (root.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function(event) {
keyboardController.handleKey(event)
}
Column {
id: contentColumnInner
anchors.fill: parent
spacing: Theme.spacingM
Connections {
function onNotificationHistoryVisibleChanged() {
if (notificationHistoryVisible)
function onShouldBeVisibleChanged() {
if (root.shouldBeVisible)
Qt.callLater(function () {
contentColumn.forceActiveFocus()
notificationContent.forceActiveFocus()
})
else
contentColumn.focus = false
notificationContent.focus = false
}
target: root
}
NotificationHeader {
id: notificationHeader
keyboardController: keyboardController
}
NotificationSettings {
id: notificationSettings
expanded: notificationHeader.showSettings
}
FocusScope {
id: contentColumn
KeyboardNavigatedNotificationList {
id: notificationList
width: parent.width
height: parent.height - notificationHeader.height - notificationSettings.height - contentColumnInner.spacing * 2
anchors.fill: parent
anchors.margins: Theme.spacingL
focus: true
Component.onCompleted: {
if (keyboardController && notificationList) {
keyboardController.listView = notificationList
notificationList.keyboardController = keyboardController
Column {
id: contentColumnInner
anchors.fill: parent
spacing: Theme.spacingM
NotificationHeader {
id: notificationHeader
keyboardController: keyboardController
}
NotificationSettings {
id: notificationSettings
expanded: notificationHeader.showSettings
}
KeyboardNavigatedNotificationList {
id: notificationList
width: parent.width
height: parent.height - notificationHeader.height - notificationSettings.height - contentColumnInner.spacing * 2
Component.onCompleted: {
if (keyboardController && notificationList) {
keyboardController.listView = notificationList
notificationList.keyboardController = keyboardController
}
}
}
}
}
NotificationKeyboardHints {
id: keyboardHints
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: Theme.spacingL
showHints: keyboardController.showKeyboardHints
z: 200
}
}
Behavior on height {
NumberAnimation {
duration: Anims.durShort
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on opacity {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on scale {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
Behavior on implicitHeight {
NumberAnimation {
duration: Anims.durShort
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
}
}
}
}

View File

@@ -11,14 +11,10 @@ import qs.Modules.ProcessList
import qs.Services
import qs.Widgets
PanelWindow {
DankPopout {
id: processListPopout
property bool isVisible: false
property var parentWidget: null
property real triggerX: Screen.width - 600 - Theme.spacingL
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
property real triggerWidth: 55
property string triggerSection: "right"
property var triggerScreen: null
@@ -31,109 +27,33 @@ PanelWindow {
}
function hide() {
isVisible = false
close()
if (processContextMenu.visible)
processContextMenu.close()
}
function show() {
isVisible = true
open()
}
function toggle() {
if (isVisible)
hide()
else
show()
}
visible: isVisible
popupWidth: 600
popupHeight: 600
triggerX: Screen.width - 600 - Theme.spacingL
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
triggerWidth: 55
positioning: "center"
WlrLayershell.namespace: "quickshell-processlist"
screen: triggerScreen
implicitWidth: 600
implicitHeight: 600
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
color: "transparent"
visible: shouldBeVisible
shouldBeVisible: false
Ref {
service: DgopService
}
anchors {
top: true
left: true
right: true
bottom: true
}
MouseArea {
anchors.fill: parent
onClicked: function (mouse) {
var localPos = mapToItem(contentLoader, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > contentLoader.width || localPos.y < 0
|| localPos.y > contentLoader.height)
processListPopout.hide()
}
}
Loader {
id: contentLoader
readonly property real screenWidth: processListPopout.screen ? processListPopout.screen.width : Screen.width
readonly property real screenHeight: processListPopout.screen ? processListPopout.screen.height : Screen.height
readonly property real targetWidth: Math.min(
600, screenWidth - Theme.spacingL * 2)
readonly property real targetHeight: Math.min(
600,
screenHeight - Theme.barHeight - Theme.spacingS * 2)
readonly property real calculatedX: {
var centerX = processListPopout.triggerX + (processListPopout.triggerWidth
/ 2) - (targetWidth / 2)
if (centerX >= Theme.spacingM
&& centerX + targetWidth <= screenWidth - Theme.spacingM) {
return centerX
}
if (centerX < Theme.spacingM) {
return Theme.spacingM
}
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
return screenWidth - targetWidth - Theme.spacingM
}
return centerX
}
asynchronous: true
active: processListPopout.isVisible
width: targetWidth
height: targetHeight
y: processListPopout.triggerY
x: calculatedX
opacity: processListPopout.isVisible ? 1 : 0
scale: processListPopout.isVisible ? 1 : 0.9
Behavior on opacity {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on scale {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
sourceComponent: Rectangle {
id: dropdownContent
content: Component {
Rectangle {
id: processListContent
radius: Theme.cornerRadius
color: Theme.popupBackground()
@@ -144,22 +64,24 @@ PanelWindow {
antialiasing: true
smooth: true
focus: true
Component.onCompleted: {
if (processListPopout.isVisible)
if (processListPopout.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
processListPopout.hide()
processListPopout.close()
event.accepted = true
}
}
Connections {
function onIsVisibleChanged() {
if (processListPopout.isVisible)
function onShouldBeVisibleChanged() {
if (processListPopout.shouldBeVisible)
Qt.callLater(function () {
dropdownContent.forceActiveFocus()
processListContent.forceActiveFocus()
})
}
target: processListPopout
@@ -211,4 +133,4 @@ PanelWindow {
ProcessContextMenu {
id: processContextMenu
}
}
}

View File

@@ -12,6 +12,7 @@ Item {
property alias profileBrowser: profileBrowser
property alias wallpaperBrowser: wallpaperBrowser
property var parentModal: null
Component.onCompleted: {
// Access WallpaperCyclingService to ensure it's initialized
@@ -238,7 +239,11 @@ Item {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
profileBrowser.visible = true;
if (parentModal) {
parentModal.allowFocusOverride = true;
parentModal.shouldHaveFocus = false;
}
profileBrowser.open();
}
}
@@ -437,7 +442,11 @@ Item {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
wallpaperBrowser.visible = true;
if (parentModal) {
parentModal.allowFocusOverride = true;
parentModal.shouldHaveFocus = false;
}
wallpaperBrowser.open();
}
}
@@ -915,7 +924,13 @@ Item {
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
onFileSelected: (path) => {
PortalService.setProfileImage(path);
visible = false;
close();
}
onDialogClosed: {
if (parentModal) {
parentModal.allowFocusOverride = false;
parentModal.shouldHaveFocus = Qt.binding(() => parentModal.shouldBeVisible);
}
}
}
@@ -928,7 +943,13 @@ Item {
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
onFileSelected: (path) => {
SessionData.setWallpaper(path);
visible = false;
close();
}
onDialogClosed: {
if (parentModal) {
parentModal.allowFocusOverride = false;
parentModal.shouldHaveFocus = Qt.binding(() => parentModal.shouldBeVisible);
}
}
}

View File

@@ -125,7 +125,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -8,13 +8,9 @@ import qs.Common
import qs.Services
import qs.Widgets
PanelWindow {
DankPopout {
id: root
property bool batteryPopupVisible: false
property real triggerX: Screen.width - 380 - Theme.spacingL
property real triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingS
property real triggerWidth: 70
property string triggerSection: "right"
property var triggerScreen: null
@@ -43,84 +39,22 @@ PanelWindow {
ToastService.showError("Failed to set power profile")
}
visible: batteryPopupVisible
popupWidth: 400
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
triggerX: Screen.width - 380 - Theme.spacingL
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingS
triggerWidth: 70
positioning: "center"
WlrLayershell.namespace: "quickshell-battery"
screen: triggerScreen
implicitWidth: 400
implicitHeight: 300
WlrLayershell.layer: WlrLayershell.Overlay
WlrLayershell.exclusiveZone: -1
WlrLayershell.keyboardFocus: batteryPopupVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
color: "transparent"
shouldBeVisible: false
visible: shouldBeVisible
anchors {
top: true
left: true
right: true
bottom: true
}
MouseArea {
anchors.fill: parent
onClicked: function (mouse) {
var localPos = mapToItem(contentLoader, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > contentLoader.width || localPos.y < 0
|| localPos.y > contentLoader.height)
batteryPopupVisible = false
}
}
Loader {
id: contentLoader
readonly property real screenWidth: root.screen ? root.screen.width : Screen.width
readonly property real screenHeight: root.screen ? root.screen.height : Screen.height
readonly property real targetWidth: Math.min(
380, screenWidth - Theme.spacingL * 2)
readonly property real calculatedX: {
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2)
if (centerX >= Theme.spacingM
&& centerX + targetWidth <= screenWidth - Theme.spacingM) {
return centerX
}
if (centerX < Theme.spacingM) {
return Theme.spacingM
}
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
return screenWidth - targetWidth - Theme.spacingM
}
return centerX
}
asynchronous: true
active: batteryPopupVisible
width: targetWidth
height: item ? item.implicitHeight : 0
x: calculatedX
y: root.triggerY
opacity: batteryPopupVisible ? 1 : 0
scale: batteryPopupVisible ? 1 : 0.9
Behavior on opacity {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
Behavior on scale {
NumberAnimation {
duration: Anims.durMed
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasized
}
}
sourceComponent: Rectangle {
content: Component {
Rectangle {
id: batteryContent
implicitHeight: contentColumn.height + Theme.spacingL * 2
color: Theme.popupBackground()
radius: Theme.cornerRadius
@@ -129,22 +63,24 @@ PanelWindow {
antialiasing: true
smooth: true
focus: true
Component.onCompleted: {
if (batteryPopupVisible)
if (root.shouldBeVisible)
forceActiveFocus()
}
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
batteryPopupVisible = false
root.close()
event.accepted = true
}
}
Connections {
function onBatteryPopupVisibleChanged() {
if (batteryPopupVisible)
function onShouldBeVisibleChanged() {
if (root.shouldBeVisible)
Qt.callLater(function () {
parent.forceActiveFocus()
batteryContent.forceActiveFocus()
})
}
target: root
@@ -220,8 +156,8 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
batteryPopupVisible = false
onPressed: {
root.close()
}
}
}
@@ -542,7 +478,7 @@ PanelWindow {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
root.setProfile(modelData)
}
}
@@ -599,4 +535,4 @@ PanelWindow {
}
}
}
}
}

View File

@@ -69,7 +69,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0);
var currentScreen = parentScreen || Screen;

View File

@@ -132,7 +132,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -35,7 +35,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -35,7 +35,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -74,7 +74,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -21,11 +21,9 @@ Item {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
z: 1000
preventStealing: true
propagateComposedEvents: false
acceptedButtons: Qt.LeftButton
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen
@@ -39,15 +37,12 @@ Item {
}
}
Rectangle {
anchors.fill: parent
radius: Theme.cornerRadius
color: {
const baseColor = launcherArea.containsMouse
|| isActive ? Theme.surfaceTextPressed : Theme.surfaceTextHover
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
color: Qt.rgba(Theme.surfaceTextHover.r, Theme.surfaceTextHover.g, Theme.surfaceTextHover.b,
Theme.surfaceTextHover.a * Theme.widgetTransparency)
SystemLogo {
visible: SettingsData.useOSLogo
@@ -67,11 +62,5 @@ Item {
color: Theme.surfaceText
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}

View File

@@ -187,7 +187,7 @@ Rectangle {
enabled: root.playerAvailable && root.opacity > 0 && root.width > 0 && textContainer.visible
hoverEnabled: enabled
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
onPressed: {
if (root.popupTarget && root.popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = root.parentScreen || Screen

View File

@@ -49,7 +49,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -35,7 +35,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen

View File

@@ -617,7 +617,7 @@ PanelWindow {
id: launcherButtonComponent
LauncherButton {
isActive: appDrawerLoader.item ? appDrawerLoader.item.isVisible : false
isActive: false
section: {
if (parent && parent.parent) {
if (parent.parent === leftSection)
@@ -921,7 +921,7 @@ PanelWindow {
id: batteryComponent
Battery {
batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.batteryPopupVisible : false
batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.shouldBeVisible : false
section: {
if (parent && parent.parent === leftSection)
return "left"
@@ -939,7 +939,7 @@ PanelWindow {
onToggleBatteryPopup: {
batteryPopoutLoader.active = true
if (batteryPopoutLoader.item) {
batteryPopoutLoader.item.batteryPopupVisible = !batteryPopoutLoader.item.batteryPopupVisible
batteryPopoutLoader.item.toggle()
}
}
}
@@ -949,7 +949,7 @@ PanelWindow {
id: controlCenterButtonComponent
ControlCenterButton {
isActive: controlCenterLoader.item ? controlCenterLoader.item.controlCenterVisible : false
isActive: controlCenterLoader.item ? controlCenterLoader.item.shouldBeVisible : false
section: {
if (parent && parent.parent === leftSection)
return "left"
@@ -968,8 +968,8 @@ PanelWindow {
controlCenterLoader.active = true
if (controlCenterLoader.item) {
controlCenterLoader.item.triggerScreen = root.screen
controlCenterLoader.item.controlCenterVisible = !controlCenterLoader.item.controlCenterVisible
if (controlCenterLoader.item.controlCenterVisible) {
controlCenterLoader.item.toggle()
if (controlCenterLoader.item.shouldBeVisible) {
if (NetworkService.wifiEnabled)
NetworkService.scanWifi()
}

View File

@@ -60,7 +60,7 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen