diff options
author | Claudio Cambra <claudio.cambra@gmail.com> | 2022-06-30 17:20:13 +0300 |
---|---|---|
committer | Claudio Cambra <claudio.cambra@gmail.com> | 2022-07-06 12:26:53 +0300 |
commit | b712eb95e2e40e2af8e9f0fa966f587a7fa58adb (patch) | |
tree | 0a0ba4e36bea459fc9758f46efa6192b184f3889 /src/gui/tray | |
parent | d6faf0a250c9974260d5a4f3e1005df3328b3d46 (diff) |
Clean up systray methods, make more QML-friendly
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Diffstat (limited to 'src/gui/tray')
-rw-r--r-- | src/gui/tray/Window.qml | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 81629711f..6419e651e 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -39,13 +39,11 @@ Window { onActiveChanged: {
if (!Systray.useNormalWindow && !active) {
hide();
- Systray.setClosed();
+ Systray.isOpen = false;
}
}
- onClosing: {
- Systray.setClosed()
- }
+ onClosing: Systray.isOpen = false
onVisibleChanged: {
// HACK: reload account Instantiator immediately by restting it - could be done better I guess
@@ -97,13 +95,13 @@ Window { trayWindow.raise();
trayWindow.requestActivate();
- Systray.setOpened();
+ Systray.isOpen = true;
UserModel.fetchCurrentActivityModel();
}
function onHideWindow() {
trayWindow.hide();
- Systray.setClosed();
+ Systray.isOpen = false;
}
function onShowFileActivityDialog(objectName, objectId) {
@@ -178,7 +176,7 @@ Window { // We call open() instead of popup() because we want to position it
// exactly below the dropdown button, not the mouse
onClicked: {
- syncPauseButton.text = Systray.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
+ syncPauseButton.text = Systray.syncIsPaused ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
if (accountMenu.visible) {
accountMenu.close()
} else {
@@ -322,7 +320,7 @@ Window { font.pixelSize: Style.topLinePixelSize
palette.windowText: Style.ncTextColor
hoverEnabled: true
- onClicked: Systray.pauseResumeSync()
+ onClicked: Systray.syncIsPaused = !Systray.syncIsPaused
background: Item {
height: parent.height
@@ -335,7 +333,7 @@ Window { }
Accessible.role: Accessible.MenuItem
- Accessible.name: Systray.syncIsPaused() ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
+ Accessible.name: Systray.syncIsPaused ? qsTr("Resume sync for all") : qsTr("Pause sync for all")
Accessible.onPressAction: syncPauseButton.clicked()
}
|