Compare commits

..

3 Commits

Author SHA1 Message Date
di1ara 1376b4667e improve UI zoom UX 2026-03-05 12:56:35 -05:00
wygud 62982a41fc 🟢 .gitignore
🛠️ piker/ui/_axes.py -> Enhance axis font and size handling
🛠️ piker/ui/_window.py -> Improve zoom key detection and event handling
🛠️ piker/ui/_window.py -> Update axes fonts and layout after zoom events
2026-03-03 16:16:25 -05:00
wygud 78531cd573 🔴 No files deleted.
🟢 a/piker/ui/_exec.py for adding global keyboard shortcuts for UI zoom.

🛠️ a/piker/ui/_forms.py -> Added methods to update fonts and sizes dynamically.

🛠️ a/piker/ui/_label.py -> Added method to update font and color after zoom.

🛠️ a/piker/ui/_position.py -> Included update_fonts method for labels and bars.

🛠️ a/piker/ui/_search.py -> Added update_fonts method for search view components.

🛠️ a/piker/ui/_style.py -> Enhanced configure_to_dpi() to support zoom level multipliers.

🛠️ a/piker/ui/_window.py -> Implemented application-wide zoom with event filter and zoom methods, including signals to update UI elements' font sizes and styles.

🔴 No files deleted.
2026-03-03 16:16:16 -05:00
3 changed files with 14 additions and 5 deletions

1
.gitignore vendored
View File

@ -103,3 +103,4 @@ ENV/
# mypy
.mypy_cache/
.vscode/settings.json
**/.DS_Store

View File

@ -179,6 +179,7 @@ class CompleterView(QTreeView):
self.set_font_size(_font.px_size)
self.setIndentation(_font.px_size)
self.setFont(_font.font)
# tell Qt our size hint changed so it recalculates layout
self.updateGeometry()
def resize_to_results(
@ -658,6 +659,7 @@ class SearchWidget(QtWidgets.QWidget):
if hasattr(self.view, 'update_fonts'):
self.view.update_fonts()
# tell Qt our size hint changed so it recalculates layout
self.updateGeometry()
def focus(self) -> None:

View File

@ -191,11 +191,17 @@ class DpiAwareFont:
# apply zoom level multiplier
font_size = int(font_size * zoom_level)
log.debug(
f"screen:{screen.name()}\n"
f"pDPI: {pdpi}, lDPI: {ldpi}, scale: {scale}\n"
f"zoom_level: {zoom_level}\n"
f"\nOur best guess font size is {font_size}\n"
ftype: str = f'{type(self)!r}'
log.info(
f'screen: {screen.name()}\n'
f'pDPI: {pdpi!r}\n'
f'lDPI: {ldpi!r}\n'
f'scale: {scale!r}\n'
f'{ftype}._font_inches={self._font_inches!r}\n'
f'zoom_level: {zoom_level!r}\n'
f'\n'
f"Our best guess for an auto-font-size is,\n"
f'font_size: {font_size!r}\n'
)
# apply the size
self._set_qfont_px_size(font_size)