Feat: custom toolbar row with File/Edit/View + New/Save As quick-acce…#23
Open
electricmessiah wants to merge 4 commits into
Open
Feat: custom toolbar row with File/Edit/View + New/Save As quick-acce…#23electricmessiah wants to merge 4 commits into
electricmessiah wants to merge 4 commits into
Conversation
…ss icons Replaces the native menu bar with a custom-drawn toolbar row so quick-access icon buttons can share the same line as File/Edit/View. File/Edit/View are now flat buttons that open the same native submenus via TrackPopupMenu (all existing menu content, IDM_* command routing, and keyboard behavior within each dropdown is unchanged); New and Save As are icon buttons using Segoe Fluent Icons glyphs, with hover tooltips. - Custom BS_OWNERDRAW buttons throughout: standard BS_PUSHBUTTON always self-draws its 3D face using system colors and ignores WM_CTLCOLORBTN regardless of theme, so dark-themed buttons need full owner-draw (draw_toolbar_row_button). - The app's HMENU is now built once and kept in AppState (main_menu) instead of attached via SetMenu/CreateWindowExW; every menu-manipulation helper (checkmarks, enable/disable, Recent Files rebuild) was updated to read it from state directly. This also fixes a related bug: those helpers previously read the menu via GetWindowLongPtrW(hwnd, GWLP_USERDATA), which isn't set until after create_children() returns — so initial checkmark sync at startup was silently a no-op until the user toggled the setting manually once.
Font was baked in on first use, often during early WM_CREATE/WM_SIZE before Windows reports the window's final per-monitor DPI. Button boxes already re-layout dynamically and pick up the corrected DPI, but the glyph font stayed frozen at the wrong (usually 96 DPI) size, so icons rendered undersized relative to their buttons on interactive launches that hit the transient DPI window.
Dark theme colors the toolbar row the same background as the editor and tabs below it, so without a seam the row visually blends into the content area. Draws a DPI-scaled 1px line in a brighter dedicated shade along the bottom edge to keep the separation visible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the native menu bar with a custom-drawn toolbar row so quick-access icon buttons can share the same line as File/Edit/View. File/Edit/View are now flat buttons that open the same native submenus via TrackPopupMenu (all existing menu content, IDM_* command routing, and keyboard behavior within each dropdown is unchanged); New and Save As are icon buttons using Segoe Fluent Icons glyphs, with hover tooltips.