Merge pull request #80 from leiserfg/remove-qt5-dep
Remove qt5.comp dep
This commit is contained in:
commit
e71fecb521
11 changed files with 127 additions and 109 deletions
|
|
@ -4,7 +4,7 @@ import QtQuick.Layouts
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtQuick.Effects
|
||||
import qs.Bar.Modules
|
||||
import qs.Settings
|
||||
import qs.Services
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell.Widgets
|
||||
import QtQuick.Effects
|
||||
import qs.Settings
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
|
|
@ -63,8 +63,8 @@ Item {
|
|||
|
||||
// Rounded corners using layer
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
cached: true
|
||||
layer.effect: MultiEffect {
|
||||
maskEnabled: true
|
||||
maskSource: Rectangle {
|
||||
width: albumArt.width
|
||||
height: albumArt.height
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtQuick.Effects
|
||||
import Quickshell.Services.SystemTray
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
|
|
@ -63,7 +63,8 @@ Row {
|
|||
backer.fillMode: Image.PreserveAspectFit
|
||||
source: {
|
||||
let icon = modelData?.icon || "";
|
||||
if (!icon) return "";
|
||||
if (!icon)
|
||||
return "";
|
||||
// Process icon path
|
||||
if (icon.includes("?path=")) {
|
||||
const [name, path] = icon.split("?path=");
|
||||
|
|
@ -80,9 +81,7 @@ Row {
|
|||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Component.onCompleted: {
|
||||
|
||||
}
|
||||
Component.onCompleted: {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -92,31 +91,32 @@ Row {
|
|||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
onClicked: (mouse) => {
|
||||
if (!modelData) return;
|
||||
onClicked: mouse => {
|
||||
if (!modelData)
|
||||
return;
|
||||
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
// Close any open menu first
|
||||
if (trayMenu && trayMenu.visible) {
|
||||
trayMenu.hideMenu()
|
||||
trayMenu.hideMenu();
|
||||
}
|
||||
|
||||
if (!modelData.onlyMenu) {
|
||||
modelData.activate()
|
||||
modelData.activate();
|
||||
}
|
||||
} else if (mouse.button === Qt.MiddleButton) {
|
||||
// Close any open menu first
|
||||
if (trayMenu && trayMenu.visible) {
|
||||
trayMenu.hideMenu()
|
||||
trayMenu.hideMenu();
|
||||
}
|
||||
|
||||
modelData.secondaryActivate && modelData.secondaryActivate()
|
||||
modelData.secondaryActivate && modelData.secondaryActivate();
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
trayTooltip.tooltipVisible = false
|
||||
trayTooltip.tooltipVisible = false;
|
||||
// If menu is already visible, close it
|
||||
if (trayMenu && trayMenu.visible) {
|
||||
trayMenu.hideMenu()
|
||||
return
|
||||
trayMenu.hideMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
if (modelData.hasMenu && modelData.menu && trayMenu) {
|
||||
|
|
@ -125,9 +125,9 @@ Row {
|
|||
const menuY = height + 20;
|
||||
trayMenu.menu = modelData.menu;
|
||||
trayMenu.showAt(parent, menuX, menuY);
|
||||
} else {
|
||||
// console.log("No menu available for", modelData.id, "or trayMenu not set")
|
||||
}
|
||||
} else
|
||||
// console.log("No menu available for", modelData.id, "or trayMenu not set")
|
||||
{}
|
||||
}
|
||||
}
|
||||
onEntered: trayTooltip.tooltipVisible = true
|
||||
|
|
@ -143,9 +143,9 @@ Row {
|
|||
delay: 200
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
// No cache cleanup needed
|
||||
}
|
||||
Component.onDestruction:
|
||||
// No cache cleanup needed
|
||||
{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ import QtQuick
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Settings
|
||||
|
|
@ -124,13 +124,13 @@ Item {
|
|||
border.color: Qt.rgba(Theme.textPrimary.r, Theme.textPrimary.g, Theme.textPrimary.b, 0.1)
|
||||
border.width: 1
|
||||
layer.enabled: true
|
||||
layer.effect: DropShadow {
|
||||
color: "black"
|
||||
radius: 12
|
||||
samples: 24
|
||||
verticalOffset: 0
|
||||
horizontalOffset: 0
|
||||
opacity: 0.10
|
||||
layer.effect: MultiEffect {
|
||||
shadowColor: "black"
|
||||
// radius: 12
|
||||
|
||||
shadowVerticalOffset: 0
|
||||
shadowHorizontalOffset: 0
|
||||
shadowOpacity: 0.10
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import qs.Settings
|
||||
import QtQuick.Effects
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
|
@ -17,18 +17,27 @@ Item {
|
|||
backer.fillMode: Image.PreserveAspectCrop
|
||||
}
|
||||
|
||||
OpacityMask {
|
||||
MultiEffect {
|
||||
anchors.fill: avatarImage
|
||||
source: avatarImage
|
||||
maskSource: Rectangle {
|
||||
width: avatarImage.width
|
||||
height: avatarImage.height
|
||||
radius: avatarImage.width / 2
|
||||
visible: false
|
||||
}
|
||||
maskEnabled: true
|
||||
maskSource: mask
|
||||
visible: Settings.settings.profileImage !== ""
|
||||
}
|
||||
|
||||
Item {
|
||||
id: mask
|
||||
|
||||
anchors.fill: avatarImage
|
||||
layer.enabled: true
|
||||
visible: false
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: avatarImage
|
||||
radius: avatarImage.width / 2
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback icon
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
|
|
@ -40,4 +49,3 @@ Item {
|
|||
z: 0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Services.Pam
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import qs.Components
|
||||
import qs.Settings
|
||||
|
|
@ -33,7 +32,7 @@ WlSessionLock {
|
|||
Component.onCompleted: {
|
||||
Qt.callLater(function () {
|
||||
fetchWeatherData();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function fetchWeatherData() {
|
||||
|
|
@ -147,6 +146,7 @@ WlSessionLock {
|
|||
blurEnabled: true
|
||||
blur: 0.48 // controls blur strength (0 to 1)
|
||||
blurMax: 128 // max blur radius in pixels
|
||||
// transparentBorder: true
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
@ -164,10 +164,11 @@ WlSessionLock {
|
|||
Avatar {}
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: Glow {
|
||||
color: Theme.accentPrimary
|
||||
radius: 8
|
||||
samples: 16
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: Theme.accentPrimary
|
||||
// radius: 8
|
||||
// samples: 16
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +304,7 @@ WlSessionLock {
|
|||
position: "bottomright"
|
||||
size: 1.3
|
||||
fillColor: (Theme.backgroundPrimary !== undefined && Theme.backgroundPrimary !== null) ? Theme.backgroundPrimary : "#222"
|
||||
offsetX: - Screen.width / 2 - 38
|
||||
offsetX: -Screen.width / 2 - 38
|
||||
offsetY: 0
|
||||
anchors.top: parent.top
|
||||
visible: Settings.settings.showCorners
|
||||
|
|
@ -379,7 +380,6 @@ WlSessionLock {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -408,11 +408,9 @@ WlSessionLock {
|
|||
anchors.margins: 32
|
||||
spacing: 12
|
||||
|
||||
BatteryCharge {
|
||||
}
|
||||
BatteryCharge {}
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import QtQuick
|
|||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import qs.Services
|
||||
import qs.Settings
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue