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

treebrowser: fix icons in the tree and the toolbar #927

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

techee
Copy link
Member

@techee techee commented Oct 12, 2019

I noticed several problems with the tree browser:

  1. The green toolbar icon with my theme corresponds to a document icon but it should be an action icon

Screen Shot 2019-10-12 at 20 53 41

2. Expanded folder icon is wrong and corresponds to document open action icon instead of a file type icon

Screen Shot 2019-10-12 at 20 54 03

3. On MacOS folder icons are themed differently than e.g. ProjectOrganizer or File browser plugins.

This pull request addresses these issues and makes some cleanups of the code in addition.

Copy link
Contributor

@lpaulsen93 lpaulsen93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the two little remarks, it looks good to me.

treebrowser/src/treebrowser.c Outdated Show resolved Hide resolved
treebrowser/src/treebrowser.c Show resolved Hide resolved
The big advantage is that the code is identical for both GTK2 and GTK3 so
we avoid many ifdefs. In addition, this allows us to use more icons on
GTK2 and not to be limited to the stock ones.
For expanded directory we should use the "folder-open" icon and not
"document-open" which is an action icon used for e.g. a toolbar icon
to open a document and can be themed in a completely different way.

Similarly, the "folder" icon used in the toolbar is a document-type icon
and here we should use some action icon. I used the "edit-copy" icon
which typically looks like two documents next to each other which kind
of corresponds to this action. But it's possible there's some better
option here.
ui_image_menu_item_new() only works with stock items and not freedesktop
icon names. This means that on GTK3, no icons were displayed this way.

We can implement our own version of ui_image_menu_item_new() which
uses gtk_image_new_from_icon_name() which is present in both GTK2 and
GTK3 and use this one instead.
There's no need for this as gtk_image_new_from_icon_name() works on
GTK2 too.
@techee
Copy link
Member Author

techee commented Oct 29, 2019

I've added a few more commits because icons weren't shown in the popup menu on GTK3 - see the new commits for more info.

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.

None yet

2 participants