Initial commit
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import "./widgets"
|
||||
|
||||
PanelWindow {
|
||||
id: panel
|
||||
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
|
||||
implicitHeight: 40
|
||||
|
||||
exclusiveZone: height // this is so context menus don't clip into the bar
|
||||
|
||||
property HyprlandMonitor barThisMonitor: Hyprland.monitorFor(screen)
|
||||
|
||||
margins {
|
||||
top: 0
|
||||
left: 0
|
||||
right: 0
|
||||
}
|
||||
|
||||
Rectangle { // Bar
|
||||
id: bar
|
||||
anchors.fill: parent
|
||||
color: "#1a1a1a"
|
||||
radius: 0
|
||||
|
||||
Row { // bar widgets left
|
||||
id: widgetsLeft
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
spacing: 8
|
||||
|
||||
MenuButton {}
|
||||
|
||||
Workspaces {
|
||||
thisMonitor: barThisMonitor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Row { // bar widgets center
|
||||
id: widgetsCenter
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
Clock {}
|
||||
|
||||
}
|
||||
|
||||
Row { // bar widgets right
|
||||
id: widgetsRight
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 16
|
||||
spacing: 8
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
|
||||
Item {
|
||||
id: root
|
||||
Repeater { // Bars
|
||||
model: Quickshell.screens
|
||||
delegate: Loader {
|
||||
active: true // loads object
|
||||
sourceComponent: Bar {screen: modelData} // creates instance of bar component
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Text {
|
||||
id: timeDisplay
|
||||
|
||||
property string currentTime: ""
|
||||
|
||||
text: currentTime
|
||||
color: "#ffffff"
|
||||
font.pixelSize: 14
|
||||
font.family: "Inter, sans-serif"
|
||||
|
||||
//Update time every second
|
||||
Timer {
|
||||
interval: 1000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
var now = new Date()
|
||||
timeDisplay.currentTime = Qt.formatTime(now, "hh:mm:ss")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
MouseArea {
|
||||
id: archButton
|
||||
width: 30
|
||||
height: 28
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: archButton.containsMouse ? "#2a2a2a" : "transparent"
|
||||
radius: 6
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: ""
|
||||
font.pixelSize: 26
|
||||
font.family: "Nerd Font"
|
||||
color: "#ffffff"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
|
||||
Row { // Workspace Row
|
||||
id: workspacesRow
|
||||
|
||||
required property HyprlandMonitor thisMonitor
|
||||
spacing: 8
|
||||
|
||||
Repeater { // repeats workspaces
|
||||
model: Hyprland.workspaces
|
||||
|
||||
Rectangle { //workspace
|
||||
visible: modelData.monitor === thisMonitor
|
||||
width: 32
|
||||
height: 24
|
||||
radius: 4
|
||||
color: modelData.active ? "#4a93ff": "#333333"
|
||||
border.color: "#555555"
|
||||
border.width: 2
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: Hyprland.dispatch("workspace " + modelData.id)
|
||||
}
|
||||
|
||||
Text {
|
||||
text: modelData.id
|
||||
anchors.centerIn: parent
|
||||
color: modelData.active ? "#ffffff" : "#cccccc"
|
||||
font.pixelSize: 12
|
||||
font.family: "Inter, sans-serif"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
visible: Hyprland.workspaces.length === 0
|
||||
text: "No Workspaces"
|
||||
color: "#ffffff"
|
||||
font.pixelSize: 12
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user