various fixes
This commit is contained in:
5 files changed
+148
-3
No files matched your search
@@ -80,6 +80,14 @@ class Controller(QObject):
|
||||
self._completing = False
|
||||
self._paused_by_lock = False
|
||||
self._mini_visible = False
|
||||
self._mini_dismissed = False
|
||||
"""Set when the ✕ on the mini timer was clicked during a running interval.
|
||||
|
||||
`app._update_mini()` would otherwise bring it straight back up through
|
||||
its "auto-show while running and the window is away" rule, making the
|
||||
close button look broken. Cleared on the next explicit show and on the
|
||||
next interval, so a dismissal only lasts for the one you closed it on.
|
||||
"""
|
||||
|
||||
# ---- system integrations -------------------------------------------
|
||||
self._notifier = Notifier()
|
||||
@@ -282,6 +290,11 @@ class Controller(QObject):
|
||||
"""Whether the floating mini timer is pinned open by the user."""
|
||||
return self._mini_visible
|
||||
|
||||
@property
|
||||
def mini_dismissed(self) -> bool:
|
||||
"""For `app._update_mini()`, not QML: see `_mini_dismissed` above."""
|
||||
return self._mini_dismissed
|
||||
|
||||
@pyqtProperty("QVariantMap", notify=configChanged)
|
||||
def config(self) -> dict[str, Any]:
|
||||
from dataclasses import asdict
|
||||
@@ -463,6 +476,7 @@ class Controller(QObject):
|
||||
@pyqtSlot()
|
||||
@pyqtSlot(bool)
|
||||
def setMiniVisible(self, visible: bool = True) -> None:
|
||||
self._mini_dismissed = not visible
|
||||
if visible == self._mini_visible:
|
||||
return
|
||||
self._mini_visible = visible
|
||||
@@ -610,6 +624,11 @@ class Controller(QObject):
|
||||
# Transitions → the system integrations
|
||||
# ======================================================================
|
||||
def _on_transition(self, previous: dict[str, Any], current: dict[str, Any]) -> None:
|
||||
if current.get("id") and current.get("id") != previous.get("id"):
|
||||
# A new interval — pause/resume of the same one must not do this —
|
||||
# gets its own chance to auto-show, even if the last one was closed.
|
||||
self._mini_dismissed = False
|
||||
|
||||
focusing = current.get("kind") == "work" and current.get("status") == "running"
|
||||
|
||||
if focusing:
|
||||
|
||||
Reference in new issue
Block a user