Conversation
Add Editor only, Split view and Preview only buttons to the VCL studio toolbar. The three buttons share a GroupIndex and leave AllowAllUp false, so the VCL keeps exactly one of them pressed. ApplyViewMode now syncs the pressed button, so it also follows the other ways the mode can change: Ctrl+1/2/3, the command palette, session restore and leaving zen mode. Glyph and hint constants go in the shared defines unit next to the existing toolbar glyphs. The code points are present in both Segoe Fluent Icons and the Segoe MDL2 Assets fallback.
Bring the FMX studio to parity with the VCL one by adding Editor only, Split view and Preview only buttons to its toolbar. The FMX toolbar builds each button as a TRectangle with a child TText glyph, so there is no toggle control to lean on. The active mode is drawn as a filled background one step beyond the hover tone, through a new RestingColorFor helper that both the mouse leave handler and the theme switch consult. Without that the pressed look was cleared as soon as the pointer left the button or the theme changed. ApplyViewMode calls UpdateViewModeButtons, the same hook used in the VCL form, so the lit button follows Ctrl+1/2/3, the command palette, session restore and leaving zen mode as well as the toolbar itself. Left aligned FMX controls stack in reverse of their creation order, so the three are created preview first to read as editor, split, preview on screen and match the VCL layout.
This was referenced Sep 16, 2026
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.
Depends on #7
This is stacked on #7, which adds the same buttons to the VCL studio and defines the shared glyph and hint constants. Until #7 merges, this branch also shows that commit. Please merge #7 first.
What
Brings the FMX studio to parity with the VCL one, adding Editor only, Split view and Preview only to its toolbar.
How
The FMX toolbar has no toggle control to lean on. Each button is a
TRectanglewith a childTTextglyph, and hover is drawn by assigningFill.Colordirectly. So the active mode is drawn as a filled background, one step beyond the hover tone in both themes.Two existing behaviors would otherwise wipe that fill:
HandleIconMouseLeavereset any button to the plain toolbar fill.Both now go through a new
RestingColorForhelper, which returns the active color for whichever view button matches the current mode and the toolbar fill for everything else.ApplyViewModecallsUpdateViewModeButtons, the same hook point used in the VCL form, so the lit button followsCtrl+1/Ctrl+2/Ctrl+3, the command palette, session restore and leaving zen mode.One layout detail: left aligned FMX controls stack in reverse of their creation order, so the three are created preview first in order to read as editor, split, preview on screen and match the VCL toolbar.
Testing
Markdown4DStudioFMXbuilds clean on Win32 Debug with Delphi 12 Athens.The dark theme path is covered by construction rather than by a screenshot:
FActiveColoris assigned in both branches of the theme switch, and the button loop there now callsRestingColorFor, so the active button keeps its fill across a theme change.