mate-desktop / mate-settings-daemon

MATE settings daemon
https://mate-desktop.org
GNU General Public License v2.0
43 stars 47 forks source link

media-keys: Remove touchpad OSD icons and use symbolic version instead #240

Closed zhangxianwei8 closed 5 years ago

zhangxianwei8 commented 5 years ago

Touchpad enabled/disabled PNG icons aren't used anymore, only the symbolic version is used. Use the touchpad enabled/disabled icons in mate-icon-theme.

These icons look better: screenshot at 2018-10-05 10-55-28

Refer to gnome-settings-daemon: media-keys: Remove OSD icons https://github.com/GNOME/gnome-settings-daemon/commit/1d261face77352c4501ff2687953a617372c87c6

media-keys: Fix OSD touchpad icon names https://github.com/GNOME/gnome-settings-daemon/commit/e8324c83654d3c50f8c142a2c12f421e61f8da9f

lukefromdc commented 5 years ago

I can't test this one as I don't have a laptop with a touchpad that can be disabled

raveit65 commented 5 years ago

Does symbolic icons really looks better? We use traditional icons all over the place, in result this is a general question of design which needs to be discussed by whole the team. Personal i like the traditional icon style.

lukefromdc commented 5 years ago

I do NOT want to force a replacement of traditional icons on any OSD with symbolic icons only. This should be controlled by themes and not hardcoded.

EDIT: one of the key things we've tried to to in MATE is maintain user control that GNOME has taken away by removing features

zhangxianwei8 commented 5 years ago

Does symbolic icons really looks better? We use traditional icons all over the place, in result this is a general question of design which needs to be discussed by whole the team. Personal i like the traditional icon style.

I found that mate-icon-theme(which MATE desktop default uses, https://github.com/mate-desktop/mate-icon-theme/tree/master/mate/scalable) also have symbolic icons. And I found disabled touchpad icons only have ONE symbolic icon, no other traditional icon: https://github.com/mate-desktop/mate-icon-theme/blob/master/mate/scalable/status/touchpad-disabled-symbolic.svg This PR is commited by raveit65: fresh up symbolic icons https://github.com/mate-desktop/mate-icon-theme/commit/8b70054e4fc7bc3a4b1fb2816f762b9d5c836de7

The purpose of GNOME using symbolic icon theme is to extend the base icon theme that follows the Tango style guidelines for specific purposes. This would include OSD messages, panel system/notification area, and possibly menu icons. Refer to: https://wiki.gnome.org/Design/OS/SymbolicIcons https://github.com/GNOME/gnome-icon-theme-symbolic

So I think maybe OSD icons use symbolic icons look better. And should remove mate-settings-daemon self-contained touchpad OSD icons :) @raveit65

BTW, symbolic icons also can be controlled by themes, isn't it? @lukefromdc

lukefromdc commented 5 years ago

Symbolic icons used in GNOME can certainly be disabled in the theme, I don't know the details to exactly how that works. I would be OK with this if it is possible for a theme to expliclty disable symbolic icons(which the MATE themes could then do). Unfortunately I cannot test this PR, as my only still-working laptop does not have a key to turn the touchpad on and off. Otherwise I could determine this myself.

raveit65 commented 5 years ago

With our default themes (Menta) i don't use a general setting for using regular icons. https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/BlueMenta/gtk-3.0/gtk-widgets.css#L20 I use those settings in specific locations to have better control about, and i can allow symbolic icons in some places if i don't use a general setting. There is no settings for this In osd part of the theme. https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/BlueMenta/gtk-3.0/gtk-widgets.css#L3742

So in theory it should be possible to let themes control the usage of a symbolic/regular icon when we remove the icons from m-s-d and a theme have regular and symbolic icons. We can add missing icons to mate-icon-theme, np.

And users can override the theme setting in ~/.config/gtk-3.0/gtk.css But keep in mind that touchpad-osd won't work if no theme with needed icons is installed.

raveit65 commented 5 years ago

https://github.com/mate-desktop/mate-icon-theme/blob/master/mate/scalable/devices/input-touchpad-symbolic.svg https://github.com/mate-desktop/mate-icon-theme/blob/master/mate/24x24/devices/input-touchpad.png We have already some needed icons in our theme. Only touchpad-enabled.png comes from m-s-d.

It looks like users can enable OSD touchpad icons in ~/.config/gtk-3.0/gtk.css with the correct css setting, without changing something here.

raveit65 commented 5 years ago

Using

[rave@satellite ~]$ cat .config/gtk-3.0/gtk.css 
* {
    -gtk-icon-style: symbolic;
}

switched most icons to symbolic version, but not `input-touchpad and touchpad-disabled. Seems that it is hardcoded in m-s-d. I would like to see that it isn't hardcoded, but hardcoding it to symbolic version isn't the solution.

zhangxianwei8 commented 5 years ago

Would you add touchpad-disabled.png to mate-icon-theme?

raveit65 commented 5 years ago

sure, i can add touchpad-disabled.png to mate-icon-theme, or any other icon we need. Which place? device, status.etc ?

zhangxianwei8 commented 5 years ago

status is better?

raveit65 commented 5 years ago

Original touchpad-disabled.png and touchpad-enabled.png from m-s-d are in actions folder :) Maybe we use orginal folder and i will make a symlink size/device/input-touchpad.png --> size/actions/touchpad-enabled.png ? We can also use status. I don't know if it makes a different.

zhangxianwei8 commented 5 years ago

That's OK.

zhangxianwei8 commented 5 years ago

I will update the PR after you add icons.

zhangxianwei8 commented 5 years ago

The GTK supports symbolic icons here: Support 'symbolic' themed icons https://github.com/GNOME/gtk/commit/6b939d57c762f58a9f8d529024b7171ff70b6986#diff-489cf041f6ec09a973d291fc86f1411e

The g-s-d supports symbolic icons here: media-keys: Use symbolic icons for OSD https://github.com/GNOME/gnome-settings-daemon/commit/5f4304d120f78527ffdbb4da500c0f14c4c3f675 g-s-d uses the new "use-fallback" property of GtkImage to make sure that the fallback icons will be loaded if necessary.

Symbolic icons follow the naming specification, but have a -symbolic suffix, so only applications specifically looking up these symbolic icons will render them. If a -symbolic icon is missing, the app will fall back to the regular name. @lukefromdc

raveit65 commented 5 years ago

Done. https://github.com/mate-desktop/mate-icon-theme/commit/932961db50aaea23b953a79e0967385bf66a12ea But i chooses the status dir to avoid installation conflicts with current m-s-d.

lukefromdc commented 5 years ago

As per https://github.com/mate-desktop/mate-media/pull/115#discussion_r223215412 I believe the default should be regular icons with symbolic as the user-selectable option. If both regular and symbolic icons are available in the icon theme the regular icons should be used unless the user or the user's GTK theme selects symbolic icons. This is in the interests of consistancy

zhangxianwei8 commented 5 years ago

Updated the PR, tested on Fedora 28 with newly mate-icon-theme.

lukefromdc commented 5 years ago

Does anyone know a way to force this OSD to appear on a desktop or on a laptop where there is no key to turn the touchpad on and off? That would permit me to test this

zhangxianwei8 commented 5 years ago

I add a PR to test touchpad OSD icons, execute test-media-window to appear: ./plugins/media-keys/test-media-window @lukefromdc

raveit65 commented 5 years ago

Btw. do you know for what touchpad-enabled-template.svg was good for?

zhangxianwei8 commented 5 years ago

touchpad-enabled-template.svg is just a temporary file. Remove it.

raveit65 commented 5 years ago

Sadly using input-touchpad requires another change to avoid a blurred icon. And tomorrow is f29 release freeze, but OK...shit happens. https://github.com/mate-desktop/mate-icon-theme/commit/2857b967bae555174029dff231f40e888b2a908f

clefebvre commented 5 years ago

I would be in favor of adding a global setting in MATE to either prefer full color icons or to prefer symbolics.

We could set that to fullcolor by default and add support for symbolic icons which would only kick into effect if that setting is set to symbolics.

Caja for instance badly needs symbolic support, but giving it that support would drastically change its look and I know you're not OK with that. Making this a preference could solve that.

raveit65 commented 5 years ago

@clefebvre Nice idea, feel free to work on that project.

raveit65 commented 5 years ago

But such a global setting is complete independent from current state of PR, which only moves icons to mate-icon-theme.

zhangxianwei8 commented 5 years ago

I think it can be commited as a NEW feature, which adding a global setting. You can keep the current state of PR.

lukefromdc commented 5 years ago

GTK themes (and thus also the user's ~/.config/gtk-3.0/gtk.css) can already set the preference for symbolic or standard icons by using -gtk-icon-style: symbolic to enable symbolic icons or -gtk-icon-style: regular to disable symbolic icons This can be globally or for any single widget or widget class using the icons, same as anything else controllable within GTK themes.

zhangxianwei8 commented 5 years ago

Hi, @lukefromdc have you tested the second PR yet?

lukefromdc commented 5 years ago

Not sure what you are referring to unless its https://github.com/mate-desktop/mate-media/pull/115 which I have tested. I can't test anything related to turning touchpads on and off as I do not have any still-functioning laptops that have that key.

zhangxianwei8 commented 5 years ago

If you do not have such laptop, you can test the icons with the second PR https://github.com/mate-desktop/mate-settings-daemon/commit/80aaf1d2f4d25e19a31ad2d744c7122fa509d384

lukefromdc commented 5 years ago

That's not a new PR, just a new commit to this PR, building now. How do I invoke the touchpad OSD once installed? EDIT: Also remember that I cannot invoke the OSD from master for comparison

zhangxianwei8 commented 5 years ago

Sorry, I made a mistake. Run ./plugins/media-keys/test-media-window after build it.

lukefromdc commented 5 years ago

OK, that works, and it cycles through all the icons the media window can use. With both the MATE icon theme and my own UbuntuStudio_Legacy icon theme(which inherits from MATE), I got the full color touchpad icons.

lukefromdc commented 5 years ago

When using the "Adwaita" icon theme I got one blank window, and one showing the mate icon for the touchpad

zhangxianwei8 commented 5 years ago

This is due to “Adwaita” icon theme does not have "touchpad-disable" regular icons, just only have symbolic icons: /usr/share/icons/Adwaita/96x96/status/touchpad-disabled-symbolic.symbolic.png /usr/share/icons/Adwaita/64x64/status/touchpad-disabled-symbolic.symbolic.png /usr/share/icons/Adwaita/32x32/status/touchpad-disabled-symbolic.symbolic.png /usr/share/icons/Adwaita/24x24/status/touchpad-disabled-symbolic.symbolic.png /usr/share/icons/Adwaita/48x48/status/touchpad-disabled-symbolic.symbolic.png /usr/share/icons/Adwaita/scalable/status/touchpad-disabled-symbolic.svg /usr/share/icons/Adwaita/16x16/status/touchpad-disabled-symbolic.symbolic.png

But it has "input-touchpad" regular icons: /usr/share/icons/Adwaita/96x96/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/64x64/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/32x32/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/32x32/devices/input-touchpad.png /usr/share/icons/Adwaita/24x24/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/24x24/devices/input-touchpad.png /usr/share/icons/Adwaita/22x22/devices/input-touchpad.png /usr/share/icons/Adwaita/48x48/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png /usr/share/icons/Adwaita/scalable/devices/input-touchpad-symbolic.svg /usr/share/icons/Adwaita/16x16/devices/input-touchpad-symbolic.symbolic.png /usr/share/icons/Adwaita/16x16/devices/input-touchpad.png

Maybe this is "Adwaita" icon theme's problem?

lukefromdc commented 5 years ago

I was trying to see if Adwaita would bring up a symbolic icon, which it did not even when

* {-gtk-icon-style: symbolic;
}

was added to ~/.config/gtk-3.0/gtk.css , as the original work had been aimed at supporting symbolic icons. Anyway, for using the icons in the MATE theme this works fine

zhangxianwei8 commented 5 years ago

That's fine.

raveit65 commented 5 years ago

Same behavior from Adwaita or other themes which do not inherits from Mate with master branch. So PR is ready to go for me.

raveit65 commented 5 years ago

I merged the first commit https://github.com/mate-desktop/mate-settings-daemon/commit/7c5d340069139df598b6fda72f773697b5cd7045 Thank you

zhangxianwei8 commented 5 years ago

What about the second commit?

raveit65 commented 5 years ago

I thought it was only for testing?

raveit65 commented 5 years ago

Ok, got it. There are already other keys for testing in test-media-window.c

zhangxianwei8 commented 5 years ago

I found that mate-icon-theme's scalable directory(https://github.com/mate-desktop/mate-icon-theme/tree/master/mate/scalable) also has mostly symbolic icons, and no regular icons in other directories. Such as fellowing icons:

airplane-mode-symbolic
bluetooth-disabled-symbolic
bluetooth-active-symbolic
network-wireless-signal-excellent-symbolic

Should be also supported regular icons? @raveit65

raveit65 commented 5 years ago

Yes, this is because all symbolic icons are from adwaita theme. But since gnome3 use symbolic icons as default nobody wrote regular icons there. In result all new icons in adwaita theme are made only for symbolic version and the regular icons are old gnome2 icons. So, someone needs to write regular icons from scratch or search for free icons in www . Personal don't have the knowledge to write regular icons with gimp. I am good in gtk themes :)

zhangxianwei8 commented 5 years ago

The URL which you give to search for free icons is incomplete, please check it? Could you tell me how to search for free icons, maybe I can write regular icons with you?

raveit65 commented 5 years ago

There is no link, i just wrote www (world wide web) :)