Removed all creeping: readonly property real scaling: Scaling.scale(screen)

This commit is contained in:
quadbyte 2025-08-15 11:24:05 -04:00
parent f67c48032f
commit 33bec01e98
31 changed files with 294 additions and 333 deletions

View file

@ -15,6 +15,8 @@ NLoader {
id: root id: root
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen)
screen: modelData
// Visible ring color // Visible ring color
property color ringColor: Colors.mSurface property color ringColor: Colors.mSurface
@ -25,7 +27,7 @@ NLoader {
property int innerRadius: 20 property int innerRadius: 20
color: "transparent" color: "transparent"
screen: modelData
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "quickshell-corner" WlrLayershell.namespace: "quickshell-corner"
// Do not take keyboard focus and make the surface click-through // Do not take keyboard focus and make the surface click-through
@ -39,7 +41,7 @@ NLoader {
} }
margins { margins {
top: Math.round(Style.barHeight * Scaling.scale(screen)) top: Math.floor(Style.barHeight * scaling)
} }
// Source we want to show only as a ring // Source we want to show only as a ring

View file

@ -14,12 +14,12 @@ Variants {
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
screen: modelData screen: modelData
implicitHeight: Style.barHeight * scaling implicitHeight: Style.barHeight * scaling
color: "transparent" 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) visible: modelData ? (Settings.data.bar.monitors.includes(modelData.name)
|| (Settings.data.bar.monitors.length === 0)) : false || (Settings.data.bar.monitors.length === 0)) : false

View file

@ -9,7 +9,6 @@ import qs.Widgets
NIconButton { NIconButton {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
sizeMultiplier: 0.8 sizeMultiplier: 0.8
showBorder: false showBorder: false
icon: "notifications" icon: "notifications"

View file

@ -9,7 +9,6 @@ import qs.Services
import qs.Widgets import qs.Widgets
Item { Item {
readonly property real scaling: Scaling.scale(screen)
readonly property real itemSize: 24 * scaling readonly property real itemSize: 24 * scaling
width: tray.width width: tray.width

View file

@ -8,7 +8,6 @@ import qs.Widgets
PopupWindow { PopupWindow {
id: trayMenu id: trayMenu
readonly property real scaling: Scaling.scale(screen)
property QsMenuHandle menu property QsMenuHandle menu
property var anchorItem: null property var anchorItem: null
property real anchorX property real anchorX

View file

@ -9,7 +9,6 @@ import qs.Widgets
NIconButton { NIconButton {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
readonly property bool wifiEnabled: Settings.data.network.wifiEnabled readonly property bool wifiEnabled: Settings.data.network.wifiEnabled
sizeMultiplier: 0.8 sizeMultiplier: 0.8
showBorder: false showBorder: false

View file

@ -12,16 +12,13 @@ Item {
property bool isDestroying: false property bool isDestroying: false
property bool hovered: false property bool hovered: false
// Unified scale
readonly property real s: Scaling.scale(screen)
property ListModel localWorkspaces: ListModel {} property ListModel localWorkspaces: ListModel {}
property real masterProgress: 0.0 property real masterProgress: 0.0
property bool effectsActive: false property bool effectsActive: false
property color effectColor: Colors.mPrimary property color effectColor: Colors.mPrimary
property int horizontalPadding: Math.round(16 * s) property int horizontalPadding: Math.round(16 * scaling)
property int spacingBetweenPills: Math.round(8 * s) property int spacingBetweenPills: Math.round(8 * scaling)
signal workspaceChanged(int workspaceId, color accentColor) signal workspaceChanged(int workspaceId, color accentColor)
@ -30,18 +27,18 @@ Item {
for (var i = 0; i < localWorkspaces.count; i++) { for (var i = 0; i < localWorkspaces.count; i++) {
const ws = localWorkspaces.get(i) const ws = localWorkspaces.get(i)
if (ws.isFocused) if (ws.isFocused)
total += Math.round(44 * s) total += Math.round(44 * scaling)
else if (ws.isActive) else if (ws.isActive)
total += Math.round(28 * s) total += Math.round(28 * scaling)
else else
total += Math.round(16 * s) total += Math.round(16 * scaling)
} }
total += Math.max(localWorkspaces.count - 1, 0) * spacingBetweenPills total += Math.max(localWorkspaces.count - 1, 0) * spacingBetweenPills
total += horizontalPadding * 2 total += horizontalPadding * 2
return total return total
} }
height: Math.round(36 * s) height: Math.round(36 * scaling)
Component.onCompleted: { Component.onCompleted: {
localWorkspaces.clear() localWorkspaces.clear()
@ -116,14 +113,14 @@ Item {
Rectangle { Rectangle {
id: workspaceBackground id: workspaceBackground
width: parent.width - Math.round(15 * s) width: parent.width - Math.round(15 * scaling)
height: Math.round(26 * s) height: Math.round(26 * scaling)
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
radius: Math.round(12 * s) radius: Math.round(12 * scaling)
color: Colors.mSurfaceVariant color: Colors.mSurfaceVariant
border.color: Colors.mOutlineVariant 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.enabled: true
layer.effect: MultiEffect { layer.effect: MultiEffect {
shadowColor: Colors.mShadow shadowColor: Colors.mShadow
@ -144,14 +141,14 @@ Item {
model: localWorkspaces model: localWorkspaces
Item { Item {
id: workspacePillContainer id: workspacePillContainer
height: Math.round(12 * s) height: Math.round(12 * scaling)
width: { width: {
if (model.isFocused) if (model.isFocused)
return Math.round(44 * s) return Math.round(44 * scaling)
else if (model.isActive) else if (model.isActive)
return Math.round(28 * s) return Math.round(28 * scaling)
else else
return Math.round(16 * s) return Math.round(16 * scaling)
} }
Rectangle { Rectangle {
@ -159,10 +156,10 @@ Item {
anchors.fill: parent anchors.fill: parent
radius: { radius: {
if (model.isFocused) if (model.isFocused)
return Math.round(12 * s) return Math.round(12 * scaling)
else else
// half of focused height (if you want to animate this too) // half of focused height (if you want to animate this too)
return Math.round(6 * s) return Math.round(6 * scaling)
} }
color: { color: {
if (model.isFocused) if (model.isFocused)
@ -248,7 +245,7 @@ Item {
radius: width / 2 radius: width / 2
color: "transparent" color: "transparent"
border.color: root.effectColor 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 opacity: root.effectsActive && model.isFocused ? (1.0 - root.masterProgress) * 0.7 : 0
visible: root.effectsActive && model.isFocused visible: root.effectsActive && model.isFocused
z: 1 z: 1

View file

@ -13,8 +13,6 @@ NLoader {
NPanel { NPanel {
id: calendarPanel id: calendarPanel
readonly property real scaling: Scaling.scale(screen)
// Override hide function to animate first // Override hide function to animate first
function hide() { function hide() {
// Start hide animation // Start hide animation

View file

@ -13,8 +13,6 @@ NLoader {
NPanel { NPanel {
id: demoPanel id: demoPanel
readonly property real scaling: Scaling.scale(screen)
// Override hide function to animate first // Override hide function to animate first
function hide() { function hide() {
// Start hide animation // Start hide animation
@ -73,7 +71,7 @@ NLoader {
border.color: Colors.mOutlineVariant border.color: Colors.mOutlineVariant
border.width: Math.max(1, Style.borderThin * scaling) border.width: Math.max(1, Style.borderThin * scaling)
width: 500 * scaling width: 500 * scaling
height: 700 * scaling height: 900 * scaling
anchors.centerIn: parent anchors.centerIn: parent
// Animation properties // Animation properties
@ -312,7 +310,7 @@ NLoader {
} }
NText { NText {
text: `Brightness: ${Math.round(Brightness.brightness)}%` text: `Brightness: ${Math.round(BrightnessService.brightness)}%`
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
@ -322,30 +320,30 @@ NLoader {
icon: "brightness_low" icon: "brightness_low"
fontPointSize: Style.fontSizeLarge * scaling fontPointSize: Style.fontSizeLarge * scaling
onClicked: { onClicked: {
Brightness.decreaseBrightness() BrightnessService.decreaseBrightness()
} }
} }
NSlider { NSlider {
from: 0 from: 0
to: 100 to: 100
stepSize: 1 stepSize: 1
value: Brightness.brightness value: BrightnessService.brightness
implicitWidth: bgRect.width * 0.5 implicitWidth: bgRect.width * 0.5
onMoved: { onMoved: {
Brightness.setBrightnessDebounced(value) BrightnessService.setBrightnessDebounced(value)
} }
} }
NIconButton { NIconButton {
icon: "brightness_high" icon: "brightness_high"
fontPointSize: Style.fontSizeLarge * scaling fontPointSize: Style.fontSizeLarge * scaling
onClicked: { onClicked: {
Brightness.increaseBrightness() BrightnessService.increaseBrightness()
} }
} }
} }
NText { NText {
text: `Method: ${Brightness.currentMethod} | Available: ${Brightness.available}` text: `Method: ${BrightnessService.currentMethod} | Available: ${BrightnessService.available}`
color: Colors.mOnSurfaceVariant color: Colors.mOnSurfaceVariant
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View file

@ -14,9 +14,12 @@ NLoader {
Variants { Variants {
model: Quickshell.screens model: Quickshell.screens
Item { PanelWindow {
property var modelData id: dockWindow
readonly property real scaling: Scaling.scale(modelData)
required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen)
screen: modelData
// Auto-hide properties // Auto-hide properties
property bool autoHide: Settings.data.dock.autoHide property bool autoHide: Settings.data.dock.autoHide
@ -37,320 +40,314 @@ NLoader {
property var contextMenuTarget: null property var contextMenuTarget: null
property var contextMenuToplevel: null property var contextMenuToplevel: null
PanelWindow { // Dock is only shown if explicitely toggled
id: dockWindow visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false
// Dock is only shown if explicitely toggled exclusionMode: ExclusionMode.Ignore
visible: modelData ? Settings.data.dock.monitors.includes(modelData.name) : false anchors.bottom: true
anchors.left: true
anchors.right: true
focusable: false
color: "transparent"
implicitHeight: 60
screen: modelData // Timer for auto-hide delay
exclusionMode: ExclusionMode.Ignore Timer {
anchors.bottom: true id: hideTimer
anchors.left: true interval: hideDelay
anchors.right: true onTriggered: if (autoHide && !dockHovered && !anyAppHovered)
focusable: false hidden = true
color: "transparent" }
implicitHeight: 60
// Timer for auto-hide delay // Timer for show delay
Timer { Timer {
id: hideTimer id: showTimer
interval: hideDelay interval: showDelay
onTriggered: if (autoHide && !dockHovered && !anyAppHovered) onTriggered: hidden = false
hidden = true }
// Behavior for smooth hide/show animations
Behavior on margins.bottom {
NumberAnimation {
duration: hidden ? hideAnimationDuration : showAnimationDuration
easing.type: Easing.InOutQuad
} }
}
// Timer for show delay // Mouse area at screen bottom to detect entry and keep dock visible
Timer { MouseArea {
id: showTimer id: screenEdgeMouseArea
interval: showDelay anchors.left: parent.left
onTriggered: hidden = false 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 Rectangle {
Behavior on margins.bottom { id: dockContainer
NumberAnimation { width: dock.width + 40
duration: hidden ? hideAnimationDuration : showAnimationDuration height: 50
easing.type: Easing.InOutQuad 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 { MouseArea {
id: screenEdgeMouseArea id: dockMouseArea
anchors.left: parent.left anchors.fill: parent
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 10
hoverEnabled: true hoverEnabled: true
propagateComposedEvents: true propagateComposedEvents: true
onEntered: if (autoHide && hidden) onEntered: {
showTimer.start() dockHovered = true
onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered) if (autoHide) {
hideTimer.start() showTimer.stop()
} hideTimer.stop()
hidden = false
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0 }
}
MouseArea { onExited: {
anchors.fill: parent dockHovered = false
enabled: contextMenuVisible if (autoHide && !anyAppHovered && !contextMenuVisible)
onClicked: { hideTimer.start()
contextMenuVisible = false
contextMenuTarget = null
contextMenuToplevel = null
} }
} }
Rectangle { Item {
id: dockContainer id: dock
width: dock.width + 40 width: runningAppsRow.width
height: 50 height: parent.height - 10
color: Colors.mSurface anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
topLeftRadius: 20
topRightRadius: 20
MouseArea { NTooltip {
id: dockMouseArea id: appTooltip
anchors.fill: parent visible: false
hoverEnabled: true positionAbove: true
propagateComposedEvents: true
onEntered: {
dockHovered = true
if (autoHide) {
showTimer.stop()
hideTimer.stop()
hidden = false
}
}
onExited: {
dockHovered = false
if (autoHide && !anyAppHovered && !contextMenuVisible)
hideTimer.start()
}
} }
Item { function getAppIcon(toplevel: Toplevel): string {
id: dock if (!toplevel)
width: runningAppsRow.width return ""
height: parent.height - 10 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 anchors.centerIn: parent
NTooltip { Repeater {
id: appTooltip model: ToplevelManager ? ToplevelManager.toplevels : null
visible: false
positionAbove: true
}
function getAppIcon(toplevel: Toplevel): string { delegate: Rectangle {
if (!toplevel) id: appButton
return "" width: 36
let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true) height: 36
if (!icon) radius: 18
icon = Quickshell.iconPath(toplevel.appId, true) color: "transparent"
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 { property bool isActive: ToplevelManager.activeToplevel && ToplevelManager.activeToplevel === modelData
id: runningAppsRow property bool hovered: appMouseArea.containsMouse
spacing: 8 property string appId: modelData ? modelData.appId : ""
height: parent.height property string appTitle: modelData ? modelData.title : ""
anchors.centerIn: parent
Repeater { Behavior on color {
model: ToplevelManager ? ToplevelManager.toplevels : null ColorAnimation {
duration: 150
}
}
delegate: Rectangle { Image {
id: appButton id: appIcon
width: 36 width: 28
height: 36 height: 28
radius: 18 anchors.centerIn: parent
color: "transparent" source: dock.getAppIcon(modelData)
visible: source.toString() !== ""
smooth: false
mipmap: false
antialiasing: false
fillMode: Image.PreserveAspectFit
}
property bool isActive: ToplevelManager.activeToplevel Text {
&& ToplevelManager.activeToplevel === modelData anchors.centerIn: parent
property bool hovered: appMouseArea.containsMouse visible: !appIcon.visible
property string appId: modelData ? modelData.appId : "" text: appButton.appId ? appButton.appId.charAt(0).toUpperCase() : "?"
property string appTitle: modelData ? modelData.title : "" font.pixelSize: 14
font.bold: true
color: appButton.isActive ? Colors.mPrimary : Colors.mOnSurface
}
Behavior on color { MouseArea {
ColorAnimation { id: appMouseArea
duration: 150 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 { onExited: {
id: appIcon anyAppHovered = false
width: 28 appTooltip.hide()
height: 28 if (autoHide && !dockHovered && !contextMenuVisible)
anchors.centerIn: parent hideTimer.start()
source: dock.getAppIcon(modelData)
visible: source.toString() !== ""
smooth: false
mipmap: false
antialiasing: false
fillMode: Image.PreserveAspectFit
} }
Text { onClicked: function (mouse) {
anchors.centerIn: parent if (mouse.button === Qt.MiddleButton && modelData?.close) {
visible: !appIcon.visible modelData.close()
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
}
} }
if (mouse.button === Qt.LeftButton && modelData?.activate) {
onExited: { modelData.activate()
anyAppHovered = false }
if (mouse.button === Qt.RightButton) {
appTooltip.hide() appTooltip.hide()
if (autoHide && !dockHovered && !contextMenuVisible) contextMenuTarget = appButton
hideTimer.start() contextMenuToplevel = modelData
} contextMenuVisible = true
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
}
} }
} }
}
Rectangle { Rectangle {
visible: isActive visible: isActive
width: 20 width: 20
height: 3 height: 3
color: Colors.mPrimary color: Colors.mPrimary
radius: 1.5 radius: 1.5
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: 2 anchors.bottomMargin: 2
}
} }
} }
} }
} }
} }
}
// Context Menu // Context Menu
PanelWindow { PanelWindow {
id: contextMenuWindow id: contextMenuWindow
visible: contextMenuVisible visible: contextMenuVisible
screen: dockWindow.screen screen: dockWindow.screen
exclusionMode: ExclusionMode.Ignore exclusionMode: ExclusionMode.Ignore
anchors.bottom: true anchors.bottom: true
anchors.left: true anchors.left: true
anchors.right: true anchors.right: true
color: "transparent" color: "transparent"
focusable: false 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 { MouseArea {
id: closeMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
if (contextMenuToplevel?.close)
contextMenuToplevel.close()
contextMenuVisible = false contextMenuVisible = false
contextMenuTarget = null hidden = true
contextMenuToplevel = null
hidden = true // Hide dock when context menu closes
} }
} }
Rectangle { // Animation
id: contextMenuContainer scale: contextMenuVisible ? 1 : 0.9
width: 80 opacity: contextMenuVisible ? 1 : 0
height: 32 transformOrigin: Item.Bottom
radius: 8
color: closeMouseArea.containsMouse ? Colors.mTertiary : Colors.mSurface
border.color: Colors.mOutline
border.width: 1
x: { Behavior on scale {
if (!contextMenuTarget) NumberAnimation {
return 0 duration: 150
const pos = contextMenuTarget.mapToItem(null, 0, 0) easing.type: Easing.OutBack
let xPos = pos.x + (contextMenuTarget.width - width) / 2
return Math.max(0, Math.min(xPos, dockWindow.width - width))
} }
}
y: { Behavior on opacity {
if (!contextMenuTarget) NumberAnimation {
return 0 duration: 100
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
}
} }
} }
} }

View file

@ -16,6 +16,7 @@ Variants {
required property ShellScreen modelData required property ShellScreen modelData
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
screen: modelData
// Access the notification model from the service // Access the notification model from the service
property ListModel notificationModel: NotificationService.notificationModel property ListModel notificationModel: NotificationService.notificationModel
@ -23,7 +24,6 @@ Variants {
// Track notifications being removed for animation // Track notifications being removed for animation
property var removingNotifications: ({}) property var removingNotifications: ({})
screen: modelData
color: "transparent" color: "transparent"
// If no notification display activated in settings, then show them all // If no notification display activated in settings, then show them all

View file

@ -31,7 +31,6 @@ NLoader {
NPanel { NPanel {
id: panel id: panel
readonly property real scaling: Scaling.scale(screen)
property int currentTabIndex: 0 property int currentTabIndex: 0
// Override hide function to animate first // Override hide function to animate first

View file

@ -13,7 +13,6 @@ import qs.Widgets
NBox { NBox {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property string uptimeText: "--" property string uptimeText: "--"
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -7,8 +7,6 @@ import qs.Widgets
NBox { NBox {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
Layout.preferredWidth: 84 * scaling Layout.preferredWidth: 84 * scaling
implicitHeight: content.implicitHeight + Style.marginTiny * 2 * scaling implicitHeight: content.implicitHeight + Style.marginTiny * 2 * scaling

View file

@ -8,7 +8,6 @@ import qs.Widgets
NBox { NBox {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
readonly property bool weatherReady: (Location.data.weather !== null) readonly property bool weatherReady: (Location.data.weather !== null)
// TBC weatherReady is not turning to false when we reset weather... // TBC weatherReady is not turning to false when we reset weather...

View file

@ -32,7 +32,6 @@ NLoader {
NPanel { NPanel {
id: sidePanel id: sidePanel
readonly property real scaling: Scaling.scale(screen)
// Single source of truth for spacing between cards (both axes) // Single source of truth for spacing between cards (both axes)
property real cardSpacing: Style.marginLarge * scaling property real cardSpacing: Style.marginLarge * scaling
// X coordinate from the bar to align this panel under // X coordinate from the bar to align this panel under

View file

@ -6,8 +6,6 @@ import qs.Services
Rectangle { Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
implicitWidth: childrenRect.width implicitWidth: childrenRect.width
implicitHeight: childrenRect.height implicitHeight: childrenRect.height

View file

@ -4,8 +4,6 @@ import qs.Services
Item { Item {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property bool running: true property bool running: true
property color color: Colors.mPrimary property color color: Colors.mPrimary
property int size: Style.baseWidgetSize * scaling property int size: Style.baseWidgetSize * scaling

View file

@ -5,8 +5,6 @@ import qs.Services
Rectangle { Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
implicitWidth: childrenRect.width implicitWidth: childrenRect.width
implicitHeight: childrenRect.height implicitHeight: childrenRect.height

View file

@ -5,7 +5,6 @@ import qs.Services
Rectangle { Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property real value: 0 // 0..100 (or any range visually mapped) property real value: 0 // 0..100 (or any range visually mapped)
property string icon: "" property string icon: ""
property string suffix: "%" property string suffix: "%"

View file

@ -5,8 +5,6 @@ import qs.Widgets
Rectangle { Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
signal entered signal entered
signal exited signal exited
signal clicked signal clicked

View file

@ -7,7 +7,6 @@ import qs.Widgets
ColumnLayout { ColumnLayout {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
readonly property real preferredHeight: Style.baseWidgetSize * 1.25 * scaling readonly property real preferredHeight: Style.baseWidgetSize * 1.25 * scaling
property string label: "" property string label: ""

View file

@ -6,7 +6,6 @@ import qs.Services
Rectangle { Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
// Multiplier to control how large the button container is relative to Style.baseWidgetSize // Multiplier to control how large the button container is relative to Style.baseWidgetSize
property real sizeMultiplier: 1.0 property real sizeMultiplier: 1.0
property real size: Style.baseWidgetSize * sizeMultiplier * scaling property real size: Style.baseWidgetSize * sizeMultiplier * scaling

View file

@ -10,7 +10,6 @@ Rectangle {
property real imageRadius: width * 0.5 property real imageRadius: width * 0.5
radius: imageRadius radius: imageRadius
readonly property real scaling: Scaling.scale(screen)
property string imagePath: "" property string imagePath: ""
property string fallbackIcon: "" property string fallbackIcon: ""
property color borderColor: "transparent" property color borderColor: "transparent"

View file

@ -7,10 +7,10 @@ PanelWindow {
id: root id: root
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property bool showOverlay: Settings.data.general.dimDesktop property bool showOverlay: Settings.data.general.dimDesktop
property int topMargin: Style.barHeight * scaling property int topMargin: Style.barHeight * scaling
property color overlayColor: showOverlay ? Colors.applyOpacity(Colors.mShadow, "AA") : "transparent" property color overlayColor: showOverlay ? Colors.applyOpacity(Colors.mShadow, "AA") : "transparent"
signal dismissed signal dismissed
function hide() { function hide() {
@ -37,7 +37,7 @@ PanelWindow {
color: visible ? overlayColor : "transparent" color: visible ? overlayColor : "transparent"
visible: false visible: false
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
screen: (typeof modelData !== 'undefined' ? modelData : null)
anchors.top: true anchors.top: true
anchors.left: true anchors.left: true
anchors.right: true anchors.right: true

View file

@ -5,8 +5,6 @@ import qs.Services
Item { Item {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property string icon: "" property string icon: ""
property string text: "" property string text: ""
property string tooltipText: "" property string tooltipText: ""

View file

@ -6,14 +6,12 @@ import qs.Services
Slider { Slider {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
readonly property real knobDiameter: Style.baseWidgetSize * 0.75 * scaling readonly property real knobDiameter: Style.baseWidgetSize * 0.75 * scaling
readonly property real trackHeight: knobDiameter * 0.5 readonly property real trackHeight: knobDiameter * 0.5
readonly property real cutoutExtra: Style.baseWidgetSize * 0.1 * scaling readonly property real cutoutExtra: Style.baseWidgetSize * 0.1 * scaling
// Optional color to cut the track beneath the knob (should match surrounding background) // Optional color to cut the track beneath the knob (should match surrounding background)
property var cutoutColor property var cutoutColor
property var screen
property bool snapAlways: true property bool snapAlways: true
snapMode: snapAlways ? Slider.SnapAlways : Slider.SnapOnRelease snapMode: snapAlways ? Slider.SnapAlways : Slider.SnapOnRelease

View file

@ -5,8 +5,6 @@ import qs.Widgets
Text { Text {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
font.family: Settings.data.ui.fontFamily font.family: Settings.data.ui.fontFamily
font.pointSize: Style.fontSizeMedium * scaling font.pointSize: Style.fontSizeMedium * scaling
font.weight: Style.fontWeightRegular font.weight: Style.fontWeightRegular

View file

@ -6,7 +6,6 @@ import qs.Services
Item { Item {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property string label: "" property string label: ""
property string description: "" property string description: ""
property bool readOnly: false property bool readOnly: false

View file

@ -6,7 +6,6 @@ import qs.Services
RowLayout { RowLayout {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property string label: "" property string label: ""
property string description: "" property string description: ""
property bool value: false property bool value: false

View file

@ -4,7 +4,6 @@ import qs.Services
Window { Window {
id: root id: root
readonly property real scaling: Scaling.scale(screen)
property bool isVisible: false property bool isVisible: false
property string text: "Placeholder" property string text: "Placeholder"
property Item target: null property Item target: null