Krolyxon
Commit fb9b856

Branches

Refs →

aurora.configquickshellauroraSetWindows.qml

114 lines · 6.8 KB · QML

1import QtQuick
2import QtQuick.Layouts
3
4// Settings app > Windows: Hyprland look + layout + fullscreen behaviour, through HyprConf (live + persisted).
5Flickable {
6 id: flick
7 clip: true
8 contentWidth: width
9 contentHeight: col.implicitHeight
10 boundsBehavior: Flickable.StopAtBounds
11
12 Component.onCompleted: HyprConf.refresh()
13 // current value, or d while getoption hasn't answered yet
14 function v(o, d) { var x = HyprConf.values[o]; return x === undefined ? d : x }
15
16 ColumnLayout {
17 id: col
18 width: flick.width
19 spacing: 8
20
21 Text {
22 Layout.fillWidth: true
23 visible: HyprConf.message !== ""
24 text: HyprConf.message
25 color: Theme.err
26 wrapMode: Text.WordWrap
27 font.family: Theme.font
28 font.pixelSize: Theme.fontSize - 1
29 }
30
31 SectionLabel { text: "gaps & borders" }
32 Knob { label: "inner gaps"; unit: "px"; from: 0; to: 30; value: flick.v("general:gaps_in", 0); onMoved: x => HyprConf.set("general:gaps_in", x) }
33 Knob { label: "outer gaps"; unit: "px"; from: 0; to: 40; value: flick.v("general:gaps_out", 0); onMoved: x => HyprConf.set("general:gaps_out", x) }
34 Knob { label: "border"; unit: "px"; from: 0; to: 8; value: flick.v("general:border_size", 0); onMoved: x => HyprConf.set("general:border_size", x) }
35 Knob { label: "rounding"; unit: "px"; from: 0; to: 20; value: flick.v("decoration:rounding", 0); onMoved: x => HyprConf.set("decoration:rounding", x) }
36 Switch { label: "resize on border"; hint: "drag window edges to resize"; checked: flick.v("general:resize_on_border", false); onToggled: on => HyprConf.set("general:resize_on_border", on) }
37
38 SectionLabel { text: "opacity" }
39 Knob { label: "focused"; from: 0.3; to: 1; decimals: 2; value: flick.v("decoration:active_opacity", 1); onMoved: x => HyprConf.set("decoration:active_opacity", x) }
40 Knob { label: "unfocused"; from: 0.3; to: 1; decimals: 2; value: flick.v("decoration:inactive_opacity", 1); onMoved: x => HyprConf.set("decoration:inactive_opacity", x) }
41 Switch { label: "dim unfocused"; checked: flick.v("decoration:dim_inactive", false); onToggled: on => HyprConf.set("decoration:dim_inactive", on) }
42
43 SectionLabel { text: "effects" }
44 Switch { label: "blur"; hint: "behind transparent windows and layers"; checked: flick.v("decoration:blur:enabled", false); onToggled: on => HyprConf.set("decoration:blur:enabled", on) }
45 Knob { label: "blur size"; from: 1; to: 15; value: flick.v("decoration:blur:size", 1); onMoved: x => HyprConf.set("decoration:blur:size", x) }
46 Knob { label: "blur passes"; from: 1; to: 6; value: flick.v("decoration:blur:passes", 1); onMoved: x => HyprConf.set("decoration:blur:passes", x) }
47 Switch { label: "blur x-ray"; hint: "floating windows blur the wallpaper, not what's under them"; checked: flick.v("decoration:blur:xray", false); onToggled: on => HyprConf.set("decoration:blur:xray", on) }
48 Switch { label: "shadows"; checked: flick.v("decoration:shadow:enabled", false); onToggled: on => HyprConf.set("decoration:shadow:enabled", on) }
49 Switch { label: "animations"; checked: flick.v("animations:enabled", false); onToggled: on => HyprConf.set("animations:enabled", on) }
50
51 SectionLabel { text: "layout" }
52 Choice {
53 label: "tiling layout"
54 options: [{ value: "master", label: "master" }, { value: "dwindle", label: "dwindle" }]
55 value: flick.v("general:layout", "")
56 onPicked: x => HyprConf.set("general:layout", x)
57 }
58 ColumnLayout {
59 Layout.fillWidth: true
60 visible: flick.v("general:layout", "") === "master"
61 spacing: 8
62 Knob { label: "master width"; from: 0.1; to: 0.9; decimals: 2; value: flick.v("master:mfact", 0.55); onMoved: x => HyprConf.set("master:mfact", x) }
63 Choice {
64 label: "new window"
65 options: [{ value: "master", label: "master" }, { value: "slave", label: "stack" }, { value: "inherit", label: "inherit" }]
66 value: flick.v("master:new_status", "")
67 onPicked: x => HyprConf.set("master:new_status", x)
68 }
69 Choice {
70 label: "master side"
71 options: [{ value: "left", label: "left" }, { value: "right", label: "right" }, { value: "top", label: "top" },
72 { value: "bottom", label: "bottom" }, { value: "center", label: "center" }]
73 value: flick.v("master:orientation", "")
74 onPicked: x => HyprConf.set("master:orientation", x)
75 }
76 Switch { label: "new windows on top of the stack"; checked: flick.v("master:new_on_top", false); onToggled: on => HyprConf.set("master:new_on_top", on) }
77 }
78 ColumnLayout {
79 Layout.fillWidth: true
80 visible: flick.v("general:layout", "") === "dwindle"
81 spacing: 8
82 Switch { label: "preserve split"; hint: "keep the split direction when windows move"; checked: flick.v("dwindle:preserve_split", false); onToggled: on => HyprConf.set("dwindle:preserve_split", on) }
83 Switch { label: "smart split"; hint: "split by where the cursor is"; checked: flick.v("dwindle:smart_split", false); onToggled: on => HyprConf.set("dwindle:smart_split", on) }
84 }
85
86 SectionLabel { text: "fullscreen & focus" }
87 Choice {
88 label: "focus under fullscreen"
89 options: [{ value: 0, label: "ignore" }, { value: 1, label: "take over" }, { value: 2, label: "exit fullscreen" }]
90 value: flick.v("misc:on_focus_under_fullscreen", -1)
91 onPicked: x => HyprConf.set("misc:on_focus_under_fullscreen", x)
92 }
93 Switch { label: "closing keeps fullscreen"; hint: "the next window takes over when the fullscreen one closes (dwm monocle)"; checked: flick.v("misc:exit_window_retains_fullscreen", false); onToggled: on => HyprConf.set("misc:exit_window_retains_fullscreen", on) }
94 Switch { label: "focus on activate"; hint: "apps asking for attention get focused"; checked: flick.v("misc:focus_on_activate", false); onToggled: on => HyprConf.set("misc:focus_on_activate", on) }
95
96 Item { Layout.preferredHeight: 6 }
97 RowLayout {
98 Layout.fillWidth: true
99 Text {
100 Layout.fillWidth: true
101 text: "saved to ~/.config/aurora/hypr.lua (loaded last by hyprland.lua)"
102 elide: Text.ElideLeft
103 color: Theme.dim
104 font.family: Theme.font
105 font.pixelSize: Theme.fontSize - 2
106 }
107 IconBtn {
108 icon: Theme.iRefresh
109 label: "reset to config"
110 onClicked: HyprConf.resetAll(["general:", "decoration:", "animations:", "master:", "dwindle:", "misc:"])
111 }
112 }
113 }
114}