[Help] Code changes in order to add an icon

Hi,

As I commented at "Modern iconset (light and dark) thread, I have just started designing new icons for default classic iconset (filling the gaps, that is, designing icons that were TODO or just missing). I’m following the guidelines so they are being designed as .sif files using the correct file naming as well.

I have code skills that let me do lots of things (sometimes just by studying a code and “copy pasting it”) but they are pretty basic at the end so, after trying for myself, I wasn’t able to finish a “proof of concept” in this case. I would like to change the “File / Quit” icon as it has a GTK builded it. Here is mine action_doc_quit_icon.sif (70,0 KB)

Would anybody have enough time and skills to show me this proof of concept so that I can replicate it with the other icons (around 33+)?
Another way of doing it is explaining here what I did (what files I edited) and you tell me what is missing…

Thanks in advance!

Hello @pablogil :slightly_smiling_face:

There was another user who contributed Minimalistic icons idea in an effort to modernize decade old Synfig icons.

@rodolforg was very much involved in the post linked below. There were some limitations highlighted by him near the end.

Major obstacle was getting rid of the deprecated gtk main loop and implementing the modern glib one I think. Without which custom app/icon theming was impossible.

I do not know the current status unfortunately. Other priorities got hold of me. But I hope the above linked post helps.

Thanks @Keyikedalube for your comments.

I already read that thread but was old and unfinished, I mean it did focus on tools but not the rest of all icons used inside Synfig.

By the time I’m writing this I have finished the whole icon set but there are around 33+ icons that can’t be changed because they use the GTK Adwaita default icons (for actions like Quit, Close, Copy, Cut, Paste, and so on). I would like to learn how to change them with the ones I already have designed in order to copy the process and do it with all of the 33+ ones.

Maybe it’s not as easy as I think but, well, that’s why I’m asking for hints.

I’m waiting for two PR to be merged (https://github.com/synfig/synfig/pull/2731, [UI Feature 3] Shortcut to switch tabs by mohamedAdhamc · Pull Request #2755 · synfig/synfig · GitHub) so I can work on the needed changes without having an extra effort on merging them after.

Some work was started by nickleus27 (Use GtkBuilder to create App Menu by nickleus27 · Pull Request #2589 · synfig/synfig · GitHub) and me (Commits · rodolforg/synfig · GitHub). I’ll mix both and finish. But, as I said, I’ll wait for the PR #2731 and #2755.

Oh. It’s doable.

I think synfigapp action covers most of those basic functions. In gui source code folder there’ll be lines and lines of code setting icons for each action.

Maybe in canvasview file or main related file. I’m sorry I can’t be specific because I haven’t been contributing to the project lately.

Most of the code changes to be done are in
synfig-studio/src/gui/iconcontroller.cpp
synfig-studio/src/gui/app.cpp
synfig-studio/src/gui/canvasview.cpp
But the goal it to be sure to understand how to override the default icons/actions/menus and not to introduce multiple bugs at once :stuck_out_tongue:

1 Like

Yes, those are the files I was testing but, at least for “Quit” command, it is not straight forward or, as you say, I don’t properly understand how to override them… I mean, I could not change the default “Quit” icon to one I designed (called “action_doc_quit_icon.sif”).

At this point, it makes sense that I continue designing the icons and leave the code changes for later, when you are able to help me :wink:

Thanks