diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-18 19:55:33 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-18 19:55:33 -0500 |
| commit | 0890cda100295cbfef7a3f0ad43d0e3c784965cf (patch) | |
| tree | d604e8eae828b84acb7c1b3f489e20aa1d3d1a01 /scripts/theme-studio/test_generate.py | |
| parent | 00aa50de133ac00e0e9657afb884c974240314fe (diff) | |
| download | dotemacs-0890cda100295cbfef7a3f0ad43d0e3c784965cf.tar.gz dotemacs-0890cda100295cbfef7a3f0ad43d0e3c784965cf.zip | |
feat(theme-studio): add mode-line-highlight as an editable face
The mode-line hover box (the raised bevel on clickable mode-line segments) came from mode-line-highlight, a face the studio never managed, so it fell through to Emacs's stock released-button default with no way to change it.
I added it to the generated UI face list, between mode-line and mode-line-inactive. The row and box control are already generic over that list, so they appear automatically. build-theme.el's UI emission is generic too, so the elisp side needs nothing.
The face isn't in the captured Emacs snapshot, so apply_hover_box_default seeds its box to the raised default in both build_uimap branches. That matches current behavior and leaves the user free to flatten or recolor it. The mock frame previews the hover by wrapping a mode-line segment in the face.
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
| -rw-r--r-- | scripts/theme-studio/test_generate.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index ed2ce74ba..a0ca91e06 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -240,6 +240,19 @@ class GeneratorStateHelpers(unittest.TestCase): self.assertTrue(uimap["link"]["underline"]) self.assertEqual(uimap["mode-line"]["box"], {"style": "released", "width": 1, "color": None}) + def test_mode_line_highlight_defaults_to_raised_box(self): + # The face is absent from the snapshot, so it must get the raised box in + # both the with-snapshot and no-snapshot branches. + raised = {"style": "released", "width": 1, "color": None} + self.assertEqual(generate.UIMAP["mode-line-highlight"]["box"], raised) + no_snapshot = generate.build_uimap(generate.UI_FACES, DefaultFaces(None)) + self.assertEqual(no_snapshot["mode-line-highlight"]["box"], raised) + + def test_hover_box_default_yields_to_existing_box(self): + uimap = {"mode-line-highlight": ui_face_spec({"box": {"style": "line", "width": 2, "color": "#abcdef"}})} + generate.apply_hover_box_default(uimap) + self.assertEqual(uimap["mode-line-highlight"]["box"], {"style": "line", "width": 2, "color": "#abcdef"}) + def test_build_syntax_uses_map_and_style_fallbacks_without_defaults_snapshot(self): syntax = generate.build_syntax( {"kw": [None, True]}, |
