Toolbar icons render at inconsistent sizes across platforms (emoji glyphs instead of QIcon)

Aperta
#735 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
desktop-dev

Direzione di ricerca

Start with the toolbar QAction definitions in mainwindow.py, which prefix Unicode symbols onto action text, and with the existing SVG helpers _get_ui_icon_svg() and _svg_to_pixmap() in icon_provider.py. Check how the icons/ui/ override lookup works before adding new bundled SVGs for refresh, filter, columns, send-to-gps, trip, home, maximize, pop-out and settings. Done means each action uses a QIcon, the toolbar sets an explicit icon size, and the icons render at the same size on each platform. Note the scope is deferred until after v1.17.0 ships, so confirm with maintainers before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: UI improvement
Current State

Current State

Reported by Mike Wood on macOS (v1.17.0-beta.11): toolbar icons vary wildly in visible size. The Filter magnifying glass and Send to GPS icon are large and clearly visible, while Refresh, Columns, Home, Maximize map, Pop-out map, and Settings are tiny — the Settings gear in particular is so small at the far right of the toolbar it's hard to identify what it even is.

Root cause: none of the toolbar actions use a real QIcon. They're built by prefixing a Unicode symbol directly onto the action's text string, e.g. in mainwindow.py:

refresh_act = QAction(f"⟳ {tr('toolbar_refresh')}", self)
self._act_filter = QAction(f"🔍 {tr('toolbar_filter')}", self)
self._act_columns = QAction(f"▦ {tr('toolbar_columns')}", self)
gps_act = QAction(f"📤 {tr('gps_dialog_title')}", self)
trip_act = QAction(f"🗺️ {tr('toolbar_trip')}", self)
home_act = QAction("⌂", self)
self._act_tb_maximize_map = QAction("⛶", self)
self._act_tb_popout_map = QAction("⧉", self)
settings_act = QAction("⚙", self)

No tb.setIconSize(...) is set anywhere either. Some of these code points (🔍, 📤, 🗺️) have "emoji presentation" by default in Unicode, so they get rendered by the OS's color emoji font (e.g. Apple Color Emoji) at a large, fixed glyph size. Others (⟳, ▦, ⌂, ⛶, ⧉, ⚙) lack default emoji presentation and fall back to being drawn as plain text glyphs in the UI font, at normal text size — hence the size mismatch Mike is seeing. This is also inherently platform-fragile: the fallback glyph for a given symbol depends on whichever font the OS substitutes it from, so appearance (and even availability) can differ again on Windows and Linux.

Proposed Improvement

Proposed Solution

Replace the emoji-in-text approach with real QIcon objects, using the SVG infrastructure already established in icon_provider.py for the Corrected coordinates / Premium / Favorite points / Trackable icons (_get_ui_icon_svg() + _svg_to_pixmap() + QIcon(...), with optional user override via icons/ui/.svg). Add a small set of new bundled SVGs for: refresh, filter, columns, send-to-gps, trip-planner, home, maximize-map, pop-out-map, settings.

Each QAction gets .setIcon(...) instead of a prefixed symbol character, and the toolbar gets an explicit tb.setIconSize(QSize(20, 20)) (or similar) so every icon renders at the exact same pixel size on Linux, Windows, and macOS regardless of system font/emoji rendering.

Expected Benefits

Expected Benefits
Consistent, predictable icon size across all three OSes.
Icons no longer depend on OS emoji-font/glyph-fallback behavior.
Better foundation for #654 (icon-only toolbar mode) — that mode leans entirely on icons being clear and uniform once the text labels are hidden.
Scope note

Deferred until after the v1.17.0 stable release ships — this is a visual consistency improvement, not a functional bug, and beta work resumes with the normal one-issue-at-a-time workflow afterwards.

Lingua principale
Python
Stelle
37
Fork
17
Merge medio
16h 7m
PR unite (30g)
128

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenSAK-Org/OpenSAK

Tutte le issue di OpenSAK-Org/OpenSAK

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.