quickshell: a bunch of changes
This commit is contained in:
parent
8c6b9f65c9
commit
b82a3580ec
11 changed files with 137 additions and 100 deletions
|
@ -1,103 +1,105 @@
|
|||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Wayland
|
||||
|
||||
import qs.config
|
||||
|
||||
Singleton {
|
||||
id: audioPopup
|
||||
property bool popupOpen: true
|
||||
id: root
|
||||
|
||||
property var volume: sink.ready ? audioPopup.sink.audio.volume : 0
|
||||
property real volume: Pipewire.defaultAudioSink?.audio?.volume ?? 0
|
||||
property real popupOpacity: 0
|
||||
|
||||
property var visible: volume
|
||||
|
||||
property PwNode sink: Pipewire.defaultAudioSink
|
||||
|
||||
// bind the node so we can read its properties
|
||||
PwObjectTracker {
|
||||
objects: [audioPopup.sink]
|
||||
objects: [Pipewire.defaultAudioSink]
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: 3000
|
||||
running: false
|
||||
repeat: false
|
||||
|
||||
onTriggered: audioPopup.visible = false
|
||||
onVolumeChanged: {
|
||||
root.popupOpacity = 1;
|
||||
loader.activeAsync = true;
|
||||
timer.restart();
|
||||
timer_opacity.restart();
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
id: loader
|
||||
activeAsync: audioPopup.popupOpen
|
||||
activeAsync: false
|
||||
|
||||
PanelWindow {
|
||||
id: popup
|
||||
width: 400
|
||||
height: 30
|
||||
visible: true
|
||||
|
||||
// Give the window an empty click mask so all clicks pass through it.
|
||||
implicitWidth: rect.implicitWidth
|
||||
implicitHeight: 50
|
||||
color: "transparent"
|
||||
mask: Region {}
|
||||
|
||||
// Use the wlroots specific layer property to ensure it displays over
|
||||
// fullscreen windows.
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
color: "transparent"
|
||||
|
||||
anchors {
|
||||
bottom: true
|
||||
}
|
||||
|
||||
margins {
|
||||
bottom: 250
|
||||
}
|
||||
anchors.bottom: true
|
||||
margins.bottom: 100
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
Layout.fillWidth: true
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: "white"
|
||||
height: parent.height
|
||||
width: parent.width
|
||||
anchors.fill: parent
|
||||
color: Colors.surface0
|
||||
implicitWidth: 300
|
||||
implicitHeight: parent.implicitHeight
|
||||
radius: 5
|
||||
opacity: 0
|
||||
opacity: root.popupOpacity
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
duration: 500
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: "black"
|
||||
height: 20
|
||||
radius: height / 2
|
||||
id: bar
|
||||
color: Colors.blue
|
||||
implicitWidth: rect.implicitWidth * root.volume - 20
|
||||
implicitHeight: 30
|
||||
topRightRadius: 5
|
||||
bottomRightRadius: 5
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
topLeftRadius: 0
|
||||
bottomLeftRadius: 0
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width * audioPopup.sink.audio.volume
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: 300
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
interval: 2000
|
||||
running: false
|
||||
onTriggered: loader.activeAsync = false
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer_opacity
|
||||
interval: 1500
|
||||
running: false
|
||||
onTriggered: {
|
||||
root.popupOpacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,9 +49,9 @@ Singleton {
|
|||
}
|
||||
}
|
||||
width: 450
|
||||
color: Config.catppuccin.base
|
||||
color: Colors.base
|
||||
radius: 5
|
||||
border.color: Config.catppuccin.mantle
|
||||
border.color: Colors.mantle
|
||||
border.width: 2
|
||||
|
||||
ColumnLayout {
|
||||
|
@ -64,9 +64,9 @@ Singleton {
|
|||
id: searchContainer
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: searchbox.implicitHeight + 10
|
||||
color: Config.catppuccin.base
|
||||
color: Colors.base
|
||||
radius: 3
|
||||
border.color: Config.catppuccin.mantle
|
||||
border.color: Colors.mantle
|
||||
|
||||
RowLayout {
|
||||
id: searchbox
|
||||
|
@ -76,7 +76,7 @@ Singleton {
|
|||
TextInput {
|
||||
id: search
|
||||
Layout.fillWidth: true
|
||||
color: Config.catppuccin.text
|
||||
color: Colors.text
|
||||
font.pointSize: 13
|
||||
|
||||
focus: true
|
||||
|
@ -252,7 +252,7 @@ Singleton {
|
|||
highlight: Rectangle {
|
||||
radius: 5
|
||||
color: "transparent"
|
||||
border.color: Config.catppuccin.lavender
|
||||
border.color: Colors.lavender
|
||||
border.width: 2
|
||||
}
|
||||
keyNavigationEnabled: true
|
||||
|
@ -293,7 +293,7 @@ Singleton {
|
|||
}
|
||||
Text {
|
||||
text: modelData.name
|
||||
color: Config.catppuccin.text
|
||||
color: Colors.text
|
||||
font.family: "JetBrainsMono Nerd Font Mono"
|
||||
font.pointSize: 13
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
|
|
@ -106,7 +106,7 @@ Scope {
|
|||
property: "width"
|
||||
from: rect.width
|
||||
to: 0
|
||||
duration: failed ? 10000 : 800
|
||||
duration: root.failed ? 10000 : 800
|
||||
onFinished: popupLoader.active = false
|
||||
|
||||
// Pause the animation when the mouse is hovering over the popup,
|
||||
|
|
25
modules/style/quickshell/shell/config/Colors.qml
Normal file
25
modules/style/quickshell/shell/config/Colors.qml
Normal file
|
@ -0,0 +1,25 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property color base: "#1e1e2e"
|
||||
readonly property color mantle: "#181825"
|
||||
readonly property color surface0: "#313244"
|
||||
readonly property color surface1: "#45475a"
|
||||
readonly property color surface2: "#585b70"
|
||||
readonly property color text: "#cdd6f4"
|
||||
readonly property color rosewater: "#f5e0dc"
|
||||
readonly property color lavender: "#b4befe"
|
||||
readonly property color red: "#f38ba8"
|
||||
readonly property color peach: "#fab387"
|
||||
readonly property color yellow: "#f9e2af"
|
||||
readonly property color green: "#a6e3a1"
|
||||
readonly property color teal: "#a6e3a1"
|
||||
readonly property color blue: "#89b4fa"
|
||||
readonly property color mauve: "#cba6f7"
|
||||
readonly property color flamingo: "#f2cdcd"
|
||||
}
|
|
@ -25,24 +25,6 @@ Singleton {
|
|||
readonly property int rounding: 0
|
||||
}
|
||||
|
||||
readonly property QtObject catppuccin: QtObject {
|
||||
readonly property color base: "#1e1e2e"
|
||||
readonly property color mantle: "#181825"
|
||||
readonly property color surface0: "#313244"
|
||||
readonly property color surface1: "#45475a"
|
||||
readonly property color surface2: "#585b70"
|
||||
readonly property color text: "#cdd6f4"
|
||||
readonly property color rosewater: "#f5e0dc"
|
||||
readonly property color lavender: "#b4befe"
|
||||
readonly property color red: "#f38ba8"
|
||||
readonly property color peach: "#fab387"
|
||||
readonly property color yellow: "#f9e2af"
|
||||
readonly property color green: "#a6e3a1"
|
||||
readonly property color teal: "#a6e3a1"
|
||||
readonly property color blue: "#89b4fa"
|
||||
readonly property color mauve: "#cba6f7"
|
||||
readonly property color flamingo: "#f2cdcd"
|
||||
}
|
||||
readonly property QtObject volumeslider: QtObject {
|
||||
readonly property int width: 50
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Qt.labs.folderlistmodel 2.9
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
@ -9,6 +10,24 @@ PanelWindow {
|
|||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.namespace: "shell:background"
|
||||
|
||||
// property string basePath: "file:///home/cr/Documents/Backgrounds/"
|
||||
// property var absPath: folderModel.get(Math.floor(Math.random() * folderModel.count), "filePath")
|
||||
// property var finalPath: absPath
|
||||
|
||||
// property bool _: log()
|
||||
// function log() {
|
||||
// console.log(absPath);
|
||||
// console.log(folderModel.count);
|
||||
// return true;
|
||||
// }
|
||||
FolderListModel {
|
||||
id: folderModel
|
||||
// folder: root.basePath
|
||||
nameFilters: ["*.png"]
|
||||
showDirs: false
|
||||
showFiles: true
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
|
@ -16,13 +35,21 @@ PanelWindow {
|
|||
right: true
|
||||
}
|
||||
|
||||
Item {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
Image {
|
||||
id: image
|
||||
asynchronous: true
|
||||
source: "/home/cr/repos/projects/nichts/modules/style/wholefoods.png"
|
||||
// Item {
|
||||
// id: background
|
||||
// anchors.fill: parent
|
||||
// Image {
|
||||
// id: image
|
||||
// source: Qt.resolvedUrl(root.finalPath)
|
||||
// }
|
||||
// }
|
||||
Timer {
|
||||
id: timer
|
||||
// 10 minutes
|
||||
interval: 1000 * 60 * 10
|
||||
running: false
|
||||
onTriggered: {
|
||||
root.popupOpacity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ Rectangle {
|
|||
width: text.width + 5
|
||||
height: text.height + 5
|
||||
implicitWidth: width
|
||||
border.color: Config.catppuccin.rosewater
|
||||
border.color: Colors.rosewater
|
||||
border.width: 0
|
||||
radius: 5
|
||||
color: "transparent"
|
||||
|
@ -24,7 +24,7 @@ Rectangle {
|
|||
font.family: "JetBrainsMono NF Mono"
|
||||
font.pointSize: 15
|
||||
|
||||
color: Config.catppuccin.text
|
||||
color: Colors.text
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
|
|
|
@ -36,7 +36,7 @@ Rectangle {
|
|||
// height: workspaces.length * root.wsItemHeight
|
||||
implicitWidth: list.implicitWidth
|
||||
color: "transparent"
|
||||
border.color: Config.catppuccin.rosewater
|
||||
border.color: Colors.rosewater
|
||||
border.width: 0
|
||||
radius: 7
|
||||
|
||||
|
@ -93,9 +93,9 @@ Rectangle {
|
|||
height: wsItem.height - 5
|
||||
width: parent.width * wsItem.animActive
|
||||
radius: height / 2
|
||||
border.color: Config.catppuccin.mantle
|
||||
border.color: Colors.mantle
|
||||
border.width: 0
|
||||
color: Config.catppuccin.blue
|
||||
color: Colors.blue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ import Quickshell.Wayland
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
|
||||
import "../bar"
|
||||
import qs.modules.bar
|
||||
|
||||
import "../../config"
|
||||
import "../"
|
||||
import qs.config
|
||||
import qs.modules
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
//@ pragma Env QS_NO_RELOAD_POPUP=1
|
||||
//@ pragma Env QT_QML_GENERATE_QMLLS_INI
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
@ -10,10 +9,7 @@ import qs
|
|||
ShellRoot {
|
||||
id: shellroot
|
||||
|
||||
Component.onCompleted: [Launcher.init()]
|
||||
Component.onCompleted: [Launcher.init(), AudioPopup.init()]
|
||||
|
||||
Drawers {}
|
||||
// Background {}Popup
|
||||
//
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue