Configurable slideshow monitor in Settings > General
Dropdown lists all monitors. Default: same as app window. Select a specific monitor to always open slideshow there.
This commit is contained in:
parent
385acc2a0a
commit
08c961ba80
@ -1111,7 +1111,8 @@ class BooruApp(QMainWindow):
|
||||
from .preview import FullscreenPreview
|
||||
cols = self._grid._flow.columns
|
||||
show_actions = self._stack.currentIndex() != 2
|
||||
self._fullscreen_window = FullscreenPreview(grid_cols=cols, show_actions=show_actions, parent=self)
|
||||
monitor = self._db.get_setting("slideshow_monitor")
|
||||
self._fullscreen_window = FullscreenPreview(grid_cols=cols, show_actions=show_actions, monitor=monitor, parent=self)
|
||||
self._fullscreen_window.navigate.connect(self._navigate_fullscreen)
|
||||
if show_actions:
|
||||
self._fullscreen_window.bookmark_requested.connect(self._bookmark_from_preview)
|
||||
|
||||
@ -30,7 +30,7 @@ class FullscreenPreview(QMainWindow):
|
||||
save_toggle_requested = Signal() # save or unsave depending on state
|
||||
closed = Signal()
|
||||
|
||||
def __init__(self, grid_cols: int = 3, show_actions: bool = True, parent=None) -> None:
|
||||
def __init__(self, grid_cols: int = 3, show_actions: bool = True, monitor: str = "", parent=None) -> None:
|
||||
super().__init__(parent, Qt.WindowType.Window)
|
||||
self.setWindowTitle("booru-viewer — Fullscreen")
|
||||
self.setMinimumSize(640, 480)
|
||||
@ -84,10 +84,19 @@ class FullscreenPreview(QMainWindow):
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
QApplication.instance().installEventFilter(self)
|
||||
# Show on the same monitor as the parent window
|
||||
if parent and parent.screen():
|
||||
self.setScreen(parent.screen())
|
||||
self.setGeometry(parent.screen().geometry())
|
||||
# Pick target monitor
|
||||
target_screen = None
|
||||
if monitor and monitor != "Same as app":
|
||||
for screen in QApplication.screens():
|
||||
label = f"{screen.name()} ({screen.size().width()}x{screen.size().height()})"
|
||||
if label == monitor:
|
||||
target_screen = screen
|
||||
break
|
||||
if not target_screen and parent and parent.screen():
|
||||
target_screen = parent.screen()
|
||||
if target_screen:
|
||||
self.setScreen(target_screen)
|
||||
self.setGeometry(target_screen.geometry())
|
||||
self.showFullScreen()
|
||||
|
||||
def update_state(self, bookmarked: bool, saved: bool) -> None:
|
||||
|
||||
@ -115,6 +115,19 @@ class SettingsDialog(QDialog):
|
||||
self._prefetch.setChecked(self._db.get_setting_bool("prefetch_adjacent"))
|
||||
form.addRow("", self._prefetch)
|
||||
|
||||
# Slideshow monitor
|
||||
from PySide6.QtWidgets import QApplication
|
||||
self._monitor_combo = QComboBox()
|
||||
self._monitor_combo.addItem("Same as app")
|
||||
for i, screen in enumerate(QApplication.screens()):
|
||||
self._monitor_combo.addItem(f"{screen.name()} ({screen.size().width()}x{screen.size().height()})")
|
||||
current_monitor = self._db.get_setting("slideshow_monitor")
|
||||
if current_monitor:
|
||||
idx = self._monitor_combo.findText(current_monitor)
|
||||
if idx >= 0:
|
||||
self._monitor_combo.setCurrentIndex(idx)
|
||||
form.addRow("Slideshow monitor:", self._monitor_combo)
|
||||
|
||||
# File dialog platform (Linux only)
|
||||
self._file_dialog_combo = None
|
||||
if not IS_WINDOWS:
|
||||
@ -664,6 +677,7 @@ class SettingsDialog(QDialog):
|
||||
self._db.set_setting("default_score", str(self._default_score.value()))
|
||||
self._db.set_setting("preload_thumbnails", "1" if self._preload.isChecked() else "0")
|
||||
self._db.set_setting("prefetch_adjacent", "1" if self._prefetch.isChecked() else "0")
|
||||
self._db.set_setting("slideshow_monitor", self._monitor_combo.currentText())
|
||||
self._db.set_setting("library_dir", self._library_dir.text().strip())
|
||||
self._db.set_setting("max_cache_mb", str(self._max_cache.value()))
|
||||
self._db.set_setting("auto_evict", "1" if self._auto_evict.isChecked() else "0")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user