Skip to content

gtk4: Implement auto-colouring of toolbar icons #27989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Mar 29, 2024

PR summary

In GTK4, colouring of symbolic icons only takes place for icons that come from an icon theme. The easiest way to replicate that is to add our own theme to the search path, but this means following the special directory layout [1], so move the -symbolic symlinks to enable that.

We don't really need to change GTK3 as well, but doing so removes the need for an extra set of symlinks.

https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout

To test, you can run with GTK_DEBUG=interactive, and in the inspector window that pops up, toggle the "Dark variant" in the Settings.

PR checklist

QuLogic added 3 commits March 28, 2024 19:12
Originally, the resize event happens first, adds an idle draw callback,
and then the widget draws itself. Since the draw callback only happens
when _idle_, it happens after the draw, so the figure appears blank.
After the mouse is released, the idle draw callback fires, and the
figure appears again.

This is already done in the Qt backend [1], and doing so ensures the
figure remains visible during resizes with the mouse.

[1] https://github.com/matplotlib/matplotlib/blob/0afc5d6ca49cf6e8aa1da76b5bab0faca2f340f2/lib/matplotlib/backends/backend_qtagg.py#L25
In GTK4, colouring of symbolic icons only takes place for icons that
come from an icon theme. The easiest way to replicate that is to add our
own theme to the search path, but this means following the special
directory layout [1], so move the -symbolic symlinks to enable that.

We don't really need to change GTK3 as well, but doing so removes the
need for an extra set of symlinks.

https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant