Repository navigation
Conversation
Open, Start, Stop, Refresh and Exit each show a pictogram, the UI's own for the same thing (Start.svg, Stop.svg, Refresh.svg, the logo for Open) plus an Exit drawn after lbm-ui's Icon::Power, the UI having none. Linux: DBusMenu's icon-name with the Icon Naming Spec names (media-playback-start, media-playback-stop, view-refresh, application-exit), so the entries follow KDE's light or dark theme; the UI's pictograms are black where they mean "the foreground" and would vanish in a dark menu. Open carries the logo as icon-data (PNG), readable on both. Windows: an item bitmap per entry (MENUITEMINFO.hbmpItem), a 32-bit DIB premultiplied by its alpha, at the small-icon size of the moment (SM_CXSMICON), made when the menu opens and freed once it is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgth
left a comment
There was a problem hiding this comment.
Les 23 tests ciblés des icônes et du menu passent sous Linux. Il reste un cas Windows à corriger pour les configurations où les écrans ont des facteurs d’échelle différents.
| fn menu(window: HWND) { | ||
| // SAFETY: a popup menu owned here, destroyed below. | ||
| // SAFETY: a metrics query. | ||
| let size = unsafe { GetSystemMetrics(SM_CXSMICON) }.max(16) as u32; |
There was a problem hiding this comment.
Dimensionner les pictogrammes pour l’écran qui affiche le menu. L’agent est déclaré compatible DPI par moniteur, mais GetSystemMetrics(SM_CXSMICON) renvoie une métrique système. Si l’écran principal est à 100 % et que le menu s’ouvre sur un écran à 200 %, le code peut choisir le bitmap de 16 px pour un emplacement de 32 px. Récupérer la position utilisée par TrackPopupMenu avant de créer les bitmaps, puis appeler GetSystemMetricsForDpi avec le DPI de l’écran correspondant permettrait de choisir la bonne taille à chaque ouverture. Documentation Win32
There was a problem hiding this comment.
Recontrôlé sur 888ad02b. Le menu choisit toujours la taille du bitmap avec GetSystemMetrics(SM_CXSMICON) avant de lire la position du curseur. Le correctif pour les écrans à échelles différentes reste attendu.
The maintainer asked: « ajouter des icônes au menu clique droit dans la zone de notif ».
What each entry shows
icon-data: the logo (lbm_logo.svg, 32 px PNG)icon-namemedia-playback-startStart.svgicon-namemedia-playback-stopStop.svgicon-nameview-refreshRefresh.svgicon-nameapplication-exiticons/menu/Exit.svg, drawn after lbm-ui'sIcon::Power(the UI had no exit pictogram)MENUITEMINFOW.hbmpItem, a 32-bit top-down DIB with the colours premultiplied by alpha (whatAlphaBlendreads in a themed menu), at theSM_CXSMICONsize of the moment (PNGs at 16/20/24/32/40/48 px, the next size up). The bitmaps are made when the menu opens and freed afterDestroyMenu: a menu does not own its items' bitmaps, and the DPI may have changed since the last opening. The menu is the light Win32 one (the agent does not opt into dark menus), hence the black pictograms there.icons/render.sh(extended), like the tray icons.Tests
icons: every menu icon decoded at every size, the colours match the UI's pictograms, the theme names table,at_least(size choice),premultiplied_bgra(byte order, rounding, never a colour above its alpha).tray: one icon per entry; the Linux menu carries the theme names and the logo's PNG.tray::windows: every menu icon makes a DIB and it is freed (runs in the Windows CI job).cargo clippy --workspace --all-targets -D warningsclean on Linux andx86_64-pc-windows-gnu;cargo fmt --checkclean.Seen
--fake-hook, its ownXDG_RUNTIME_DIR, config and data) published the menu.GetLayoutover D-Bus shows the names and the PNG, and a real right-click displayed the five icons: Breeze's icons in white, the logo in colour.C:\LittleBigMouse\v6; the menu opened by the message a right-click on the icon sends (WM_APP+1,WM_RBUTTONUP) and captured: the five pictograms on the light menu, edges blended, no black boxes. The menu then closed onWM_CANCELMODE, nothing chosen.🤖 Generated with Claude Code