arc-kde icon indicating copy to clipboard operation
arc-kde copied to clipboard

QSS Stylesheet?

Open polarathene opened this issue 8 years ago • 13 comments

I'm not familiar with theming enough to know if qss stylesheets would be useful enough or not, but some applications like SMPlayer seem to be able to use them to make similar changes that the active DE theme would do such as a windows background.

In my case I prefer a light theme but for some apps to have a dark theme. I was able to use Breeze Light and have SMPlayer use the PapirusDark theme, but it would not look like the screenshot. Turns out that you can create a style.qss file to place in the themes directory and get a dark styled app.

I'm not aware of any other way to apply a theme to an app different from the active one used for the rest of the DE/apps. I suggest it here as it may be useful for some other apps other than SMPlayer, users could then use the file maintained in this repo.

polarathene avatar Jul 22 '17 09:07 polarathene

Theme contained only icons - not window colors, gradients, styles and etc... For SMPlayer you can choose style on preferencies. For Plasma desktop i recommend set KVANTUM. For GTK DE > GTK+

varlesh avatar Jul 22 '17 10:07 varlesh

@varlesh Ah ok. I have Breeze set as style in preferences, there isn't a Breeze Dark option, I think it only uses my active theme unless I override with QSS. So to have a dark theme applied when using a light theme only seems possible with QSS method.

Is this the only colours for theme that Arc applies?

polarathene avatar Jul 22 '17 10:07 polarathene

Smplayer use .RCC files for skin - it's binary contained only PNG files and not support SVG or other vector images. Also nonKDE apps not support kde color scheme - it's imposibble. SMPlayer it's not KDE app. If you want use another colors for SMPlayer icons you can change sources on SVG's and make new theme for your self or use imagemagick tool for colorize

varlesh avatar Jul 22 '17 11:07 varlesh

For skin use Base interface or Mini, set this on preferencies: 2017-07-22 15-42-28

varlesh avatar Jul 22 '17 11:07 varlesh

@varlesh Yes I know how to apply it, perhaps you misunderstand.

I am not asking for SMPlayer theme, but QSS file that SMPlayer theme and other Qt app can use for styling differently than active theme. On KDE I have Breeze Light, but I want to have dark theme for SMPlayer(and some other apps), this can be done with QSS for Qt apps. So Arc theme colours in a styles.qss file could also support theming specific apps with Arc colours.

This is the reddit thread and specific comment about QSS that I am referring to. And you can see on Breeze Light, with the sample QSS provided there, I get SMPlayer look like this with Style: Breeze and Icon set: PapirusDark in SMPlayer settings. Better QSS styling and it might look more like their theme preview even though I use a light theme for everything else.

polarathene avatar Jul 22 '17 12:07 polarathene

Ok i understand you want use style as on elementaryOS, where all apps have light colorscheme, but some other apps (audience and terminal) use dark. Colors available on color-schemes directory or on Kvantum theme. QSS have option for application list or this applied only for all apps?

varlesh avatar Jul 23 '17 03:07 varlesh

style.qss created on Smplayer theme directory or on main system icon theme?

varlesh avatar Jul 23 '17 03:07 varlesh

@varlesh I haven't tried it with any other apps yet. For SMPlayer, using launch options like smplayer -stylesheet=/path/to/file.qss does not work(it does with dolphin and I guess most other Qt apps).

I added the style.qss file into the PapirusDark Icon set and it seems to apply that automatically, obviously this would not be ideal for people that just expect icon theme and their system window theme to apply to SMPlayer.

For those who want to use QSS, they'd normally just use the stylesheet option when launching the app I think, or in SMPlayer case, copy the QSS file to a Icon theme.

For clarity, I placed the file at /usr/share/smplayer/themes/PapirusDark/style.qss. In SMPlayer settings, the Icon set is PapirusDark, the Style drop down beneath that is Breeze(there is no Breeze Dark listed here).

polarathene avatar Jul 23 '17 06:07 polarathene

On oficial smplayer PPA compiled with Qt4, maybe this happened because non-Qt5 app... Try another player, for example QMPlay2 - he have option use system icon theme and compiled with Qt5 by default

varlesh avatar Jul 23 '17 07:07 varlesh

@varlesh I'm confused what your comment is about.

I use KDE with light/white theme. Only for a few apps like SMPlayer, I want the app to use dark/black theme. style.qss file allow this, like I describe above.

This issue makes suggestion for style.qss file for this theme that user can use for apps if they want to. No bug, nothing wrong happen.

polarathene avatar Jul 23 '17 17:07 polarathene

Sorry my English, it's not my language ) I mean if smplayer compiled with Qt4 maybe it's cause.. Maybe stylesheet worked only with Qt5. I don't know. Also KWin have option for use another titlebar colorscheme for needed apps - it's another solution: image And third, i'm not programmer or developer KWin or SMplayer and i don't know why this not worked.

varlesh avatar Jul 23 '17 18:07 varlesh

@varlesh

Maybe stylesheet worked only with Qt5. I don't know.

Are you saying it is not working for you? It works for me with SMPlayer if I place the style.qss file in the PapiprusDark theme directory using the sample QSS text from the reddit link.

Also KWin have option for use another titlebar colorscheme for needed apps - it's another solution:

That can only affect the titlebar.


Nothing is wrong or broken for me. I only suggest for arc-kde repo to include a style.qss file with theme colors, this allow a user to style specific Qt app with arc-kde themes while using another theme like Breeze Light.

polarathene avatar Jul 24 '17 02:07 polarathene

A style.qss (and style.qrc) would be much appreciated as well for using with PyQt / pyside. The pip and conda installs are pre-built wheels so only come with Fusion and Windows as themes. Even installing python3-pyqt5 from apt gets the right colours but retains the overall Fusion style. Be amazing if could:

import arc-kde
app = QtGui.QApplication()
app.setStyleSheet(arc-kde.load_stylesheet())

For example, see QDarkStyleSheet.

abers avatar Jan 08 '18 11:01 abers