Skip to content
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

Separate out Icons into stock instead of direct use of pixbufs #839

Open
olabiniV2 opened this issue Dec 23, 2021 · 1 comment
Open

Separate out Icons into stock instead of direct use of pixbufs #839

olabiniV2 opened this issue Dec 23, 2021 · 1 comment

Comments

@olabiniV2
Copy link
Contributor

We are currently manually setting icons all over the place. That makes it hard to keep track of what icons exist, and also hard to switch them out when we want to do things like change the theme.

We should instead register all our icons with custom stock names, and then refer to them using these stock names from inside the XML definitions. This will allow automatic transition between variants for dark and light, for example.

We might also investigate how to manage icons from inside of CSS, in order to make it possible for end users to customize CSS and icons.

Some things to look at for this might be the icon-name propery and new_from_icon_name for setting images. GtkIconFactory and IconTheme are also possible places of investigation.

@olabiniV2
Copy link
Contributor Author

We found the solution to this in KeyMirror - it wasn't exactly obvious. The main component for this can be found in https://github.com/digitalautonomy/keymirror/blob/main/gui/icons.go - you need to put the data in a file, and then read it and register it using Gio, and finally add it to GTK as a resource path. The icons are defined in a resource file that gets compiled into this directory: https://github.com/digitalautonomy/keymirror/tree/main/gui/definitions/resources - the source definition for this resource is here: https://github.com/digitalautonomy/keymirror/tree/main/resources

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

No branches or pull requests

1 participant