papirus-icon-theme icon indicating copy to clipboard operation
papirus-icon-theme copied to clipboard

Problem with 32px icons on Plasma widgets

Open morganist opened this issue 11 months ago • 58 comments

Background

With our effort to adapt Papirus to KDE Plasma 6 in #3663 we allowed all 16px panel icons to also be used in 32px size. This is needed for Plasma system tray, which uses status icons in a bigger size than their variant for panel:

Image

The problem

However, this lead to some icons showing up in undesirable places, replacing perfectly correct icons such as the case with hard drive icon in file managers and GNOME Disks:

Image

USB reader uses a correct device icon, hard disk icons are replaced by their symbolic variants as of Papirus version 20240501. That happens because they have the same name: drive-harddisk.svg. This might seem as an oversight, but turns out this is completely fine within the spec: https://specifications.freedesktop.org/icon-theme-spec/latest/#context Context is everything here. Here is our entry from index.theme for 32px devices folder:

[32x32/devices] Context=Devices Size=32 Type=Fixed

As you can see, the context is correct for this folder. It contains device icons, its context should be device icons. Now let's see our index.theme entry for new symlinked 32px panel icons:

[32x32/panel] Context=Status Size=32 Type=Fixed

They have different context! So the question is, why does the software such as GNOME Disks uses incorrect icons? Does the GTK implementation ignore context? Or is this an issue within Papirus? So, this issue was created in efforts to investigate the problem and, hopefully, find a solution.

morganist avatar Jan 22 '25 10:01 morganist

related to #3730

morganist avatar Jan 22 '25 11:01 morganist

Well, the classic implementation of icon lookup doesn't have context parameter at all. See https://specifications.freedesktop.org/icon-theme-spec/latest/#icon_lookup

We can't control what icon to show between two icons with the same filename and same size. So, there is no solution.

SmartFinn avatar Jan 24 '25 16:01 SmartFinn

@SmartFinn what do you mean "classic"? the one in the example?

morganist avatar Jan 24 '25 18:01 morganist

@morganist

I mean, there is an implementation that described in specification. If a developer wants to follow the specification, he doesn't have to add context as a parameter for searching an icon.

SmartFinn avatar Jan 24 '25 18:01 SmartFinn

On Breeze icon theme used monochrome icons for mostly 32px icons, but this icon size not monochrome on Papirus... It's not -symbolic icons and fully colorfull. This workaraund need remove... and port 32px status icons form Plasma theme to Papirus 32px - it's not tray icons, it's widgets icons related issues #3941

varlesh avatar Mar 11 '25 11:03 varlesh

I'll take care of this problem... when master branch will be updated

varlesh avatar Mar 11 '25 11:03 varlesh

So, there is will be a new directory in 32x32/panel with monochrome icons for Plasma?

SmartFinn avatar Mar 12 '25 17:03 SmartFinn

@SmartFinn No, these icons should be in the 32/status directory.

varlesh avatar Mar 12 '25 17:03 varlesh

Now, as i know 16-22px -symbolic icons used on Apps UI and panel (22px), but if -symbolic icons not exist - used regular icons, but maybe not everywhere... For widgets used regular icons, maybe not all too

Image

As i sayd earlier, they can add + "-symbolic" suffix and it's can be spoiled...

varlesh avatar Mar 12 '25 17:03 varlesh

I adhere to the standard, we have 32px non-monochrome icons, and therefore they should be in the status folder...

varlesh avatar Mar 12 '25 17:03 varlesh

Now it's mixed, for example Plasma Vault code:

Image

But KDE Connect use kde-connect-tray-symbolic if not exist use kde-connect-tray:

Image

varlesh avatar Mar 12 '25 18:03 varlesh

Maybe need delete some -symbolic icons for better looking...

varlesh avatar Mar 12 '25 18:03 varlesh

@varlesh But KDE Connect use kde-connect-tray-symbolic if not exist use kde-connect-tray

Not correct. It says use kde-connect-tray-symbolic if inPanel, if not inPanel use kde-connect-tray.

SmartFinn avatar Mar 12 '25 18:03 SmartFinn

i'm confused... Now on local PC have: kde-connect-tray-symbolic 16-22-32, and kde-connect-tray 16-22, i'm create kde-connect-tray on status folder. Result:

Image

if i'm rename kde-connect-tray to kde-connect-tray-symbolic on status folder Result:

Image

varlesh avatar Mar 12 '25 18:03 varlesh

it's symbolic icon!

varlesh avatar Mar 12 '25 18:03 varlesh

@varlesh only in case the widget placed to panel. On the desktop, it's not adding -symbolic to the icon names.

SmartFinn avatar Mar 12 '25 18:03 SmartFinn

it's not desktop... it's tray menu

varlesh avatar Mar 12 '25 18:03 varlesh

i'm remove kdeconnect-tray-symbolic - and all fine, on tray menu used 32px from status, on panel used monochrome icon!

varlesh avatar Mar 12 '25 18:03 varlesh

I told you, you misunderstood the code. Ask ChatGPT to explain if you don't believe me.

SmartFinn avatar Mar 12 '25 18:03 SmartFinn

@SmartFinn Да пофиг. Я уже портирую 32px значки для виджетов. По факту это значок панели, да но 32px. Потому что у нас 32px не монохром! Там малого того статусы задействованны, так еще и значк из устройств, категорий, мест, да всего чего угодно. Это обход... Подобная реализация была у меня в Материи

varlesh avatar Mar 12 '25 18:03 varlesh

Либо нам надо фигачить все 32px, кроме apps в монохром!

varlesh avatar Mar 12 '25 18:03 varlesh

@SmartFinn а ты меня убьёшь если я в 32/status добавлю обычный значок с суффиксом -symbolic?

varlesh avatar Mar 12 '25 19:03 varlesh

т.е. в 22px -symbolic будет монохром, а 32px -symbolic будет обычный...

varlesh avatar Mar 12 '25 19:03 varlesh

@varlesh i don't see a reason why. Check the Breeze theme, I sure that icon is a monochrome.

SmartFinn avatar Mar 12 '25 19:03 SmartFinn

@SmartFinn Причина в том, что меня бесит монохром размером 32px и если у kdeconnect есть отдельная иконка для трея и тут можно обыграть ситуацию, то вот для этой plasmavault юзается одно имя. Потому как у нас 32px идёт симлинком на 16px, а потому он их юзает

varlesh avatar Mar 12 '25 19:03 varlesh

@varlesh

Image

As in case with kdeconnect, it uses symbolic icon only when inPanel variable set.

I see consistency in these two cases.

SmartFinn avatar Mar 12 '25 19:03 SmartFinn

Даже если я удалю plasmavault-symbolic из 16px, он один хрен берёт 22px и начинает ее масштабировать

varlesh avatar Mar 12 '25 19:03 varlesh

Вот другой код, все значки лежат и в symbolic и в status:

Image

Image

varlesh avatar Mar 12 '25 19:03 varlesh

почему бляха здесь не юзается -symbolic значок!? У меня мозг уже взрывается

varlesh avatar Mar 12 '25 19:03 varlesh

@varlesh see inside symbolicizeIconName function. Seems it adds -symbolic.

SmartFinn avatar Mar 12 '25 19:03 SmartFinn