mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
st/icon-theme: Pick best-matching name from all themes
When resolving an icon name, we currently look in all themes in
order whether one of the requested names matches.
That means, a "keyboard" icon from the configured theme will
trump over any of "keyboard-shift", "keyboard-brightness" and
"keyboard-preferences" from lower-ranked themes (like "Adwaita"
and "hicolor").
That applies to custom icons we include in the resource, which
are added to the fallback ("hicolor") theme.
We are less bound by the named-icons spec than GTK, so we can
adapt the lookup to prefer the most accurate match to matches
from the highest priority theme.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2824>
This commit is contained in:
parent
b0384bee99
commit
b3b4eeb496
1 changed files with 11 additions and 8 deletions
|
|
@ -1301,25 +1301,28 @@ real_choose_icon (StIconTheme *icon_theme,
|
|||
* In other words: We prefer symbolic icons in inherited themes over
|
||||
* generic icons in the theme.
|
||||
*/
|
||||
for (l = icon_theme->themes; l; l = l->next)
|
||||
for (i = 0; icon_names[i] && icon_name_is_symbolic (icon_names[i]); i++)
|
||||
{
|
||||
theme = l->data;
|
||||
for (i = 0; icon_names[i] && icon_name_is_symbolic (icon_names[i]); i++)
|
||||
icon_name = icon_names[i];
|
||||
|
||||
for (l = icon_theme->themes; l; l = l->next)
|
||||
{
|
||||
icon_name = icon_names[i];
|
||||
theme = l->data;
|
||||
|
||||
icon_info = theme_lookup_icon (theme, icon_name, size, scale, allow_svg);
|
||||
if (icon_info)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
for (l = icon_theme->themes; l; l = l->next)
|
||||
for (i = 0; icon_names[i]; i++)
|
||||
{
|
||||
theme = l->data;
|
||||
icon_name = icon_names[i];
|
||||
|
||||
for (i = 0; icon_names[i]; i++)
|
||||
for (l = icon_theme->themes; l; l = l->next)
|
||||
{
|
||||
icon_name = icon_names[i];
|
||||
theme = l->data;
|
||||
|
||||
icon_info = theme_lookup_icon (theme, icon_name, size, scale, allow_svg);
|
||||
if (icon_info)
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue