Compare commits
7 Commits
91484b5edd
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 297f3fe688 | |||
| b314fe10d2 | |||
| c7f8c86fe1 | |||
| ca6b5aae78 | |||
| 4aba172b70 | |||
| bac1b196a8 | |||
| 2bc794ae69 |
8
Bar.qml
8
Bar.qml
@@ -55,6 +55,10 @@ Scope {
|
|||||||
Region {
|
Region {
|
||||||
id: maskRegion
|
id: maskRegion
|
||||||
|
|
||||||
|
Region {
|
||||||
|
item: launcher
|
||||||
|
}
|
||||||
|
|
||||||
Region {
|
Region {
|
||||||
item: left
|
item: left
|
||||||
}
|
}
|
||||||
@@ -101,6 +105,10 @@ Scope {
|
|||||||
top: parent.top
|
top: parent.top
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Launcher {
|
||||||
|
id: launcher
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: left
|
id: left
|
||||||
|
|
||||||
|
|||||||
194
Bar/Launcher.qml
Normal file
194
Bar/Launcher.qml
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
|
import "../Color.js" as Colors
|
||||||
|
|
||||||
|
import "../Components/"
|
||||||
|
import "../Services/"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property var buttons: [
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.surface1,
|
||||||
|
action: function () {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.yellow,
|
||||||
|
action: function () {
|
||||||
|
Quickshell.execDetached("nemo");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.green,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox --new-window \"https://office.voidarc.co.uk\"')");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.sky,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox --new-window \"https://teams.cloud.microsoft\"')");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.mauve,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('kitty')");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.red,
|
||||||
|
action: function () {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "",
|
||||||
|
color: Colors.peach,
|
||||||
|
action: function () {
|
||||||
|
Hyprland.dispatch("hl.dsp.exec_cmd('firefox')");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
property real cx: width / 2
|
||||||
|
property real cy: height / 2
|
||||||
|
property bool hidden: !IpcManager.launcherOpen
|
||||||
|
property real r: 120
|
||||||
|
property double topMargin: 50
|
||||||
|
|
||||||
|
implicitHeight: 300
|
||||||
|
implicitWidth: 300
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "hidden"
|
||||||
|
when: root.hidden == true
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
root.r: 0
|
||||||
|
root.topMargin: -300
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "shown"
|
||||||
|
when: root.hidden == false
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
root.r: 120
|
||||||
|
root.topMargin: 50
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
from: "hidden"
|
||||||
|
to: "shown"
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
SpringAnimation {
|
||||||
|
damping: 0.3
|
||||||
|
property: "topMargin"
|
||||||
|
spring: 5
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation {
|
||||||
|
duration: 220
|
||||||
|
}
|
||||||
|
|
||||||
|
SpringAnimation {
|
||||||
|
damping: 0.3
|
||||||
|
property: "r"
|
||||||
|
spring: 4
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Transition {
|
||||||
|
from: "shown"
|
||||||
|
to: "hidden"
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
SpringAnimation {
|
||||||
|
damping: 0.3
|
||||||
|
property: "r"
|
||||||
|
spring: 4
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation {
|
||||||
|
duration: 130
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 250
|
||||||
|
easing.type: Easing.InBack
|
||||||
|
property: "topMargin"
|
||||||
|
target: root
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
top: parent.top
|
||||||
|
topMargin: root.topMargin
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: root.buttons
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
id: itemRoot
|
||||||
|
|
||||||
|
required property int index
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
x: index === 0 ? root.cx - width / 2 : root.cx + root.r * Math.cos((index - 1) * Math.PI / 3)
|
||||||
|
- width / 2
|
||||||
|
y: index === 0 ? root.cy - height / 2 : root.cy + root.r * Math.sin((index - 1) * Math.PI / 3)
|
||||||
|
- height / 2
|
||||||
|
z: index === 0 ? 10 : 0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: itemRoot.modelData.color
|
||||||
|
implicitHeight: 80 + (itemRoot.index === 0 ? 2 : 0)
|
||||||
|
implicitWidth: 80 + (itemRoot.index === 0 ? 2 : 0)
|
||||||
|
radius: 10
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: {
|
||||||
|
itemRoot.modelData.action();
|
||||||
|
IpcManager.toggleLauncher();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
horizontalCenter: parent.horizontalCenter
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
CenteredText {
|
||||||
|
color: itemRoot.index === 0 ? Colors.text : Colors.surface0
|
||||||
|
fontSize: 32
|
||||||
|
propo: true
|
||||||
|
text: itemRoot.modelData.icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
161
Bar/Time.qml
161
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,7 +430,6 @@ Container {
|
|||||||
color: Colors.mauve
|
color: Colors.mauve
|
||||||
text: TimeManager.time
|
text: TimeManager.time
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: 3
|
spacing: 3
|
||||||
@@ -398,68 +438,27 @@ Container {
|
|||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: 3
|
bottomMargin: 3
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: 7
|
rightMargin: 4
|
||||||
top: parent.top
|
top: parent.top
|
||||||
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
|
|
||||||
bottomMargin: 3
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
TapHandler {
|
|
||||||
onTapped: {
|
|
||||||
WorkspaceManager.activateWorkspaceById("-1");
|
WorkspaceManager.activateWorkspaceById("-1");
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
StyledText {
|
text: "",
|
||||||
anchors.fill: parent
|
onTapped: function () {
|
||||||
color: Colors.mauve
|
|
||||||
fontSize: 14
|
|
||||||
fontWeight: 10
|
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
|
||||||
propo: true
|
|
||||||
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"})`);
|
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -502,7 +501,7 @@ Container {
|
|||||||
IconImage {
|
IconImage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
source: root.latestNotif.image
|
source: "file://" + root.latestNotif.appIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ Item {
|
|||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "tablet"
|
name: "tablet"
|
||||||
when: root.hovered == false && root.boxOpened == false && root.overriden == false
|
when: ( root.hovered == false || IpcManager.tabletMode == true ) && root.boxOpened == false && root.overriden == false
|
||||||
&& IpcManager.tabletMode == true
|
&& IpcManager.tabletMode == true
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
|
|||||||
@@ -9,18 +9,23 @@ 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: true
|
property bool tabletMode: false
|
||||||
|
|
||||||
signal closeLogoutMenu
|
signal closeLogoutMenu
|
||||||
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