move qs config to work on mango and do general improvements

This commit is contained in:
lucy 2026-08-23 21:25:55 +02:00
commit 0f8929c55a
30 changed files with 994 additions and 0 deletions

View file

@ -0,0 +1,110 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Wayland
import Quickshell.Widgets
import Quickshell.Hyprland
import QtQuick
import Qt.labs.folderlistmodel 2.11
import QtQuick.Effects
import qs
import qs.settings
import qs.widgets
BarComponent {
implicitHeight: Config.moduleHeight
implicitWidth: Config.moduleHeight
required property int screenHeight
id: main
MaterialIcon {
anchors.centerIn: main
text: "\ue1bc"
font.bold: true
}
MouseArea {
id: clickHandler
anchors.fill: main
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onClicked: {
wallPicker.visible = !wallPicker.visible;
}
}
WlrLayershell {
id: wallPicker
visible: false
exclusionMode: ExclusionMode.Ignore
keyboardFocus: WlrKeyboardFocus.OnDemand
implicitHeight: main.screenHeight / 8
color: 'transparent'
anchors {
bottom: true
left: true
right: true
}
margins {
bottom: 20
left: 20
right: 20
}
onVisibleChanged: {
if (wallPicker.visible)
container.forceActiveFocus();
}
Rectangle {
id: container
focus: true
Keys.onEscapePressed: {
wallPicker.visible = false;
}
anchors.fill: parent
color: Colors.base00
radius: Config.rounding
GridView {
id: wallpaperLayout
clip: true
snapMode: GridView.SnapOneRow
flow: GridView.FlowTopToBottom
cellHeight: container.height
cellWidth: container.width / 8
anchors.fill: parent
anchors.centerIn: parent
anchors.margins: 10
model: wallpaperList
delegate: ClippingRectangle {
id: wallTile
clip: true
required property var modelData
radius: Config.rounding / 1.5
color: 'transparent'
implicitWidth: wallpaperLayout.cellWidth - 20
implicitHeight: wallpaperLayout.cellHeight - 20
Image {
id: wallpaper
anchors.fill: parent
source: wallTile.modelData.filePath
sourceSize.width: 16 * 30
sourceSize.height: 9 * 30
asynchronous: true
cache: true
}
MouseArea {
id: wpClickHandler
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton
hoverEnabled: true
onClicked: {
Config.wallpaper = wallTile.modelData.filePath;
}
}
}
}
FolderListModel {
id: wallpaperList
folder: Config.wallDir
nameFilters: ["*.png"]
}
}
}
}

View file

@ -0,0 +1,130 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Wayland
import Quickshell.Widgets
import Quickshell.Hyprland
import QtQuick
import Qt.labs.folderlistmodel 2.11
import QtQuick.Effects
import qs
import qs.settings
import qs.widgets
Rectangle {
id: main
layer.enabled: true
layer.effect: MultiEffect {
id: dropShadow
source: main
shadowEnabled: true
shadowHorizontalOffset: 4
shadowVerticalOffset: 2
shadowOpacity: 0.5
shadowColor: "#020202"
}
required property real moduleHeight
required property int screenHeight
color: Colors.moduleBg
radius: Config.rounding
implicitWidth: moduleHeight
implicitHeight: moduleHeight
MaterialIcon {
anchors.centerIn: main
text: "\ue1bc"
font.bold: true
}
MouseArea {
id: clickHandler
anchors.fill: main
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onClicked: {
wallPicker.visible = !wallPicker.visible;
}
}
WlrLayershell {
id: wallPicker
visible: false
exclusionMode: ExclusionMode.Ignore
keyboardFocus: WlrKeyboardFocus.OnDemand
implicitHeight: main.screenHeight / 8
color: 'transparent'
anchors {
bottom: true
left: true
right: true
}
margins {
bottom: 20
left: 20
right: 20
}
HyprlandFocusGrab {
id: grabber
active: wallPicker.visible
windows: [wallPicker]
onCleared: wallPicker.visible = false
}
onVisibleChanged: {
if (wallPicker.visible)
container.forceActiveFocus();
}
Rectangle {
id: container
focus: true
Keys.onEscapePressed: {
wallPicker.visible = false;
}
anchors.fill: parent
color: Colors.base00
radius: Config.rounding
GridView {
id: wallpaperLayout
clip: true
snapMode: GridView.SnapOneRow
flow: GridView.FlowTopToBottom
cellHeight: container.height
cellWidth: container.width / 8
anchors.fill: parent
anchors.centerIn: parent
anchors.margins: 10
model: wallpaperList
delegate: ClippingRectangle {
id: wallTile
clip: true
required property var modelData
radius: Config.rounding / 1.5
color: 'transparent'
implicitWidth: wallpaperLayout.cellWidth - 20
implicitHeight: wallpaperLayout.cellHeight - 20
Image {
id: wallpaper
anchors.fill: parent
source: wallTile.modelData.filePath
sourceSize.width: 16 * 30
sourceSize.height: 9 * 30
asynchronous: true
cache: true
}
MouseArea {
id: wpClickHandler
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton
hoverEnabled: true
onClicked: {
Config.wallpaper = wallTile.modelData.filePath;
}
}
}
}
FolderListModel {
id: wallpaperList
folder: Config.wallDir
nameFilters: ["*.png"]
}
}
}
}

View file

@ -0,0 +1,27 @@
import Quickshell.Wayland
import Quickshell
import QtQuick
import qs.settings
Variants {
model: Quickshell.screens
delegate: WlrLayershell {
id: root
layer: WlrLayer.Background
required property ShellScreen modelData
screen: modelData
exclusionMode: ExclusionMode.Ignore
anchors {
top: true
bottom: true
left: true
right: true
}
Image {
cache: false
anchors.fill: parent
source: Config.wallpaper
}
}
}