v0.20.2: the cancel button stops flying around
The status bar's transfer widgets are permanent widgets: Qt lays them out left to right but justifies the group right, so whichever is added last owns the corner and never moves, and everything before it slides whenever the group's total width changes. The label carries the song title of the moment, so it changed width on nearly every track — dragging the ✕ across the bar, which is the one widget you're aiming at. So the ✕ is added last instead of first. It sits in the corner, the label absorbs the movement, and the progress bar stops jittering too. Hovering still expands it to "cancel transfer" and pushes the row left, which is the one shift trav asked to keep. Claude-Session: https://claude.ai/code/session_01SKXUgsBBwe3qaHEjeV8ubP
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"""LinTunes — iTunes-style music library manager and player for Linux."""
|
||||
|
||||
__version__ = "0.20.1"
|
||||
__version__ = "0.20.2"
|
||||
|
||||
@@ -50,8 +50,9 @@ def album_tracks(library, artist: str, album: str) -> list:
|
||||
|
||||
|
||||
class _CancelSyncButton(QPushButton):
|
||||
"""Compact "✕" beside the sync progress bar that expands to say what it
|
||||
does ("cancel transfer") while hovered, then shrinks back."""
|
||||
"""Compact "✕" in the status bar's right corner that expands to say what
|
||||
it does ("cancel transfer") while hovered, then shrinks back. Expanding
|
||||
pushes the progress bar and label left; the button itself stays put."""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@@ -149,10 +150,10 @@ class MainWindow(QMainWindow):
|
||||
# status bar's right and survive showMessage. No stretch (see above)
|
||||
# and hidden while idle so it costs no space. Text lives in its own
|
||||
# label — QProgressBar's overlay can't fit a sentence at this width.
|
||||
self._sync_cancel = _CancelSyncButton()
|
||||
self._sync_cancel.hide()
|
||||
self._sync_cancel.clicked.connect(self._confirm_cancel_sync)
|
||||
self.statusBar().addPermanentWidget(self._sync_cancel)
|
||||
# The group is laid out left to right but justified right, so whatever
|
||||
# is added *last* owns the corner and never moves. The cancel button
|
||||
# goes there deliberately: it is the one widget the user aims at, and
|
||||
# the label beside it is as wide as the song title of the moment.
|
||||
self._sync_label = QLabel()
|
||||
self._sync_label.hide()
|
||||
self.statusBar().addPermanentWidget(self._sync_label)
|
||||
@@ -161,6 +162,10 @@ class MainWindow(QMainWindow):
|
||||
self._sync_progress.setTextVisible(False)
|
||||
self._sync_progress.hide()
|
||||
self.statusBar().addPermanentWidget(self._sync_progress)
|
||||
self._sync_cancel = _CancelSyncButton()
|
||||
self._sync_cancel.hide()
|
||||
self._sync_cancel.clicked.connect(self._confirm_cancel_sync)
|
||||
self.statusBar().addPermanentWidget(self._sync_cancel)
|
||||
self._andtunes_worker = None
|
||||
self._install_worker = None
|
||||
self._sync_device_name = ""
|
||||
|
||||
Reference in New Issue
Block a user