some items
This commit is contained in:
@@ -8,17 +8,18 @@ import "../Color.js" as Colors
|
|||||||
import "../Components/"
|
import "../Components/"
|
||||||
import "../Services/"
|
import "../Services/"
|
||||||
import "./Center"
|
import "./Center"
|
||||||
|
import "./Left/"
|
||||||
|
|
||||||
Container {
|
Container {
|
||||||
|
id: root
|
||||||
|
|
||||||
required property HyprlandMonitor monitor
|
required property HyprlandMonitor monitor
|
||||||
|
|
||||||
boxHeight: 25
|
boxHeight: 25
|
||||||
boxWidth: 40
|
boxWidth: 40
|
||||||
exclusiveMonitor: monitor
|
exclusiveMonitor: monitor
|
||||||
|
|
||||||
Item {
|
defaultItem: WorkspaceContainer {
|
||||||
StyledText {
|
monitor: root.monitor
|
||||||
text: WorkspaceManager.getWorkspacesForMonitor(monitor)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
Bar/Left/WorkspaceContainer.qml
Normal file
29
Bar/Left/WorkspaceContainer.qml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import "../../Components/"
|
||||||
|
import "../../Services/"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property HyprlandMonitor monitor
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: WorkspaceManager.getWorkspacesForMonitor(root.monitor)
|
||||||
|
|
||||||
|
CenteredText {
|
||||||
|
text: console.log("some")
|
||||||
|
}
|
||||||
|
|
||||||
|
// WorkspaceSelector {
|
||||||
|
// required property HyprlandWorkspace modelData
|
||||||
|
//
|
||||||
|
// workspace: modelData
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Bar/Left/WorkspaceSelector.qml
Normal file
17
Bar/Left/WorkspaceSelector.qml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import "../../Components/"
|
||||||
|
import "../../Services/"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property HyprlandWorkspace workspace
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
StyledText {
|
||||||
|
text: "some"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,17 +6,32 @@ import Quickshell.Hyprland
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
function getWorkspacesForMonitor(monitor) {
|
function getAllNumberedWorkspaces() {
|
||||||
let allWorkspaces = Hyprland.workspaces;
|
let allWorkspaces = Hyprland.workspaces.values;
|
||||||
let monitorWorkspaces = [];
|
let filteredWorkspaces = [];
|
||||||
for (let workspace in allWorkspaces) {
|
for (let workspace in allWorkspaces) {
|
||||||
let currentWorkspace = allWorkspaces[workspace];
|
let currentWorkspace = allWorkspaces[workspace];
|
||||||
|
if (!currentWorkspace.name.includes("special")) {
|
||||||
|
if (currentWorkspace) {
|
||||||
|
filteredWorkspaces.push(currentWorkspace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWorkspacesForMonitor(monitor) {
|
||||||
|
let allWorkspaces = getAllNumberedWorkspaces();
|
||||||
|
let monitorWorkspaces = [];
|
||||||
|
|
||||||
|
for (let workspace in allWorkspaces) {
|
||||||
|
let currentWorkspace = allWorkspaces[workspace];
|
||||||
if (currentWorkspace.monitor == monitor) {
|
if (currentWorkspace.monitor == monitor) {
|
||||||
console.log("correct");
|
console.log(currentWorkspace.id);
|
||||||
} else {
|
if (currentWorkspace) {
|
||||||
console.log("incorrect");
|
monitorWorkspaces.push(currentWorkspace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return monitorWorkspaces;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user