RaySession icon indicating copy to clipboard operation
RaySession copied to clipboard

Some labels do not fit in the bar

Open ycollet opened this issue 5 years ago • 17 comments

image

The label do not fit in the bar.

I use RaySession-0.8.1 on Fedora 30.

ycollet avatar Oct 24 '19 16:10 ycollet

humm, "Dossier de la session" and "Précédent..." should be icons, not labels. These icons comes from system icon theme and there names are not provided by your icon theme. I should provide icons if theme doesn't provide them in all cases. Was it the case before ? I mean, using the same icon theme with previous version of RaySession ?

Houston4444 avatar Oct 24 '19 17:10 Houston4444

With the previous version of RaySession, it was already the case. I use XFCE on Fedora 30. I was on KDE some months ago but due to a problem with KWin and real time kernel, I switched to XFCE.

ycollet avatar Oct 24 '19 18:10 ycollet

Could you give me your icon theme name, and the default icon name used for folder and trash ? Something strange is that you don't have any system icon on RaySession. All present icons on your screenshot are provided by RaySession itself (you should have icons too with "Nouvelle Session", "Ouvrir une session"', "Application", "Executable"...

Now, I switch to french because it's totally off-topic. C'est quoi ce problème de KWin et de noyau temps réel ? Tu parles bien d'un noyau RT, et pas basse latence ? Mon ordi a tendance à partir dans les tours sans raison apparente quand je fais de la zic, et ça me ferait bien pêter que KWin en soit la cause...

Houston4444 avatar Oct 25 '19 06:10 Houston4444

How do I get these default name for the theme and for these icons ?

Swtich to french.

En fait ce n'est pas tout à fait kwin, mais plasmashell qui freeze. Ca n'arrive que lorsque je tourne sur noyau temps réel et que j'ai un application qui tourne en temps réel. Ca arrive quasi systématiquement et le workaround que j'ai trouvé: tuer plasmashell puis le redémarrer. Ensuite, il ne freeze plus. La trace que j'avais récupéré via gdb me menait dans du code qt. Je vais être absent une semaine donc je ne pourrai pas donner de nouvelles infos avant.

ycollet avatar Oct 25 '19 07:10 ycollet

I don't really know because I use kdialog --geticon to find system icons. Maybe you can install kdialog withou many plasma dependencies.

Bon ça me rassure un peu mon plasmashell ne freeze pas.

Houston4444 avatar Oct 25 '19 07:10 Houston4444

OK, so, you use kdialog inside RaySession to get these icons. When I install RaySession, kdialog is not installed. That's maybe the problem. I will try with kdialog installed and see if it fixes the problem.

ycollet avatar Oct 25 '19 08:10 ycollet

OK, so, you use kdialog inside RaySession to get these icons.

No, not at all ! I use kdialog to find visually system icon names for myself. kdialog install won't fix anything in RaySession, sure.

Houston4444 avatar Oct 25 '19 09:10 Houston4444

I switched back to kde and there are no problems on kde. The problem only appears on Xfce.

ycollet avatar Nov 09 '19 11:11 ycollet

Ok, not surprised. I did install Xfce to test, but I have not this problem. I'll try to fix it providing fallback icons everywhere it's needed, then I'll put a comment here in order you can test it on xfce.

Houston4444 avatar Nov 09 '19 13:11 Houston4444

Can you list the xfce packages you have installed ? I maybe miss a xfce icon package ...

ycollet avatar Nov 09 '19 13:11 ycollet

Normally I think I fixed the bug. please try new version v0.8.2 or git master, and close it if it is good. Thanks

Houston4444 avatar Nov 20 '19 13:11 Houston4444

Using v0.8.3 on Fedora 32 on Gnome Wayland, there is a similar issue:

  • "Stopped" does not fit, can only see "topped" (Maybe just align left, since losing the end is not a big issue)
  • Also, the window title is "Python3"

Screenshot from 2020-05-16 14-07-35

BrunoVernay avatar May 16 '20 12:05 BrunoVernay

I've seen this truncated text problem under librazik, too. I'll try something for that. But, on your screenshot, I see it's not the main problem. The main problem is that all icons use the wrong color scheme (all icons used from raysession itself, not from system), that is quite strange. They should be darker because the colour scheme is light.

Houston4444 avatar May 16 '20 12:05 Houston4444

@BrunoVernay serais-tu capable de debugger le problème de couleurs d'icônes si je te dis où ça se situe dans le code ? Je veux dire par là, as-tu quelques notions de python ou tout du moins de programmation pour y jeter un oeil ?

Ça se trouve dans src/gui/main_window.py, ligne 186: dark = isDarkTheme(self)

que se passe-t-il si remplace cette ligne par: dark=False

Si tu es capable d'aller plus loin, la fonction isDarkTheme est dans src/gui/gui_tools.py , mais là c'est seulement si tu peux comprendre le code.

Houston4444 avatar Jun 04 '20 11:06 Houston4444

Yes, I can code et c'est intéressant. I will try to find some time to look at it.

BrunoVernay avatar Jun 04 '20 11:06 BrunoVernay

Super, Thanks you very beaucoup !

Houston4444 avatar Jun 04 '20 11:06 Houston4444

With dark=False c'est immediately better image

The lightness value is

  • 148 for default Adwaita theme
  • 145 with the Adwaita-dark

If I used this

    # See https://doc.qt.io/qt-5/qpalette.html#ColorRole-enum
    # WindowText, Window ... are  symbolic color roles
    # Active, Inactive ...   are color groups
    foreg = widget.palette().brush(QPalette.Active, QPalette.WindowText).color().lightness()
    backg = widget.palette().brush(QPalette.Active, QPalette.Window).color().lightness()
    return bool( foreg > backg )

I get

  • 50 > 245 with a light theme
  • 237 > 53 with a dark theme

Overall, not sure if the front / back is relevant. I guess that if the front text is light it is enough. So with minimal change, only replacing 2 with QPalette.Active is OK for me.

BrunoVernay avatar Jun 05 '20 09:06 BrunoVernay