initial commit
This commit is contained in:
commit
d0900383e3
7 changed files with 137 additions and 0 deletions
22
modules/bar/ActiveWindow.qml
Normal file
22
modules/bar/ActiveWindow.qml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import Quickshell.Widgets
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick
|
||||
import qs
|
||||
import qs.widgets
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
id: root
|
||||
clip: true
|
||||
color: Colors.base01
|
||||
required property int barHeight
|
||||
readonly property double vertMargin: barHeight / 4 - 4
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
child: StyledText {
|
||||
text: Hyprland.activeToplevel?.title ?? "Desktop"
|
||||
width: Math.min(implicitWidth, 50)
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
38
modules/bar/Bar.qml
Normal file
38
modules/bar/Bar.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
|
||||
import qs
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
delegate: PanelWindow {
|
||||
id: root
|
||||
required property var modelData
|
||||
screen: modelData
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
implicitHeight: 30
|
||||
color: Colors.base00
|
||||
RowLayout {
|
||||
id: leftLayout
|
||||
spacing: 5
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: 10
|
||||
Ws {
|
||||
barScreen: root.modelData
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
ActiveWindow {
|
||||
barHeight: root.implicitHeight
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
id: rightLayout
|
||||
}
|
||||
}
|
||||
}
|
||||
36
modules/bar/Ws.qml
Normal file
36
modules/bar/Ws.qml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property int barHeight
|
||||
readonly property double vertMargin: barHeight / 4 - 4
|
||||
color: Colors.base01
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
RowLayout {
|
||||
Repeater {
|
||||
id: wsRepeater
|
||||
model: Hyprland.workspaces
|
||||
delegate: WrapperRectangle {
|
||||
id: wsWrapper
|
||||
color: 'transparent'
|
||||
visible: modelData.monitor == Hyprland.monitorFor(root.barScreen)
|
||||
required property var modelData
|
||||
child: StyledText {
|
||||
text: wsWrapper.modelData.id
|
||||
opacity: wsWrapper.modelData.active ? 1.0 : 0.6
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue