Skip to content

Follow the system style, add a compact mode and show the 1-9 keys - #218

Open
geodro wants to merge 2 commits into
sonnyp:mainfrom
geodro:theme-and-compact-mode
Open

Follow the system style, add a compact mode and show the 1-9 keys#218
geodro wants to merge 2 commits into
sonnyp:mainfrom
geodro:theme-and-compact-mode

Conversation

@geodro

@geodro geodro commented Jul 27, 2026

Copy link
Copy Markdown

Junction called set_color_scheme(FORCE_DARK) and hardcoded #353433 / #1e1e1e / white / black in style.css. On a light desktop the window stayed dark but libadwaita flipped the foreground colors, so the app labels and the window controls became dark-on-dark. Fixes #96.

These are separable changes on one branch, and I am happy to split them into separate PRs if you'd prefer.

Follow the system style

  • The color scheme defaults to default, so libadwaita follows the org.freedesktop.appearance portal: color scheme, accent color and contrast. GNOME, KDE Plasma and others implement it.
  • A Style menu section (Follow System / Light / Dark) overrides it, stored in a new color-scheme key whose values match AdwColorScheme so they can be passed straight to set_color_scheme.
  • Hardcoded colors become @popover_bg_color, @view_bg_color, @borders and @accent_*. @popover_bg_color is within a shade of the old #353433 in dark, and gives a sane light appearance.
  • The focused tile is tinted with the accent color rather than a fixed alpha(white, 0.3), which was invisible on light backgrounds.
  • .welcome button.link no longer forces white text, which was invisible on a light background.
  • A prefers-contrast: more block thickens the entry border and focus ring.

One popover per menu button

Both MenuButtons pointed at a single shared PopoverMenu instance. A GtkPopover can only have one parent, so GTK reparented it and logged gtk_widget_set_parent criticals on every launch. On Plasma the visible symptoms were a stray arrow pointing at the hidden header button, and the menu opening by itself. Each button now uses menu-model: and gets its own correctly parented popover from the same GMenu. The criticals go from one per launch to zero.

This one is independent of the theming work and could land on its own.

Compact mode

  • A Compact Mode menu toggle backed by a new compact key: icons 92 to 64, tiles 134 to 80, tighter padding, window 772x218 to 560x140, and the window corner radius 30px to 18px because 30px cuts into the first tile at that height.
  • Compact tiles are icons only regardless of Show App Names, because a name ellipsizes to uselessness under an 80px tile. The name stays in the tooltip.

Show the 1-9 keys

  • The first nine tiles show the digit that opens them. The shortcut already existed but was only discoverable from the Keyboard Shortcuts window, and compact mode hides names entirely.
  • getButtonForKeyval now also accepts KP_0 to KP_9, so the numeric keypad works and not just the number row.

geodro added 2 commits July 27, 2026 12:41
Junction forced Adw.ColorScheme.FORCE_DARK and hardcoded its colors, so it
was a dark window whatever the desktop asked for, and on a light style the
labels and window controls turned dark-on-dark. Fixes sonnyp#96.

Style:

- The color scheme now defaults to "default", so libadwaita follows the
  org.freedesktop.appearance portal - color scheme, accent color and
  contrast. GNOME, KDE Plasma and others implement it.
- A "Style" section in the menu (Follow System / Light / Dark) overrides it,
  stored in a new "color-scheme" key whose values match AdwColorScheme.
- The hardcoded #353433, #1e1e1e, white and black are replaced with
  @popover_bg_color, @view_bg_color, @borders and @accent_*, so light, dark
  and high contrast all render correctly.
- The focused tile is tinted with the accent color instead of a fixed white
  wash that was invisible on light backgrounds.
- "Test Junction" in the welcome window no longer forces white text, which
  was invisible on a light background.

Compact mode:

- A "Compact Mode" menu toggle backed by a new "compact" key shrinks icons
  (92 -> 48), tiles (134 -> 80), padding and the window (772x218 ->
  560x140).
- Compact tiles are icons only whatever "Show App Names" says - a name
  ellipsizes to uselessness under an 80px tile. The name stays in the
  tooltip.

Keyboard:

- Each of the first nine tiles now shows the digit that opens it. The
  shortcut already existed but was only discoverable from the Keyboard
  Shortcuts window, and compact mode hides names entirely.
- 1-9 on the numeric keypad work too, not just the number row.
Both MenuButtons pointed at a single shared PopoverMenu instance. A
GtkPopover can only have one parent, so GTK reparented it and logged
gtk_widget_set_parent criticals on every launch. The visible symptoms were
a stray arrow pointing at the hidden header button, and the menu opening on
its own. Using menu-model: on each button gives each one a correctly
parented popover built from the same GMenu, and the criticals go away.

Compact mode, after trying it on a real desktop:

- Icons 48 -> 64 and tiles 80px, so the tile hugs the icon instead of
  leaving 16px of dead space around it. The folder icon follows, 24 -> 32.
- Window corner radius 30px -> 18px when compact. 30px is a big bite out of
  a 140px tall window, and the curve cut into the first tile.
@geodro
geodro marked this pull request as ready for review July 27, 2026 12:04

@sonnyp sonnyp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thank you, please split this into

  1. One popover per menu button
  2. Follow system theme

For now and we'll look at 1-9 and compact mode afterwards.

@geodro

geodro commented Aug 4, 2026

Copy link
Copy Markdown
Author

Done, split as requested:

  1. One popover per menu button: Give each menu button its own popover #219
  2. Follow the system style: Follow the system style #220

I'll keep this branch around for the compact mode and 1-9 keys work to revisit afterwards — let me know if you'd rather I close this PR in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

junction does not follow prefer-light

2 participants