Removed all creeping: readonly property real scaling: Scaling.scale(screen)
This commit is contained in:
parent
f67c48032f
commit
33bec01e98
31 changed files with 294 additions and 333 deletions
|
|
@ -15,6 +15,8 @@ NLoader {
|
|||
id: root
|
||||
|
||||
required property ShellScreen modelData
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
screen: modelData
|
||||
|
||||
// Visible ring color
|
||||
property color ringColor: Colors.mSurface
|
||||
|
|
@ -25,7 +27,7 @@ NLoader {
|
|||
property int innerRadius: 20
|
||||
|
||||
color: "transparent"
|
||||
screen: modelData
|
||||
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.namespace: "quickshell-corner"
|
||||
// Do not take keyboard focus and make the surface click-through
|
||||
|
|
@ -39,7 +41,7 @@ NLoader {
|
|||
}
|
||||
|
||||
margins {
|
||||
top: Math.round(Style.barHeight * Scaling.scale(screen))
|
||||
top: Math.floor(Style.barHeight * scaling)
|
||||
}
|
||||
|
||||
// Source we want to show only as a ring
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ Variants {
|
|||
|
||||
required property ShellScreen modelData
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
screen: modelData
|
||||
|
||||
implicitHeight: Style.barHeight * scaling
|
||||
color: "transparent"
|
||||
|
||||
// If no bar display activated in settings, then show them all
|
||||
// If no bar activated in settings, then show them all
|
||||
visible: modelData ? (Settings.data.bar.monitors.includes(modelData.name)
|
||||
|| (Settings.data.bar.monitors.length === 0)) : false
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import qs.Widgets
|
|||
NIconButton {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
sizeMultiplier: 0.8
|
||||
showBorder: false
|
||||
icon: "notifications"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import qs.Services
|
|||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
readonly property real itemSize: 24 * scaling
|
||||
|
||||
width: tray.width
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import qs.Widgets
|
|||
PopupWindow {
|
||||
id: trayMenu
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property QsMenuHandle menu
|
||||
property var anchorItem: null
|
||||
property real anchorX
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import qs.Widgets
|
|||
NIconButton {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
readonly property bool wifiEnabled: Settings.data.network.wifiEnabled
|
||||
sizeMultiplier: 0.8
|
||||
showBorder: false
|
||||
|
|
|
|||
|
|
@ -12,16 +12,13 @@ Item {
|
|||
property bool isDestroying: false
|
||||
property bool hovered: false
|
||||
|
||||
// Unified scale
|
||||
readonly property real s: Scaling.scale(screen)
|
||||
|
||||
property ListModel localWorkspaces: ListModel {}
|
||||
property real masterProgress: 0.0
|
||||
property bool effectsActive: false
|
||||
property color effectColor: Colors.mPrimary
|
||||
|
||||
property int horizontalPadding: Math.round(16 * s)
|
||||
property int spacingBetweenPills: Math.round(8 * s)
|
||||
property int horizontalPadding: Math.round(16 * scaling)
|
||||
property int spacingBetweenPills: Math.round(8 * scaling)
|
||||
|
||||
signal workspaceChanged(int workspaceId, color accentColor)
|
||||
|
||||
|
|
@ -30,18 +27,18 @@ Item {
|
|||
for (var i = 0; i < localWorkspaces.count; i++) {
|
||||
const ws = localWorkspaces.get(i)
|
||||
if (ws.isFocused)
|
||||
total += Math.round(44 * s)
|
||||
total += Math.round(44 * scaling)
|
||||
else if (ws.isActive)
|
||||
total += Math.round(28 * s)
|
||||
total += Math.round(28 * scaling)
|
||||
else
|
||||
total += Math.round(16 * s)
|
||||
total += Math.round(16 * scaling)
|
||||
}
|
||||
total += Math.max(localWorkspaces.count - 1, 0) * spacingBetweenPills
|
||||
total += horizontalPadding * 2
|
||||
return total
|
||||
}
|
||||
|
||||
height: Math.round(36 * s)
|
||||
height: Math.round(36 * scaling)
|
||||
|
||||
Component.onCompleted: {
|
||||
localWorkspaces.clear()
|
||||
|
|
@ -116,14 +113,14 @@ Item {
|
|||
|
||||
Rectangle {
|
||||
id: workspaceBackground
|
||||
width: parent.width - Math.round(15 * s)
|
||||
height: Math.round(26 * s)
|
||||
width: parent.width - Math.round(15 * scaling)
|
||||
height: Math.round(26 * scaling)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
radius: Math.round(12 * s)
|
||||
radius: Math.round(12 * scaling)
|
||||
color: Colors.mSurfaceVariant
|
||||
border.color: Colors.mOutlineVariant
|
||||
border.width: Math.max(1, Math.round(1 * s))
|
||||
border.width: Math.max(1, Math.round(1 * scaling))
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
shadowColor: Colors.mShadow
|
||||
|
|
@ -144,14 +141,14 @@ Item {
|
|||
model: localWorkspaces
|
||||
Item {
|
||||
id: workspacePillContainer
|
||||
height: Math.round(12 * s)
|
||||
height: Math.round(12 * scaling)
|
||||
width: {
|
||||
if (model.isFocused)
|
||||
return Math.round(44 * s)
|
||||
return Math.round(44 * scaling)
|
||||
else if (model.isActive)
|
||||
return Math.round(28 * s)
|
||||
return Math.round(28 * scaling)
|
||||
else
|
||||
return Math.round(16 * s)
|
||||
return Math.round(16 * scaling)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -159,10 +156,10 @@ Item {
|
|||
anchors.fill: parent
|
||||
radius: {
|
||||
if (model.isFocused)
|
||||
return Math.round(12 * s)
|
||||
return Math.round(12 * scaling)
|
||||
else
|
||||
// half of focused height (if you want to animate this too)
|
||||
return Math.round(6 * s)
|
||||
return Math.round(6 * scaling)
|
||||
}
|
||||
color: {
|
||||
if (model.isFocused)
|
||||
|
|
@ -248,7 +245,7 @@ Item {
|
|||
radius: width / 2
|
||||
color: "transparent"
|
||||
border.color: root.effectColor
|
||||
border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * s))
|
||||
border.width: Math.max(1, Math.round((2 + 6 * (1.0 - root.masterProgress)) * scaling))
|
||||
opacity: root.effectsActive && model.isFocused ? (1.0 - root.masterProgress) * 0.7 : 0
|
||||
visible: root.effectsActive && model.isFocused
|
||||
z: 1
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ NLoader {
|
|||
NPanel {
|
||||
id: calendarPanel
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
// Override hide function to animate first
|
||||
function hide() {
|
||||
// Start hide animation
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ NLoader {
|
|||
NPanel {
|
||||
id: demoPanel
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
// Override hide function to animate first
|
||||
function hide() {
|
||||
// Start hide animation
|
||||
|
|
@ -73,7 +71,7 @@ NLoader {
|
|||
border.color: Colors.mOutlineVariant
|
||||
border.width: Math.max(1, Style.borderThin * scaling)
|
||||
width: 500 * scaling
|
||||
height: 700 * scaling
|
||||
height: 900 * scaling
|
||||
anchors.centerIn: parent
|
||||
|
||||
// Animation properties
|
||||
|
|
@ -312,7 +310,7 @@ NLoader {
|
|||
}
|
||||
|
||||
NText {
|
||||
text: `Brightness: ${Math.round(Brightness.brightness)}%`
|
||||
text: `Brightness: ${Math.round(BrightnessService.brightness)}%`
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
|
|
@ -322,30 +320,30 @@ NLoader {
|
|||
icon: "brightness_low"
|
||||
fontPointSize: Style.fontSizeLarge * scaling
|
||||
onClicked: {
|
||||
Brightness.decreaseBrightness()
|
||||
BrightnessService.decreaseBrightness()
|
||||
}
|
||||
}
|
||||
NSlider {
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
value: Brightness.brightness
|
||||
value: BrightnessService.brightness
|
||||
implicitWidth: bgRect.width * 0.5
|
||||
onMoved: {
|
||||
Brightness.setBrightnessDebounced(value)
|
||||
BrightnessService.setBrightnessDebounced(value)
|
||||
}
|
||||
}
|
||||
NIconButton {
|
||||
icon: "brightness_high"
|
||||
fontPointSize: Style.fontSizeLarge * scaling
|
||||
onClicked: {
|
||||
Brightness.increaseBrightness()
|
||||
BrightnessService.increaseBrightness()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NText {
|
||||
text: `Method: ${Brightness.currentMethod} | Available: ${Brightness.available}`
|
||||
text: `Method: ${BrightnessService.currentMethod} | Available: ${BrightnessService.available}`
|
||||
color: Colors.mOnSurfaceVariant
|
||||
font.pointSize: Style.fontSizeSmall * scaling
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
|
|
|||
|
|
@ -14,9 +14,12 @@ NLoader {
|
|||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
Item {
|
||||
property var modelData
|
||||
readonly property real scaling: Scaling.scale(modelData)
|
||||
PanelWindow {
|
||||
id: dockWindow
|
||||
|
||||
required property ShellScreen modelData
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
screen: modelData
|
||||
|
||||
// Auto-hide properties
|
||||
property bool autoHide: Settings.data.dock.autoHide
|
||||
|
|
@ -37,320 +40,314 @@ NLoader {
|
|||
property var contextMenuTarget: null
|
||||
property var contextMenuToplevel: null
|
||||
|
||||
PanelWindow {
|
||||
id: dockWindow
|
||||
// Dock is only shown if explicitely toggled
|
||||
visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false
|
||||
|
||||
// Dock is only shown if explicitely toggled
|
||||
visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
focusable: false
|
||||
color: "transparent"
|
||||
implicitHeight: 60
|
||||
|
||||
screen: modelData
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
focusable: false
|
||||
color: "transparent"
|
||||
implicitHeight: 60
|
||||
// Timer for auto-hide delay
|
||||
Timer {
|
||||
id: hideTimer
|
||||
interval: hideDelay
|
||||
onTriggered: if (autoHide && !dockHovered && !anyAppHovered)
|
||||
hidden = true
|
||||
}
|
||||
|
||||
// Timer for auto-hide delay
|
||||
Timer {
|
||||
id: hideTimer
|
||||
interval: hideDelay
|
||||
onTriggered: if (autoHide && !dockHovered && !anyAppHovered)
|
||||
hidden = true
|
||||
// Timer for show delay
|
||||
Timer {
|
||||
id: showTimer
|
||||
interval: showDelay
|
||||
onTriggered: hidden = false
|
||||
}
|
||||
|
||||
// Behavior for smooth hide/show animations
|
||||
Behavior on margins.bottom {
|
||||
NumberAnimation {
|
||||
duration: hidden ? hideAnimationDuration : showAnimationDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
// Timer for show delay
|
||||
Timer {
|
||||
id: showTimer
|
||||
interval: showDelay
|
||||
onTriggered: hidden = false
|
||||
// Mouse area at screen bottom to detect entry and keep dock visible
|
||||
MouseArea {
|
||||
id: screenEdgeMouseArea
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 10
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
|
||||
onEntered: if (autoHide && hidden)
|
||||
showTimer.start()
|
||||
onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered)
|
||||
hideTimer.start()
|
||||
}
|
||||
|
||||
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: contextMenuVisible
|
||||
onClicked: {
|
||||
contextMenuVisible = false
|
||||
contextMenuTarget = null
|
||||
contextMenuToplevel = null
|
||||
}
|
||||
}
|
||||
|
||||
// Behavior for smooth hide/show animations
|
||||
Behavior on margins.bottom {
|
||||
NumberAnimation {
|
||||
duration: hidden ? hideAnimationDuration : showAnimationDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: dockContainer
|
||||
width: dock.width + 40
|
||||
height: 50
|
||||
color: Colors.mSurface
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
topLeftRadius: 20
|
||||
topRightRadius: 20
|
||||
|
||||
// Mouse area at screen bottom to detect entry and keep dock visible
|
||||
MouseArea {
|
||||
id: screenEdgeMouseArea
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 10
|
||||
id: dockMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
|
||||
onEntered: if (autoHide && hidden)
|
||||
showTimer.start()
|
||||
onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered)
|
||||
hideTimer.start()
|
||||
}
|
||||
|
||||
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: contextMenuVisible
|
||||
onClicked: {
|
||||
contextMenuVisible = false
|
||||
contextMenuTarget = null
|
||||
contextMenuToplevel = null
|
||||
onEntered: {
|
||||
dockHovered = true
|
||||
if (autoHide) {
|
||||
showTimer.stop()
|
||||
hideTimer.stop()
|
||||
hidden = false
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
dockHovered = false
|
||||
if (autoHide && !anyAppHovered && !contextMenuVisible)
|
||||
hideTimer.start()
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: dockContainer
|
||||
width: dock.width + 40
|
||||
height: 50
|
||||
color: Colors.mSurface
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
topLeftRadius: 20
|
||||
topRightRadius: 20
|
||||
Item {
|
||||
id: dock
|
||||
width: runningAppsRow.width
|
||||
height: parent.height - 10
|
||||
anchors.centerIn: parent
|
||||
|
||||
MouseArea {
|
||||
id: dockMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
|
||||
onEntered: {
|
||||
dockHovered = true
|
||||
if (autoHide) {
|
||||
showTimer.stop()
|
||||
hideTimer.stop()
|
||||
hidden = false
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
dockHovered = false
|
||||
if (autoHide && !anyAppHovered && !contextMenuVisible)
|
||||
hideTimer.start()
|
||||
}
|
||||
NTooltip {
|
||||
id: appTooltip
|
||||
visible: false
|
||||
positionAbove: true
|
||||
}
|
||||
|
||||
Item {
|
||||
id: dock
|
||||
width: runningAppsRow.width
|
||||
height: parent.height - 10
|
||||
function getAppIcon(toplevel: Toplevel): string {
|
||||
if (!toplevel)
|
||||
return ""
|
||||
let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.appId, true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.title, true)
|
||||
return icon || Quickshell.iconPath("application-x-executable", true)
|
||||
}
|
||||
|
||||
Row {
|
||||
id: runningAppsRow
|
||||
spacing: 8
|
||||
height: parent.height
|
||||
anchors.centerIn: parent
|
||||
|
||||
NTooltip {
|
||||
id: appTooltip
|
||||
visible: false
|
||||
positionAbove: true
|
||||
}
|
||||
Repeater {
|
||||
model: ToplevelManager ? ToplevelManager.toplevels : null
|
||||
|
||||
function getAppIcon(toplevel: Toplevel): string {
|
||||
if (!toplevel)
|
||||
return ""
|
||||
let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.appId, true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true)
|
||||
if (!icon)
|
||||
icon = Quickshell.iconPath(toplevel.title, true)
|
||||
return icon || Quickshell.iconPath("application-x-executable", true)
|
||||
}
|
||||
delegate: Rectangle {
|
||||
id: appButton
|
||||
width: 36
|
||||
height: 36
|
||||
radius: 18
|
||||
color: "transparent"
|
||||
|
||||
Row {
|
||||
id: runningAppsRow
|
||||
spacing: 8
|
||||
height: parent.height
|
||||
anchors.centerIn: parent
|
||||
property bool isActive: ToplevelManager.activeToplevel && ToplevelManager.activeToplevel === modelData
|
||||
property bool hovered: appMouseArea.containsMouse
|
||||
property string appId: modelData ? modelData.appId : ""
|
||||
property string appTitle: modelData ? modelData.title : ""
|
||||
|
||||
Repeater {
|
||||
model: ToplevelManager ? ToplevelManager.toplevels : null
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: appButton
|
||||
width: 36
|
||||
height: 36
|
||||
radius: 18
|
||||
color: "transparent"
|
||||
Image {
|
||||
id: appIcon
|
||||
width: 28
|
||||
height: 28
|
||||
anchors.centerIn: parent
|
||||
source: dock.getAppIcon(modelData)
|
||||
visible: source.toString() !== ""
|
||||
smooth: false
|
||||
mipmap: false
|
||||
antialiasing: false
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
property bool isActive: ToplevelManager.activeToplevel
|
||||
&& ToplevelManager.activeToplevel === modelData
|
||||
property bool hovered: appMouseArea.containsMouse
|
||||
property string appId: modelData ? modelData.appId : ""
|
||||
property string appTitle: modelData ? modelData.title : ""
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !appIcon.visible
|
||||
text: appButton.appId ? appButton.appId.charAt(0).toUpperCase() : "?"
|
||||
font.pixelSize: 14
|
||||
font.bold: true
|
||||
color: appButton.isActive ? Colors.mPrimary : Colors.mOnSurface
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 150
|
||||
MouseArea {
|
||||
id: appMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
|
||||
onEntered: {
|
||||
anyAppHovered = true
|
||||
const appName = appButton.appTitle || appButton.appId || "Unknown"
|
||||
appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName
|
||||
appTooltip.target = appButton
|
||||
appTooltip.isVisible = true
|
||||
if (autoHide) {
|
||||
showTimer.stop()
|
||||
hideTimer.stop()
|
||||
hidden = false
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: appIcon
|
||||
width: 28
|
||||
height: 28
|
||||
anchors.centerIn: parent
|
||||
source: dock.getAppIcon(modelData)
|
||||
visible: source.toString() !== ""
|
||||
smooth: false
|
||||
mipmap: false
|
||||
antialiasing: false
|
||||
fillMode: Image.PreserveAspectFit
|
||||
onExited: {
|
||||
anyAppHovered = false
|
||||
appTooltip.hide()
|
||||
if (autoHide && !dockHovered && !contextMenuVisible)
|
||||
hideTimer.start()
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !appIcon.visible
|
||||
text: appButton.appId ? appButton.appId.charAt(0).toUpperCase() : "?"
|
||||
font.pixelSize: 14
|
||||
font.bold: true
|
||||
color: appButton.isActive ? Colors.mPrimary : Colors.mOnSurface
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: appMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
|
||||
onEntered: {
|
||||
anyAppHovered = true
|
||||
const appName = appButton.appTitle || appButton.appId || "Unknown"
|
||||
appTooltip.text = appName.length > 40 ? appName.substring(0, 37) + "..." : appName
|
||||
appTooltip.target = appButton
|
||||
appTooltip.isVisible = true
|
||||
if (autoHide) {
|
||||
showTimer.stop()
|
||||
hideTimer.stop()
|
||||
hidden = false
|
||||
}
|
||||
onClicked: function (mouse) {
|
||||
if (mouse.button === Qt.MiddleButton && modelData?.close) {
|
||||
modelData.close()
|
||||
}
|
||||
|
||||
onExited: {
|
||||
anyAppHovered = false
|
||||
if (mouse.button === Qt.LeftButton && modelData?.activate) {
|
||||
modelData.activate()
|
||||
}
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
appTooltip.hide()
|
||||
if (autoHide && !dockHovered && !contextMenuVisible)
|
||||
hideTimer.start()
|
||||
}
|
||||
|
||||
onClicked: function (mouse) {
|
||||
if (mouse.button === Qt.MiddleButton && modelData?.close) {
|
||||
modelData.close()
|
||||
}
|
||||
if (mouse.button === Qt.LeftButton && modelData?.activate) {
|
||||
modelData.activate()
|
||||
}
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
appTooltip.hide()
|
||||
contextMenuTarget = appButton
|
||||
contextMenuToplevel = modelData
|
||||
contextMenuVisible = true
|
||||
}
|
||||
contextMenuTarget = appButton
|
||||
contextMenuToplevel = modelData
|
||||
contextMenuVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: isActive
|
||||
width: 20
|
||||
height: 3
|
||||
color: Colors.mPrimary
|
||||
radius: 1.5
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottomMargin: 2
|
||||
}
|
||||
Rectangle {
|
||||
visible: isActive
|
||||
width: 20
|
||||
height: 3
|
||||
color: Colors.mPrimary
|
||||
radius: 1.5
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottomMargin: 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Context Menu
|
||||
PanelWindow {
|
||||
id: contextMenuWindow
|
||||
visible: contextMenuVisible
|
||||
screen: dockWindow.screen
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
color: "transparent"
|
||||
focusable: false
|
||||
// Context Menu
|
||||
PanelWindow {
|
||||
id: contextMenuWindow
|
||||
visible: contextMenuVisible
|
||||
screen: dockWindow.screen
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
color: "transparent"
|
||||
focusable: false
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
contextMenuVisible = false
|
||||
contextMenuTarget = null
|
||||
contextMenuToplevel = null
|
||||
hidden = true // Hide dock when context menu closes
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contextMenuContainer
|
||||
width: 80
|
||||
height: 32
|
||||
radius: 8
|
||||
color: closeMouseArea.containsMouse ? Colors.mTertiary : Colors.mSurface
|
||||
border.color: Colors.mOutline
|
||||
border.width: 1
|
||||
|
||||
x: {
|
||||
if (!contextMenuTarget)
|
||||
return 0
|
||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||
let xPos = pos.x + (contextMenuTarget.width - width) / 2
|
||||
return Math.max(0, Math.min(xPos, dockWindow.width - width))
|
||||
}
|
||||
|
||||
y: {
|
||||
if (!contextMenuTarget)
|
||||
return 0
|
||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||
return pos.y - height + 32
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "Close"
|
||||
font.pixelSize: 14
|
||||
color: Colors.mOnSurface
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: closeMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
if (contextMenuToplevel?.close)
|
||||
contextMenuToplevel.close()
|
||||
contextMenuVisible = false
|
||||
contextMenuTarget = null
|
||||
contextMenuToplevel = null
|
||||
hidden = true // Hide dock when context menu closes
|
||||
hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contextMenuContainer
|
||||
width: 80
|
||||
height: 32
|
||||
radius: 8
|
||||
color: closeMouseArea.containsMouse ? Colors.mTertiary : Colors.mSurface
|
||||
border.color: Colors.mOutline
|
||||
border.width: 1
|
||||
// Animation
|
||||
scale: contextMenuVisible ? 1 : 0.9
|
||||
opacity: contextMenuVisible ? 1 : 0
|
||||
transformOrigin: Item.Bottom
|
||||
|
||||
x: {
|
||||
if (!contextMenuTarget)
|
||||
return 0
|
||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||
let xPos = pos.x + (contextMenuTarget.width - width) / 2
|
||||
return Math.max(0, Math.min(xPos, dockWindow.width - width))
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: 150
|
||||
easing.type: Easing.OutBack
|
||||
}
|
||||
}
|
||||
|
||||
y: {
|
||||
if (!contextMenuTarget)
|
||||
return 0
|
||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||
return pos.y - height + 32
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "Close"
|
||||
font.pixelSize: 14
|
||||
color: Colors.mOnSurface
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: closeMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
if (contextMenuToplevel?.close)
|
||||
contextMenuToplevel.close()
|
||||
contextMenuVisible = false
|
||||
hidden = true
|
||||
}
|
||||
}
|
||||
|
||||
// Animation
|
||||
scale: contextMenuVisible ? 1 : 0.9
|
||||
opacity: contextMenuVisible ? 1 : 0
|
||||
transformOrigin: Item.Bottom
|
||||
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: 150
|
||||
easing.type: Easing.OutBack
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 100
|
||||
}
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Variants {
|
|||
|
||||
required property ShellScreen modelData
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
screen: modelData
|
||||
|
||||
// Access the notification model from the service
|
||||
property ListModel notificationModel: NotificationService.notificationModel
|
||||
|
|
@ -23,7 +24,6 @@ Variants {
|
|||
// Track notifications being removed for animation
|
||||
property var removingNotifications: ({})
|
||||
|
||||
screen: modelData
|
||||
color: "transparent"
|
||||
|
||||
// If no notification display activated in settings, then show them all
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ NLoader {
|
|||
NPanel {
|
||||
id: panel
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property int currentTabIndex: 0
|
||||
|
||||
// Override hide function to animate first
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import qs.Widgets
|
|||
NBox {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property string uptimeText: "--"
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import qs.Widgets
|
|||
NBox {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
Layout.preferredWidth: 84 * scaling
|
||||
implicitHeight: content.implicitHeight + Style.marginTiny * 2 * scaling
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import qs.Widgets
|
|||
NBox {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
readonly property bool weatherReady: (Location.data.weather !== null)
|
||||
|
||||
// TBC weatherReady is not turning to false when we reset weather...
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ NLoader {
|
|||
NPanel {
|
||||
id: sidePanel
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
// Single source of truth for spacing between cards (both axes)
|
||||
property real cardSpacing: Style.marginLarge * scaling
|
||||
// X coordinate from the bar to align this panel under
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import qs.Services
|
|||
Rectangle {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
implicitWidth: childrenRect.width
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import qs.Services
|
|||
Item {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
property bool running: true
|
||||
property color color: Colors.mPrimary
|
||||
property int size: Style.baseWidgetSize * scaling
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import qs.Services
|
|||
Rectangle {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
implicitWidth: childrenRect.width
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import qs.Services
|
|||
Rectangle {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property real value: 0 // 0..100 (or any range visually mapped)
|
||||
property string icon: ""
|
||||
property string suffix: "%"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import qs.Widgets
|
|||
Rectangle {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
signal entered
|
||||
signal exited
|
||||
signal clicked
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import qs.Widgets
|
|||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
readonly property real preferredHeight: Style.baseWidgetSize * 1.25 * scaling
|
||||
|
||||
property string label: ""
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import qs.Services
|
|||
Rectangle {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
// Multiplier to control how large the button container is relative to Style.baseWidgetSize
|
||||
property real sizeMultiplier: 1.0
|
||||
property real size: Style.baseWidgetSize * sizeMultiplier * scaling
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ Rectangle {
|
|||
property real imageRadius: width * 0.5
|
||||
radius: imageRadius
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property string imagePath: ""
|
||||
property string fallbackIcon: ""
|
||||
property color borderColor: "transparent"
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ PanelWindow {
|
|||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
property bool showOverlay: Settings.data.general.dimDesktop
|
||||
property int topMargin: Style.barHeight * scaling
|
||||
property color overlayColor: showOverlay ? Colors.applyOpacity(Colors.mShadow, "AA") : "transparent"
|
||||
|
||||
signal dismissed
|
||||
|
||||
function hide() {
|
||||
|
|
@ -37,7 +37,7 @@ PanelWindow {
|
|||
color: visible ? overlayColor : "transparent"
|
||||
visible: false
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
screen: (typeof modelData !== 'undefined' ? modelData : null)
|
||||
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import qs.Services
|
|||
Item {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
property string icon: ""
|
||||
property string text: ""
|
||||
property string tooltipText: ""
|
||||
|
|
|
|||
|
|
@ -6,14 +6,12 @@ import qs.Services
|
|||
Slider {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
readonly property real knobDiameter: Style.baseWidgetSize * 0.75 * scaling
|
||||
readonly property real trackHeight: knobDiameter * 0.5
|
||||
readonly property real cutoutExtra: Style.baseWidgetSize * 0.1 * scaling
|
||||
|
||||
// Optional color to cut the track beneath the knob (should match surrounding background)
|
||||
property var cutoutColor
|
||||
property var screen
|
||||
property bool snapAlways: true
|
||||
|
||||
snapMode: snapAlways ? Slider.SnapAlways : Slider.SnapOnRelease
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import qs.Widgets
|
|||
Text {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
|
||||
font.family: Settings.data.ui.fontFamily
|
||||
font.pointSize: Style.fontSizeMedium * scaling
|
||||
font.weight: Style.fontWeightRegular
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import qs.Services
|
|||
Item {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property string label: ""
|
||||
property string description: ""
|
||||
property bool readOnly: false
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import qs.Services
|
|||
RowLayout {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property string label: ""
|
||||
property string description: ""
|
||||
property bool value: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import qs.Services
|
|||
Window {
|
||||
id: root
|
||||
|
||||
readonly property real scaling: Scaling.scale(screen)
|
||||
property bool isVisible: false
|
||||
property string text: "Placeholder"
|
||||
property Item target: null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue