Re: [X2Go-Dev] Font colour in x2goclient in case of dark system theme
V Fri, 17 Feb 2012 16:33:21 +0100 Milan Knížek knizek.co...@gmail.com napsáno: Hello, the x2goclient has hardcoded light appearance for the various widgets (main window, session list, login window, progress of logging in), which does not work well with dark system theme: the white font is not distinquishable from the background. To those interested, a quick workaround w/o need for recompiling is to run: $ x2goclient -bg white -fg black which will set background and foreground colours for the whole app, fitting with the hardcoded lookfeel. (Both parameters exist for any Qt app. Probably works only in X Window system.) The app then looks different than the rest of the DE, of course. Regards, Milan -- http://www.milan-knizek.net/ About linux and photography (Czech only) O linuxu a fotografování ___ X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
[X2Go-Dev] Font colour in x2goclient in case of dark system theme
Hello, the x2goclient has hardcoded light appearance for the various widgets (main window, session list, login window, progress of logging in), which does not work well with dark system theme: the white font is not distinquishable from the background. I have checked the Qt documentation and there seems to be more ways on how to accomplish that. So far, I have used three various methods: labelname-setStyleSheet(QLabel { color : black; }); or cpal.setColor ( QPalette::Text, Qt::black); or QString fonttemplate=(font color='black'%1/font); nameLabel-setTextFormat ( Qt::RichText ); nameLabel-setText ( fonttemplate.arg( text ) ); which kind of works, though it requires to be written repeatedly throughout the code (sessionbutton.cpp, onmainwindow.cpp, onmainwindow_part4.cpp) for individual widgets and so far I am not able to use a single approach for all widget types (QLabel, QMenu, QPushButton, etc.). The first method seems to be the most general and simplest, however. Is there a way to set application-wide font colour for anything that appears in the widgets, but not in app menu and other windows (Settings, Session Settings, etc.), because these are styled with the system-wide dark theme? Where in the code? P.S. Sorry for possibly stupid question, but since I am not a coder, it is rather a trial error approach and a lot of googling... Regards, Milan -- http://www.milan-knizek.net/ About linux and photography (Czech only) O linuxu a fotografování ___ X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
Re: [X2Go-Dev] Font colour in x2goclient in case of dark system theme
On Fri, 2012-02-17 at 16:33 +0100, Milan Knížek wrote: Hello, the x2goclient has hardcoded light appearance for the various widgets (main window, session list, login window, progress of logging in), which does not work well with dark system theme: the white font is not distinquishable from the background. I have checked the Qt documentation and there seems to be more ways on how to accomplish that. So far, I have used three various methods: labelname-setStyleSheet(QLabel { color : black; }); or cpal.setColor ( QPalette::Text, Qt::black); or QString fonttemplate=(font color='black'%1/font); nameLabel-setTextFormat ( Qt::RichText ); nameLabel-setText ( fonttemplate.arg( text ) ); which kind of works, though it requires to be written repeatedly throughout the code (sessionbutton.cpp, onmainwindow.cpp, onmainwindow_part4.cpp) for individual widgets and so far I am not able to use a single approach for all widget types (QLabel, QMenu, QPushButton, etc.). The first method seems to be the most general and simplest, however. Is there a way to set application-wide font colour for anything that appears in the widgets, but not in app menu and other windows (Settings, Session Settings, etc.), because these are styled with the system-wide dark theme? Where in the code? P.S. Sorry for possibly stupid question, but since I am not a coder, it is rather a trial error approach and a lot of googling... snip I don't think it is stupid at all. I have found myself sometimes frustrated at white text boxes with no borders on white backgrounds making it almost impossible to see where to click to enter the field. Thanks for bringing it to the fore - John ___ X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev