Compare commits
3 Commits
4aba172b70
...
b314fe10d2
| Author | SHA1 | Date | |
|---|---|---|---|
| b314fe10d2 | |||
| c7f8c86fe1 | |||
| ca6b5aae78 |
5
Bar.qml
5
Bar.qml
@@ -56,8 +56,6 @@ Scope {
|
|||||||
id: maskRegion
|
id: maskRegion
|
||||||
|
|
||||||
Region {
|
Region {
|
||||||
// Setting to subtract effectively disables the region
|
|
||||||
// intersection: Intersection.Subtract
|
|
||||||
item: launcher
|
item: launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,9 +107,6 @@ Scope {
|
|||||||
|
|
||||||
Launcher {
|
Launcher {
|
||||||
id: launcher
|
id: launcher
|
||||||
|
|
||||||
// visible: false
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
import "../Color.js" as Colors
|
import "../Color.js" as Colors
|
||||||
|
|
||||||
import "../Components/"
|
import "../Components/"
|
||||||
|
import "../Services/"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@@ -12,36 +15,53 @@ Item {
|
|||||||
property var buttons: [
|
property var buttons: [
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.surface1
|
color: Colors.surface1,
|
||||||
|
action: function () {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.yellow
|
color: Colors.yellow,
|
||||||
|
action: function () {
|
||||||
|
Quickshell.execDetached("nemo");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.green
|
color: Colors.green,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox --new-window \"https://office.voidarc.co.uk\"')");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.sky
|
color: Colors.sky,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox --new-window \"https://teams.cloud.microsoft\"')");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.mauve
|
color: Colors.mauve,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('kitty')");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.red
|
color: Colors.red,
|
||||||
|
action: function () {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: "",
|
icon: "",
|
||||||
color: Colors.peach
|
color: Colors.peach,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox')");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
property real cx: width / 2
|
property real cx: width / 2
|
||||||
property real cy: height / 2
|
property real cy: height / 2
|
||||||
property bool hidden: true
|
property bool hidden: !IpcManager.launcherOpen
|
||||||
property real r: 120
|
property real r: 120
|
||||||
property double topMargin: 50
|
property double topMargin: 50
|
||||||
|
|
||||||
@@ -68,12 +88,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
// Behavior on topMargin {
|
|
||||||
// SpringAnimation {
|
|
||||||
// damping: 0.3
|
|
||||||
// spring: 5
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
from: "hidden"
|
from: "hidden"
|
||||||
@@ -156,6 +170,13 @@ Item {
|
|||||||
implicitWidth: 80 + (itemRoot.index === 0 ? 2 : 0)
|
implicitWidth: 80 + (itemRoot.index === 0 ? 2 : 0)
|
||||||
radius: 10
|
radius: 10
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: {
|
||||||
|
itemRoot.modelData.action();
|
||||||
|
IpcManager.toggleLauncher();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
|
|||||||
175
Bar/Time.qml
175
Bar/Time.qml
@@ -344,6 +344,63 @@ Container {
|
|||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
margins: 3
|
margins: 3
|
||||||
|
topMargin: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: tabletButton
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: tabletButtonRoot
|
||||||
|
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
color: Colors.overlay0
|
||||||
|
implicitWidth: 25
|
||||||
|
radius: root.boxRadius - 4
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: 60
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
bottom: parent.bottom
|
||||||
|
top: parent.top
|
||||||
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: {
|
||||||
|
tabletButtonRoot.modelData.onTapped();
|
||||||
|
tabletButtonRoot.color = Colors.text;
|
||||||
|
tapAnimationTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: tapAnimationTimer
|
||||||
|
|
||||||
|
interval: 80
|
||||||
|
repeat: false
|
||||||
|
running: false
|
||||||
|
|
||||||
|
onTriggered: {
|
||||||
|
tabletButtonRoot.color = Colors.overlay0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Colors.mauve
|
||||||
|
fontSize: 14
|
||||||
|
fontWeight: 10
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
propo: true
|
||||||
|
text: tabletButtonRoot.modelData.text
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
@@ -356,32 +413,16 @@ Container {
|
|||||||
topMargin: 3
|
topMargin: 3
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Repeater {
|
||||||
color: Colors.overlay0
|
delegate: tabletButton
|
||||||
implicitWidth: 25
|
model: [
|
||||||
radius: root.boxRadius - 4
|
{
|
||||||
|
text: "",
|
||||||
anchors {
|
onTapped: function () {
|
||||||
bottom: parent.bottom
|
IpcManager.toggleLauncher();
|
||||||
top: parent.top
|
}
|
||||||
}
|
},
|
||||||
|
]
|
||||||
TapHandler {
|
|
||||||
onTapped: {
|
|
||||||
console.log("kando");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Colors.mauve
|
|
||||||
fontSize: 14
|
|
||||||
fontWeight: 10
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
|
||||||
propo: true
|
|
||||||
text: ""
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,77 +430,35 @@ Container {
|
|||||||
color: Colors.mauve
|
color: Colors.mauve
|
||||||
text: TimeManager.time
|
text: TimeManager.time
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: 3
|
spacing: 3
|
||||||
|
|
||||||
anchors {
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: 3
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: 7
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: Colors.overlay0
|
|
||||||
implicitWidth: 25
|
|
||||||
radius: root.boxRadius - 4
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: 3
|
bottomMargin: 3
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 4
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: 3
|
topMargin: 3
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
Repeater {
|
||||||
onTapped: {
|
delegate: tabletButton
|
||||||
WorkspaceManager.activateWorkspaceById("-1");
|
model: [
|
||||||
}
|
{
|
||||||
}
|
text: "",
|
||||||
|
onTapped: function () {
|
||||||
StyledText {
|
WorkspaceManager.activateWorkspaceById("-1");
|
||||||
anchors.fill: parent
|
}
|
||||||
color: Colors.mauve
|
},
|
||||||
fontSize: 14
|
{
|
||||||
fontWeight: 10
|
text: "",
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
onTapped: function () {
|
||||||
propo: true
|
Hyprland.dispatch(`hl.dsp.focus({workspace = "+1"})`);
|
||||||
text: ""
|
}
|
||||||
verticalAlignment: Qt.AlignVCenter
|
},
|
||||||
}
|
]
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: Colors.overlay0
|
|
||||||
implicitWidth: 25
|
|
||||||
radius: root.boxRadius - 4
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: 3
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
TapHandler {
|
|
||||||
onTapped: {
|
|
||||||
Hyprland.dispatch(`hl.dsp.focus({workspace = "+1"})`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Colors.mauve
|
|
||||||
fontSize: 14
|
|
||||||
fontWeight: 10
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
|
||||||
propo: true
|
|
||||||
text: ""
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Singleton {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var focusState: WlrKeyboardFocus.None
|
property var focusState: WlrKeyboardFocus.None
|
||||||
|
property bool launcherOpen: false
|
||||||
property bool logoutMenuOpen: false
|
property bool logoutMenuOpen: false
|
||||||
property bool tabletMode: false
|
property bool tabletMode: false
|
||||||
|
|
||||||
@@ -16,11 +17,15 @@ Singleton {
|
|||||||
signal enableTabletMode
|
signal enableTabletMode
|
||||||
signal logoutMenu
|
signal logoutMenu
|
||||||
signal normalMode
|
signal normalMode
|
||||||
|
signal toggleLauncher
|
||||||
|
|
||||||
onCloseLogoutMenu: {
|
onCloseLogoutMenu: {
|
||||||
root.focusState = WlrKeyboardFocus.None;
|
root.focusState = WlrKeyboardFocus.None;
|
||||||
root.logoutMenuOpen = false;
|
root.logoutMenuOpen = false;
|
||||||
}
|
}
|
||||||
|
onToggleLauncher: {
|
||||||
|
root.launcherOpen = root.launcherOpen == true ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
function disableTabletMode(): void {
|
function disableTabletMode(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user