Compare commits
3 Commits
3ed0bb20f2
...
96d734d067
| Author | SHA1 | Date | |
|---|---|---|---|
| 96d734d067 | |||
| 9bbc4b1340 | |||
| fa06a778b7 |
82
Bar/Time.qml
82
Bar/Time.qml
@@ -91,12 +91,20 @@ Container {
|
||||
]
|
||||
|
||||
onHoveredChanged: {
|
||||
if (root.hovered == true && MprisManager.getPlaying() == true) {
|
||||
root.overriden = true;
|
||||
root.mpris = true;
|
||||
} else {
|
||||
root.overriden = false;
|
||||
root.mpris = true;
|
||||
if (root.hovered == true) {
|
||||
if (root.logout == false) {
|
||||
if (MprisManager.getPlaying() == true) {
|
||||
root.overriden = true;
|
||||
root.mpris = true;
|
||||
}
|
||||
}
|
||||
} else { // Hovered == false
|
||||
if (root.logout == true) {
|
||||
IpcManager.closeLogoutMenu();
|
||||
} else {
|
||||
root.overriden = false;
|
||||
root.mpris = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +115,11 @@ Container {
|
||||
}
|
||||
|
||||
function onLogoutMenu() {
|
||||
root.overriden = false;
|
||||
root.mpris = false;
|
||||
mprisTimer.stop();
|
||||
root.notified = false;
|
||||
notificationTimer.stop();
|
||||
if (root.monitor.focused == true) {
|
||||
root.overriden = true;
|
||||
root.logout = true;
|
||||
@@ -132,9 +145,11 @@ Container {
|
||||
|
||||
Connections {
|
||||
function onTrackChanged() {
|
||||
root.overriden = true;
|
||||
root.mpris = true;
|
||||
console.log("track changed");
|
||||
if (root.overriden != true) {
|
||||
root.overriden = true;
|
||||
root.mpris = true;
|
||||
console.log("track changed");
|
||||
}
|
||||
}
|
||||
|
||||
target: MprisManager.defaultPlayer
|
||||
@@ -241,24 +256,59 @@ Container {
|
||||
Item {
|
||||
id: logoutButtonRoot
|
||||
|
||||
// Key yen isn't on my keyboard, acts as an errorless analog for no bind
|
||||
required property var modelData
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
HoverHandler {
|
||||
id: logoutHoverHandler
|
||||
|
||||
onHoveredChanged: {
|
||||
if (logoutHoverHandler.hovered == true) {
|
||||
buttonBackground.color = Colors.surface1;
|
||||
logoutButtonText.color = logoutButtonRoot.modelData.color;
|
||||
} else {
|
||||
buttonBackground.color = logoutButtonRoot.modelData.color;
|
||||
logoutButtonText.color = Colors.base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
onTapped: {
|
||||
Quickshell.execDetached(logoutButtonRoot.modelData.command);
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: buttonBackground
|
||||
|
||||
anchors.fill: parent
|
||||
color: logoutButtonRoot.modelData.color
|
||||
radius: 7
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
id: logoutButtonText
|
||||
|
||||
anchors.fill: parent
|
||||
fontSize: 25
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
propo: true
|
||||
text: logoutButtonRoot.modelData.text
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -367,6 +417,18 @@ Container {
|
||||
return fullHeight - (fullMargin * 2);
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onTapped: MprisManager.skip()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onTapped: MprisManager.prev()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: Colors.surface1
|
||||
radius: 9
|
||||
|
||||
Reference in New Issue
Block a user