fix(network-manager): not accepting char to display icons#1424
fix(network-manager): not accepting char to display icons#1424JakeStanger merged 1 commit intoJakeStanger:masterfrom
Conversation
Not if it's coming from the config. The system is designed to allow arbitrary text if preferred, or parse as different formats ( |
|
I would think that adding a custom key, like "raw:", would be easier to parse to display a label instead of an icon. This way we do not have to wait and see if the string resolves before showing as a label. This also avoids showing an unresolved path in the label. I do not know however since this module is the only module that currently allows svg icons (from what I have read of the code) that this would be later expanded to other modules (and then maybe a better handling to avoid destroying peoples configs). |
|
I can see potential utility in adding a new
What do you mean by this?
All modules use the central image parsing system, which supports SVGs. |
I meant that when the path turns out unresolved you could assume it was not a path and show it in the label. But that seems like an horrible solution: you could get full paths in the bar, it does not give a clue to what happened, you have to wait before showing a label that the resolution is done.
I am not sure about this. For example I was not able to parse an SVG image in the volume module. I was also unable to use the low and medium profiles there with the TOML config so maybe there is something that I missed there ? Anyway I think I will try to make a clean "raw:" etiquette system as it is not far of from what I have already written. |
0b13964 to
ddd4f12
Compare
This isn't the current behaviour though. If you pass a path with
Either a config issue or a bug. It's definitely supposed to be supported anywhere images are supported. There's specific support for it here: Lines 254 to 264 in 6e05d55
What do you mean by "use"? Regardless they're definitely there, and they definitely work. |
|
To be clear applying this config [[end]]
type = "volume"
sink_slider_orientation = "horizontal"
source_slider_orientation = "horizontal"
format = " {icon} {percentage}% {name} "
max_volume = 100
[end.icons]
volume_high = "T"
volume_medium = "T"
volume = "icon:network-wired-symbolic"
volume_low = "T"
muted = ""Only changes the high volume output to be a string of "icon:network-wired-symbolic". This is may be the wiki not being up to date. I have seen that in the code there are profiles implemented so there should be a way to make it definitely work. I think it would be best to have this discussion in another issue maybe (which I can open later). The relevant part for this PR is that "icon:network-wired-symbolic" does not get translated to an SVG icon. I mention this because the method you linked is in used in the following modules:
So I am unsure what you meant by all modules ? I mention this because then it might be better to have a shared system (the |
Ah yeah you're right. I'll log that to get fixed as soon as I can.
This is what already exists, which is what all image loading across all the modules already uses. It already supports SVGs, and that's what I linked above. |
|
Ok I finally understood what you meant, sorry for having dragged this. I think then that only the |
|
Okay sorry this is the first time I've properly looked at the code, but I think this needs reworking. There already exists an Lines 192 to 199 in 6e05d55 Rather than implementing a new system, using that would be preferable |
|
No worries. I have rewritten using the I am not the most proficient with the gtk lib and the api so hopefully them being marked as immutable is true. |
|
Cool thanks, code lgtm. Can you fix the build issue please? Just a feature flag that needs adjusting. Once that's done I'll give this a quick test and make sure it's all good, and go through wine a fine comb, then I think we're good to go.
|
Yes I can see now. I have added it ! Edit: That was not the case, now it is. I had no idea you had to log into GitHub to see job details.
That's good to know 👀 |
Fixes #1423
As it is my first PR here it is hopefully not too bad.
Also note that I had no previous Gtk experience so if I did something atrocious, please point it out.
Questions that still remains:
Should all icons contain "icon:" ? From what I understand specifying a path should also be accepted. Maybe a better condition there would be good or a rule to differentiate icons from custom text.
Opening this as draft since I could not find a satisfying answer to that question.