Repository navigation
Draw the other controls of the macOS look as AppKit - #1110
Open
beetlebugorg wants to merge 2 commits into
Open
beetlebugorg wants to merge 2 commits into
beetlebugorg wants to merge 2 commits into
Conversation
The pop-up and pull-down buttons, the combo box, the stepper of a spinbox, the segmented control, the progress bar, and the table and outline view of the macOS look now follow AppKit on macOS 27, from a capture of a real window: the bezel fill with no stroke for the buttons, the arrow button inside the combo box, the accent for the selected segment, the track of the bar, and a table with no stroke, a header of 11 points, and the gray selection of a view without the focus. macOS draws no size grip. tools/native-ref/macos/controls.swift shows the Login dialog and these controls in a real AppKit window for screencapture -l, since AppKit draws the tabs of a tab view and the glass only on the screen. The controls in light and dark are golden pictures.
The segments of the macOS look had a margin of 2 between them, and the selected one stopped short of the next cell with a strip of the window color, which read as an edge over the next segment. AppKit draws one track with no gap, and the selected cell fills its own part of it with round corners. A frame with the class segmented is now the track in the macOS look, and its segments have no margin and no fill of their own; the selected one is the accent. In a parent with the class segmented, a segment keeps its own corners, since the parent draws the track. A test checks the pixels at the edge of the cells for each segment selected in turn, at the scale of 1 and 2, in light and dark.
This was referenced Dec 4, 2026
This branch has not been deployed
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.
Part of #1071 (part 2 of 2) and #154. Stacked on #1093 (part 1).
The other controls. The ztk pictures come from
src/tests/aqua_look.zig(headless, Core Text, scale 2). The AppKit pictures are a real window on the screen on macOS 27.0 (screencapture -loftools/native-ref/macos/controls.swift), with the same controls and made-up text, converted to sRGB.The edge of the selected segment, 3 times larger: AppKit (macOS 27) light, ztk light, AppKit dark, ztk dark. The shape and the place of the edge match, and the colors match within 16 levels (AppKit draws the selected segment in dark a little lighter, #107eff). The AppKit pictures are converted to sRGB, the space that ztk draws in: a capture is in the color space of the display, where the accent #007aff of AppKit (
controlAccentColor, light and dark) reads as #2f77f6. The fallback accent of the sheet stays #007aff, and a real window usescontrolAccentColorfrom the backend.A test (
aqua look: a selected segment stays inside its cell) checks the pixels at the edge of the cells with each segment selected in turn, at the scale of 1 and 2, in light and dark; it fails on the first version.(The pictures are on the branch
shots/aqua-controls-2; delete it after the merge.)Each value of
aqua-macos.cssnames the control and comes from the capture:ttk::menubutton,menubutton,tk_optionMenu): the bezel fill, a corner of 6, no stroke, 24 points high.ttk::radiobuttonwith the classsegmented): one track of the bezel fill with a corner of 6 and no gap between the cells; the selected cell fills its own part of the track in the accent, with its own round corners and white text. A parent frame with the classsegmentedis the track (ztk::class .seg add segmented); a segment outside such a frame draws its own track. Before, the selected label was white on white; the first version of this PR left a strip of the window color between the cells (fixed in the second commit).ttk::treeview,listbox): no stroke around the view, the header in 11 points and labelColor with a line between the columns, and the selection of AppKit: the accent while the view has the focus, else unemphasizedSelectedContentBackgroundColor (#dcdcdc, dark #464646).tools/native-ref/macos/controls.swift: the Login dialog and these controls in a real AppKit window, forscreencapture -l. AppKit draws the tabs of a tab view and the glass only on the screen.tests/golden/aqua-controls-light.pngand-dark.png(macOS only).zig build testandtools/ref-check.shpass.Left as it is, on purpose:
-anchorof Tk. AppKit puts them at the left; a script sets-anchor w.ttk::progressbaris a bar in Tk, so it stays a bar; the spinner of AppKit has no ttk widget.Lines: estimate 250, actual +363 −0 (with two golden pictures).