Bookmarks/library/preview toolbars: compact button padding, 4px splitter pad, uniform 30px row height; library drops unreachable set_missing call
This commit is contained in:
parent
3824d382c3
commit
6d68652e61
@ -52,8 +52,20 @@ class BookmarksView(QWidget):
|
||||
layout = QVBoxLayout(self)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
# Top bar: folder selector + search
|
||||
# Top bar: folder selector + search.
|
||||
# 4px right margin so the rightmost button doesn't sit flush
|
||||
# against the preview splitter handle.
|
||||
top = QHBoxLayout()
|
||||
top.setContentsMargins(0, 0, 4, 0)
|
||||
|
||||
# Compact button padding matches the rest of the app's narrow
|
||||
# toolbar buttons (search bar score field, settings spinbox +/-,
|
||||
# preview toolbar). The bundled themes' default `padding: 5px 12px`
|
||||
# is too wide for short labels in fixed-width slots.
|
||||
# min-height 22px gives a total height of 30px (22 + 3+3 padding +
|
||||
# 1+1 border), matching the inputs/combos in the same row so the
|
||||
# whole toolbar lines up at one consistent height.
|
||||
_btn_style = "padding: 3px 6px; min-height: 22px;"
|
||||
|
||||
self._folder_combo = QComboBox()
|
||||
self._folder_combo.setMinimumWidth(120)
|
||||
@ -62,7 +74,8 @@ class BookmarksView(QWidget):
|
||||
|
||||
manage_btn = QPushButton("+ Folder")
|
||||
manage_btn.setToolTip("New folder")
|
||||
manage_btn.setFixedWidth(65)
|
||||
manage_btn.setFixedWidth(75)
|
||||
manage_btn.setStyleSheet(_btn_style)
|
||||
manage_btn.clicked.connect(self._new_folder)
|
||||
top.addWidget(manage_btn)
|
||||
|
||||
@ -72,11 +85,10 @@ class BookmarksView(QWidget):
|
||||
top.addWidget(self._search_input, stretch=1)
|
||||
|
||||
search_btn = QPushButton("Search")
|
||||
search_btn.setStyleSheet(_btn_style)
|
||||
search_btn.clicked.connect(self._do_search)
|
||||
top.addWidget(search_btn)
|
||||
|
||||
top.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
layout.addLayout(top)
|
||||
|
||||
# Count label
|
||||
|
||||
@ -58,8 +58,18 @@ class LibraryView(QWidget):
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
# --- Top bar ---
|
||||
# 4px right margin so the rightmost widget doesn't sit flush
|
||||
# against the preview splitter handle.
|
||||
top = QHBoxLayout()
|
||||
top.setContentsMargins(0, 0, 0, 0)
|
||||
top.setContentsMargins(0, 0, 4, 0)
|
||||
|
||||
# Compact button padding matches the rest of the app's narrow
|
||||
# toolbar buttons. Bundled themes' default `padding: 5px 12px`
|
||||
# is too wide for short labels in fixed-width slots.
|
||||
# min-height 22px gives a total height of 30px (22 + 3+3 padding +
|
||||
# 1+1 border), matching the inputs/combos in the same row so the
|
||||
# whole toolbar lines up at one consistent height.
|
||||
_btn_style = "padding: 3px 6px; min-height: 22px;"
|
||||
|
||||
self._folder_combo = QComboBox()
|
||||
self._folder_combo.setMinimumWidth(140)
|
||||
@ -73,7 +83,8 @@ class LibraryView(QWidget):
|
||||
top.addWidget(self._sort_combo)
|
||||
|
||||
refresh_btn = QPushButton("Refresh")
|
||||
refresh_btn.setFixedWidth(65)
|
||||
refresh_btn.setFixedWidth(75)
|
||||
refresh_btn.setStyleSheet(_btn_style)
|
||||
refresh_btn.clicked.connect(self.refresh)
|
||||
top.addWidget(refresh_btn)
|
||||
|
||||
@ -136,9 +147,6 @@ class LibraryView(QWidget):
|
||||
for i, (filepath, thumb) in enumerate(zip(self._files, thumbs)):
|
||||
thumb._cached_path = str(filepath)
|
||||
thumb.setToolTip(filepath.name)
|
||||
if not filepath.exists():
|
||||
thumb.set_missing(True)
|
||||
continue
|
||||
thumb.set_saved_locally(True)
|
||||
cached_thumb = lib_thumb_dir / f"{filepath.stem}.jpg"
|
||||
if cached_thumb.exists():
|
||||
|
||||
@ -1306,10 +1306,12 @@ class ImagePreview(QWidget):
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setSpacing(0)
|
||||
|
||||
# Action toolbar — above the media, in the layout
|
||||
# Action toolbar — above the media, in the layout.
|
||||
# 4px horizontal margins so the leftmost button (Bookmark) doesn't
|
||||
# sit flush against the preview splitter handle on the left.
|
||||
self._toolbar = QWidget()
|
||||
tb = QHBoxLayout(self._toolbar)
|
||||
tb.setContentsMargins(2, 1, 2, 1)
|
||||
tb.setContentsMargins(4, 1, 4, 1)
|
||||
tb.setSpacing(4)
|
||||
|
||||
# Compact toolbar buttons. The bundled themes set
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user