Skip to content

Make Settings a NavigationSplitView window#267

Merged
danirod merged 4 commits intotrunkfrom
new-options-window
Aug 22, 2025
Merged

Make Settings a NavigationSplitView window#267
danirod merged 4 commits intotrunkfrom
new-options-window

Conversation

@danirod
Copy link
Copy Markdown
Owner

@danirod danirod commented Aug 21, 2025

The settings window used to be an AdwPreferenceDialog; now it's a standard AdwWindow that presents a NavigationSplitView.

image

Reasons:

  1. It has to happen anyway in order to move to multiple windows (Support multiple windows #258, New application shell #266). The new window actually uses the proposed system: there is a Shell and it gets added to an anonymous window.
  2. More options will be added soon, so more space will be needed anyway (Client certificates #190, Window color schemes #136, Private variables via .env file #265, Proxy options #268). I don't feel comfortable adding more PreferencePages, so there's that.

@danirod danirod merged commit 9b7a68b into trunk Aug 22, 2025
12 checks passed
@danirod danirod deleted the new-options-window branch August 22, 2025 00:06
danirod added a commit that referenced this pull request Aug 31, 2025
This PR will ask the Microsoft Windows compositor to enable a system
backdrop when running Cartero on Windows 11. This is known as acrylic
mode, Microsoft Fluent 2 or just Mica.

Any Win32 application running on Windows 11 Build 22621 or greater can
[request a
DwmAttribute](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute)
called `DWMWA_SYSTEMBACKDROP_TYPE` to set [one of the four supported
Mica
values](https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_systembackdrop_type).

The way this seems to work is that the backdrop is handled by the
compositor. In other words, the application will paint on top of the
backdrop. If the application supports alpha channels (which GTK does)
and decides to render the background transparent or partially
transparent, it can blend with the backdrop.

And this is what I'm doing right now. If I detect that the system
supports Mica, I request the backdrop from the compositor, and add a CSS
class called `mica` to the window. The style.css file has new rules that
mark some elements such as the top bar or the NavigationSplit sidebar as
transparent when the window has the `mica` class. The backdrop will
render because the header bar does not have a solid background color:

<img width="897" height="243" alt="imagen"
src="https://github.com/user-attachments/assets/d7bbf023-873f-417c-a285-2dc21585f93b"
/>

For the welcome pane I'm setting a background with alpha channel.
Therefore, the backdrop appears lighter:

<img width="897" height="756" alt="imagen"
src="https://github.com/user-attachments/assets/1b9f662d-c968-4d78-a175-734d4de297bb"
/>

Dark mode is supported too, for that matter.

<img width="851" height="697" alt="imagen"
src="https://github.com/user-attachments/assets/014ba136-baaf-4d29-90cb-36149b8b11cd"
/>

Indirectally, this commit also fixes the following two side bugs:

* Cartero was not reacting to the "high contrast mode has changed" event
in order to update the dark mode style. There is an edge case where this
can cause the application text to become unreadable then the high
contrast mode is enabled or disabled, as the Adwaita theme switches to
High Contrast (borders everywhere) but the text color is kept white over
light or black over dark.

* The new settings page added in #267 did not request the title bar
color to switch on Windows.
@danirod danirod mentioned this pull request Sep 4, 2025
3 tasks
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.

1 participant