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,13 +40,9 @@ 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
|
||||
|
||||
screen: modelData
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
anchors.bottom: true
|
||||
anchors.left: true
|
||||
|
|
@ -175,8 +174,7 @@ NLoader {
|
|||
radius: 18
|
||||
color: "transparent"
|
||||
|
||||
property bool isActive: ToplevelManager.activeToplevel
|
||||
&& ToplevelManager.activeToplevel === modelData
|
||||
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 : ""
|
||||
|
|
@ -358,4 +356,3 @@ NLoader {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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