init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
122
modules/ui/UI.qml
Normal file
122
modules/ui/UI.qml
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
import qs.config
|
||||
import qs.custom
|
||||
import qs.modules.bar
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
Scope {
|
||||
id: scope
|
||||
required property ShellScreen modelData
|
||||
|
||||
Exclusion {
|
||||
screen: scope.modelData
|
||||
}
|
||||
|
||||
CustomWindow {
|
||||
id: window
|
||||
name: "ui"
|
||||
screen: scope.modelData
|
||||
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.bottom: true
|
||||
anchors.right: true
|
||||
|
||||
// UI State
|
||||
|
||||
UIState {
|
||||
id: uiState
|
||||
screen: scope.modelData
|
||||
}
|
||||
|
||||
// Exclusion
|
||||
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
mask: uiState.uiState.blockScreen ? exclusionBlock : exclusion
|
||||
WlrLayershell.keyboardFocus: uiState.uiState.blockScreen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||
|
||||
Region {
|
||||
id: exclusionBlock
|
||||
intersection: Intersection.Xor
|
||||
}
|
||||
|
||||
Region {
|
||||
id: exclusion
|
||||
x: Config.border.thickness
|
||||
y: Config.bar.height
|
||||
width: window.width - 2 * Config.border.thickness
|
||||
height: window.height - Config.bar.height - Config.border.thickness
|
||||
intersection: Intersection.Xor
|
||||
|
||||
regions: regions.instances
|
||||
}
|
||||
|
||||
Variants {
|
||||
id: regions
|
||||
|
||||
model: panels.children
|
||||
|
||||
Region {
|
||||
required property Item modelData
|
||||
|
||||
x: modelData.x + Config.border.thickness
|
||||
y: modelData.y + Config.bar.height
|
||||
width: modelData.width
|
||||
height: modelData.height
|
||||
intersection: Intersection.Subtract
|
||||
}
|
||||
}
|
||||
|
||||
// Visual Content
|
||||
|
||||
CustomRect {
|
||||
anchors.fill: parent
|
||||
color: Config.colors.overlay
|
||||
opacity: uiState.uiState.blockScreen ? 0.5 : 0
|
||||
visible: opacity > 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {}
|
||||
}
|
||||
}
|
||||
|
||||
GlowEffect {
|
||||
source: border
|
||||
blurMax: 25
|
||||
blurMultiplier: 0
|
||||
glowColor: Config.colors.highlight
|
||||
}
|
||||
|
||||
Interactions {
|
||||
uiState: uiState.uiState
|
||||
bar: bar
|
||||
panels: panels
|
||||
screen: scope.modelData
|
||||
|
||||
Panels {
|
||||
id: panels
|
||||
|
||||
uiState: uiState.uiState
|
||||
screen: scope.modelData
|
||||
bar: bar
|
||||
}
|
||||
}
|
||||
|
||||
Border {
|
||||
id: border
|
||||
}
|
||||
|
||||
Bar {
|
||||
id: bar
|
||||
|
||||
uiState: uiState.uiState
|
||||
screen: scope.modelData
|
||||
popouts: panels.popouts
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue