Changing the color of scroll bars

You can test with this code in Tools->Scripts->Scripter:

from krita import *

stylesheet = \
"""
QScrollBar {
    background: #00ff00;
}
QScrollBar::handle {
    background: #0000ff;
}
"""

qApp.setStyleSheet(stylesheet)

It should make all of Krita’s scrollbars’ backgrounds green, and handles blue.
Note that according to Qt’s docs, all properties must be set, so you can’t only have the “handle” part or it won’t work. See Qt Style Sheets Examples | Qt Widgets 5.15.16 for more info and examples.

You can tweak the colors, then save the style sheet as a text file and use my Style Sheet Loader Extension to have it load automatically on startup.

5 Likes