Remove qt5-compat

This commit is contained in:
leiserfg 2025-07-28 09:17:13 +02:00
parent 82935d9236
commit 316a5e2f44
No known key found for this signature in database
11 changed files with 128 additions and 110 deletions

View file

@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Effects
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import Quickshell.Widgets
import qs.Components
import qs.Settings
@ -91,7 +91,7 @@ Rectangle {
activeFocusOnTab: true
inputMethodHints: Qt.ImhUrlCharactersOnly
onTextChanged: {
Settings.settings.profileImage = text
Settings.settings.profileImage = text;
}
MouseArea {
anchors.fill: parent
@ -152,7 +152,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showActiveWindowIcon = !Settings.settings.showActiveWindowIcon
Settings.settings.showActiveWindowIcon = !Settings.settings.showActiveWindowIcon;
}
}
}
@ -207,7 +207,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showSystemInfoInBar = !Settings.settings.showSystemInfoInBar
Settings.settings.showSystemInfoInBar = !Settings.settings.showSystemInfoInBar;
}
}
}
@ -262,7 +262,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showCorners = !Settings.settings.showCorners
Settings.settings.showCorners = !Settings.settings.showCorners;
}
}
}
@ -317,7 +317,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showTaskbar = !Settings.settings.showTaskbar
Settings.settings.showTaskbar = !Settings.settings.showTaskbar;
}
}
}
@ -372,7 +372,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showDock = !Settings.settings.showDock
Settings.settings.showDock = !Settings.settings.showDock;
}
}
}
@ -427,7 +427,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.showMediaInBar = !Settings.settings.showMediaInBar
Settings.settings.showMediaInBar = !Settings.settings.showMediaInBar;
}
}
}
@ -482,7 +482,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
Settings.settings.dimPanels = !Settings.settings.dimPanels
Settings.settings.dimPanels = !Settings.settings.dimPanels;
}
}
}
@ -621,7 +621,7 @@ Rectangle {
activeFocusOnTab: true
inputMethodHints: Qt.ImhUrlCharactersOnly
onTextChanged: {
Settings.settings.videoPath = text
Settings.settings.videoPath = text;
}
MouseArea {
anchors.fill: parent
@ -632,4 +632,4 @@ Rectangle {
}
}
}
}
}

View file

@ -1,7 +1,7 @@
import QtQuick
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import QtQuick.Effects
import qs.Settings
import qs.Components
import qs.Services
@ -61,7 +61,8 @@ Rectangle {
// Album art with spectrum
Item {
id: albumArtContainer
width: 96; height: 96 // enough for spectrum and art (will adjust if needed)
width: 96
height: 96 // enough for spectrum and art (will adjust if needed)
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
// Spectrum visualizer
@ -80,7 +81,8 @@ Rectangle {
// Album art image
Rectangle {
id: albumArtwork
width: 60; height: 60
width: 60
height: 60
anchors.centerIn: parent
radius: 30 // circle
color: Qt.darker(Theme.surface, 1.1)
@ -103,14 +105,23 @@ Rectangle {
// Rounded corners using layer
layer.enabled: true
layer.effect: OpacityMask {
cached: true
maskSource: Rectangle {
width: albumArt.width
height: albumArt.height
radius: albumArt.width / 2 // circle
visible: false
}
layer.effect: MultiEffect {
maskEnabled: true
maskSource: mask
}
}
Item {
id: mask
anchors.fill: albumArt
layer.enabled: true
visible: false
Rectangle {
width: albumArt.width
height: albumArt.height
radius: albumArt.width / 2 // circle
}
}
@ -172,8 +183,7 @@ Rectangle {
color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.15)
Layout.fillWidth: true
property real progressRatio: Math.min(1, MusicManager.trackLength > 0 ?
(MusicManager.currentPosition / MusicManager.trackLength) : 0)
property real progressRatio: Math.min(1, MusicManager.trackLength > 0 ? (MusicManager.currentPosition / MusicManager.trackLength) : 0)
Rectangle {
id: progressFill
@ -183,7 +193,9 @@ Rectangle {
color: Theme.accentPrimary
Behavior on width {
NumberAnimation { duration: 200 }
NumberAnimation {
duration: 200
}
}
}
@ -197,14 +209,16 @@ Rectangle {
border.color: Qt.lighter(Theme.accentPrimary, 1.3)
border.width: 1
x: Math.max(0, Math.min(parent.width - width, progressFill.width - width/2))
x: Math.max(0, Math.min(parent.width - width, progressFill.width - width / 2))
anchors.verticalCenter: parent.verticalCenter
visible: MusicManager.trackLength > 0
scale: progressMouseArea.containsMouse || progressMouseArea.pressed ? 1.2 : 1.0
Behavior on scale {
NumberAnimation { duration: 150 }
NumberAnimation {
duration: 150
}
}
}
@ -216,15 +230,15 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
enabled: MusicManager.trackLength > 0 && MusicManager.canSeek
onClicked: function(mouse) {
let ratio = mouse.x / width
MusicManager.seekByRatio(ratio)
onClicked: function (mouse) {
let ratio = mouse.x / width;
MusicManager.seekByRatio(ratio);
}
onPositionChanged: function(mouse) {
onPositionChanged: function (mouse) {
if (pressed) {
let ratio = Math.max(0, Math.min(1, mouse.x / width))
MusicManager.seekByRatio(ratio)
let ratio = Math.max(0, Math.min(1, mouse.x / width));
MusicManager.seekByRatio(ratio);
}
}
}
@ -319,4 +333,4 @@ Rectangle {
}
}
}
}
}

View file

@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Effects
import Quickshell
import Quickshell.Io
import qs.Settings

View file

@ -1,7 +1,7 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Effects
import Quickshell
import Quickshell.Io
import Quickshell.Widgets
@ -380,7 +380,7 @@ Rectangle {
running: false
}
Process {
Process {
id: logoutProcessNiri
command: ["niri", "msg", "action", "quit", "--skip-confirmation"]
running: false
@ -421,7 +421,6 @@ Rectangle {
rebootProcess.running = true;
}
property bool panelVisible: false
// Trigger initial update when panel becomes visible
@ -451,4 +450,4 @@ Rectangle {
LockScreen {
id: lockScreen
}
}
}