Plugin: Style Sheet Loader Extension

Style Sheet Loader: This plugin allows to load a Qt Style Sheet and apply it to Krita’s UI. The style sheet’s filepath can be remembered and automatically loaded on startup.

Loading an example stylesheet, before (regular UI):

After, with custom styling. (I didn’t have or make a proper stylesheet to test with, so this is just randomly-pasted-together example code. Sorry it looks so ugly!):


This shows off various things stylesheets can do, like modifying colors by widget type and using rounded edges.

See Qt’s Style Sheet documentation for more details on using Style Sheets.

Links:

Code repository: Freya Lupen / Style Sheet Loader Extension · GitLab
Zip file download: https://invent.kde.org/freyalupen/style-sheet-loader-extension/-/archive/master/style-sheet-loader-extension-master.zip

22 Likes

Does it mean transforming Qt Style Sheet into krita’s “theme”?

I made a theme, to match Krita’s default color scheme :slight_smile:

Krita Dark

7 Likes

I’ll be sure to drop the Blender style I made in QSS for FreeCAD once I rework it. It has all sorts of bugfixes for FreeCAD’s UI in the template I used, but the FreeCAD devs are fixing those on their end, so I should be able to clean it up.

What’s the best way to modify a stylesheet and preview the results for Krita? Thusfar, I just used VS Code, but that can’t be the most efficient way.

Gimme the background texture of your canvas.
Gimmmeeeeeeeeeeeeeeeeeeeeeee !! Waaaaaant iiiit !! :crazy_face: :crazy_face:
:palm_down_hand: :palm_down_hand: :palm_down_hand:


It looks really nice.

1 Like

Hello! freyalupen.
Thank you for create the plugin.
Since I had been tried and error some customize because I had a bit frustrated with the UI. Modify regarding color contrast and color scheme of UI elements,scroll bar color changing, tab design .
It’s also good to use with Theme creator extension.

Following Images are work in progress.



3 Likes

3 Likes

THIS IS NOT ABOUT @freyalupen’s PLUGIN, IT IS ABOUT THE SOFTWARE BEHIND THE LINK FROM @Awez.

WARNING!!!

That software from “hustlei” you linked to, at least the Windows Executable, has 7 hits on VirusTotal. :frowning: :frowning: :frowning:
It may be a false positive, because the reporting scanners are more or less unknown ones, but 7 hits is a VERY BIG WARNING-SIGN.

The Python version, which you can obtain as a ZIP archive, has no hits and should therefore be preferred.
Unfortunately, most people will opt for the executable version because they do not know how to use Python software. :frowning:

It may be better to remove that link, to protect those who click on every link, and open every executable, without thinking about the consequences first!

Michelist

3 Likes

Just removed the post, I apologize for any harm it may have caused. I was excited to see the post and wanted to contribute in some way, I never would’ve posted it if I had known there was a risk of malicious code in the Windows executable of it

1 Like

Do not worry about it. If you have a safe link post that instead. You can edit your post. No problem please do keep sharing things.

1 Like

Thanks for the plugin @freyalupen

Played a bit with the values:

Is it possible to have rounded selection-background in the QDoubleSpinBox and QComboBoxListView menus? - I couldn’t figure out how to. ^^’

2 Likes

Esto se ve muy bien!

1 Like

I was curious to analyze the executable and although at first I also marked that it was recognized 7 times when I reanalyzed it now only had 5, possibly it is a false positive.

Even so, I found an alternative that is a little simpler but can work very well:

2 Likes

This is pretty awesome. Will you share it?

2 Likes

Thanks, here you go:

2 Likes

Added some lines to replace the string [path] with same as the qss file location.
At first I tried to make a gui option to select the images path, but I don’t really know what I’m doing and quickly got lost. :sweat_smile:

3 Likes

Interesting! Thinking about it, I figured there’s probably a more “proper” way to do this, and found it’s possible to add paths to Qt’s resource paths.

A little example script:

from krita import *

path = Application.getAppDataLocation()

QDir.setSearchPaths("stylesheet", [path])

qApp.setStyleSheet("""
QCheckBox::indicator:unchecked {
    image: url(stylesheet:patterns/24-dynamic-screentone-B.png);
}
""")

So,

  • I’ve updated the plugin to set the stylesheet: path to the same folder as the style sheet by default.

(This way requires a colon at the end, so there’s no way to make it compatible with the [path] way.)

It would be possible to have multiple prefixes each with multiple paths, but the UIX of configuring that would take some thought. Plus it might be a bit more overcomplicated than necessary.

3 Likes

That’s great! I will update my stylesheet. :+1: Thank you

The plugin is not compatible with another plugin(Touchify ) and does not automatically load the qss file every time。

1 Like

@freyalupen
I made a version of my style sheet-theme to work better with other dark color themes.
It’s using the same QPalette color labels as the theme creator plugin, together with a multiplier value:

border-color: QPalette.ButtonText(1.09)
background-color: QPalette.ToolTipBase(1.17, 0.40) //  multiplier and alpha value

Used LLM chat bots to alter your script, to have it apply the colors by either multiplying the rgb values or multiplying the lightness in hsl values.
Should I share the altered script or would you prefer to implement it properly yourself?
(Alternatively I could share the output qss for various color themes instead.)


Krita dark orange theme:

Some other themes:

Style sheet:

2 Likes