Skip to content

Added basic support for Gtk theme - #2624

Closed
ice0 wants to merge 1 commit into
synfig:masterfrom
ice0:icon-theme-support
Closed

ice0 wants to merge 1 commit into
synfig:masterfrom
ice0:icon-theme-support

Conversation

@ice0

@ice0 ice0 commented May 3, 2022 •

Copy link
Copy Markdown
Collaborator
  • Icons moved to 128x128 folder
  • Added index.theme
  • File -> Save as icon switched to IconTheme icon (as example)

This PR will allow seamless transition to Gtk::IconTheme.

Details:
Almost all GTK methods using icons from the default GTK theme.
Unfortunately, we can't change the IconTheme name if we get it from the default screen with the Gtk::IconTheme::get_default() method (https://docs.gtk.org/gtk3/method.IconTheme.set_custom_theme.html)

Sets the name of the icon theme that the GtkIconTheme object uses overriding system configuration. This function cannot be called on the icon theme objects returned from gtk_icon_theme_get_default() and gtk_icon_theme_get_for_screen().

Also, I didn't find a way to change the app IconTheme to a custom one.
However, we can change the IconTheme for the default screen using the Gtk::Settings object.

It also fixes the problem with blurry icons on HiDPI screens. As you can see, the IconTheme icon is no longer blurry.

Screenshot_34

P.S. I'm not sure if I copied the file in Automake correctly, so any help is appreciated.

@ice0 ice0 added the GUI label May 3, 2022
@ice0
ice0 force-pushed the icon-theme-support branch from e06c78a to b2fedf5 Compare May 3, 2022 17:26
@rodolforg

Copy link
Copy Markdown
Contributor

Also, I didn't find a way to change the app IconTheme to a custom one.
However, we can change the IconTheme for the default screen using the Gtk::Settings object.

Please see app.cpp in #1508 . Does it help?

@ice0

ice0 commented May 8, 2022

Copy link
Copy Markdown
Collaborator Author

Also, I didn't find a way to change the app IconTheme to a custom one.
However, we can change the IconTheme for the default screen using the Gtk::Settings object.

Please see app.cpp in #1508 . Does it help?

	Glib::RefPtr<Gtk::Settings> gtk_settings = Gtk::Settings::get_default();

	if(char *theme_name = getenv("SYNFIG_GTK_THEME"))
		gtk_settings->property_gtk_theme_name() = theme_name;

This is the same approach.

@ice0

ice0 commented May 8, 2022 •

Copy link
Copy Markdown
Collaborator Author

@rodolforg
What do you think about merge #1508?
After that I can add changes from this PR (CMake mostly).

This need to start merging #2589

@ice0 ice0 closed this May 16, 2022
@ice0
ice0 deleted the icon-theme-support branch May 16, 2022 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants