Page 1 of 1

[solved] How to increase contrast of default scrollbar handles

Posted: Mon Oct 02, 2017 3:26 am
by Hunter2
I have used QCAD for many years and am very happy with it, but at present the scrollbar handles are very hard to see (see attachment).

I tried the "Dark" theme and got better contrast. I was also able to change the colors of the scrollbar handles.

I prefer the Default theme, and would like to increase the contrast of the scrollbar handles, but I haven't found a way to do so.

Is there a "Light" theme available or is there a way to change the default scrollbar handle colors?

OpenSUSE Leap 42.2
QCAD Version: 3.17.3.0 (3.17.3)
Build Date: Jun 30 2017
Revision: 9c7770f
Qt Version: 5.8.0
Architecture: x86_64
Compiler: gcc 4.8.1

Re: How to increase contrast of default scrollbar handles

Posted: Mon Oct 02, 2017 10:02 am
by andrew
You can easily create your own theme as follows:
- Add a directory themes/MyTheme to your QCAD installation directory
- Add a plain text file "stylesheet.css" into that folder
- To make the scrollbar handles red, add the following contents into that file:

Code: Select all

QScrollBar {
    background-color: transparent;
}
QScrollBar::handle {
    background-color: red;
}
QScrollBar::add-line, QScrollBar::sub-line {
    height: 0;
    width: 0;
}
To play around with other styles, have a look at themes/Dark/stylesheet.css or the stylesheet documentation at:
http://doc.qt.io/qt-5/stylesheet-syntax.html
http://doc.qt.io/qt-5/stylesheet-reference.html

Re: How to increase contrast of default scrollbar handles

Posted: Mon Oct 02, 2017 2:30 pm
by Hunter2
Thank you. That solved the problem.

I didn't know enough about Qt to realize that the stylesheet is just a modification and not a complete definition of the style.

It might be good to mention that the theme change requires a restart to take effect.