Updated Create custom themes for qBittorrent (markdown)

Prince Gupta 2020-10-19 09:42:33 +05:30
parent 092c91f87e
commit 5920535801

@ -1,25 +1,25 @@
# Introduction ## Introduction
This page contains the necessary information to get started developing custom themes for qBittorrent. They are supported since version 4.2.2. This page contains the necessary information to get started developing custom themes for qBittorrent. They are supported since version 4.2.2.
# What are .qbttheme files? ## What are .qbttheme files?
These are theme bundles for qBittorrent. These are theme bundles for qBittorrent.
They should contain all files required to support theming in qBittorrent and are packed using [Qt's Resource Compiler](https://doc.qt.io/qt-5/rcc.html). They should contain all files required to support theming in qBittorrent and are packed using [Qt's Resource Compiler](https://doc.qt.io/qt-5/rcc.html).
qBittorrent accesses files inside `.qbttheme` using [Qt's Resource System](https://doc.qt.io/qt-5/resources.html). qBittorrent accesses files inside `.qbttheme` using [Qt's Resource System](https://doc.qt.io/qt-5/resources.html).
Currently, qBittorrent only searches for a `stylesheet.qss` and `config.json` inside a `.qbttheme` file but you can also add your own custom resources (read more [here](https://github.com/qbittorrent/qBittorrent/wiki/Create-custom-themes-for-qBittorrent#using-custom-resources-with-bundles)). Currently, qBittorrent only searches for a `stylesheet.qss` and `config.json` inside a `.qbttheme` file but you can also add your own custom resources (read more [here](https://github.com/qbittorrent/qBittorrent/wiki/Create-custom-themes-for-qBittorrent#using-custom-resources-with-bundles)).
# How to create your own theme bundles? ## How to create your own theme bundles?
You can check out this Python script([here](https://github.com/jagannatharjun/qbt-theme/blob/master/Builds/make-resource.py)) for the easy creation of `.qbttheme` files. You can check out this Python script([here](https://github.com/jagannatharjun/qbt-theme/blob/master/Builds/make-resource.py)) for the easy creation of `.qbttheme` files.
At runtime, qBittorrent loads only `stylesheet.qss` to support theming and `config.json` which currently only manages GUI colors. You can include custom resources with your bundle files to use it with `stylesheet.qss` At runtime, qBittorrent loads only `stylesheet.qss` to support theming and `config.json` which currently only manages GUI colors. You can include custom resources with your bundle files to use it with `stylesheet.qss`
# Managing overall feel of GUI ## Managing overall feel of GUI
`stylesheet.qss` is a [Qt stylesheet](https://doc.qt.io/qt-5/stylesheet.html), which is basically custom CSS for Qt. `stylesheet.qss` is a [Qt stylesheet](https://doc.qt.io/qt-5/stylesheet.html), which is basically custom CSS for Qt.
You can read more about Qt stylesheet syntax [here](https://doc.qt.io/Qt-5/stylesheet-syntax.html). A reference is also available [here](https://doc.qt.io/qt-5/stylesheet.html). You can read more about Qt stylesheet syntax [here](https://doc.qt.io/Qt-5/stylesheet-syntax.html). A reference is also available [here](https://doc.qt.io/qt-5/stylesheet.html).
# Changing QBittorrent specific colors ## Changing QBittorrent specific colors
for changing qBittorrent specific GUI colors, you have to use config.json, NOTE: A large part of colors is already changeable from stylesheet but the following are QBitTorrent's specific context-sensitive colors, for changing qBittorrent specific GUI colors, you have to use config.json, NOTE: A large part of colors is already changeable from stylesheet but the following are QBitTorrent's specific context-sensitive colors,
```json ```json
@ -88,7 +88,7 @@ Here
This is introduced in qBittorrent v4.3.0 This is introduced in qBittorrent v4.3.0
# Using custom resources with bundles ## Using custom resources with bundles
qBittorrent uses [QResources::registerResource](https://doc.qt.io/qt-5/qresource.html#registerResource) to use the bundle file, you can imagine it like QBittorrent extracts bundle file in a special path which is `:/uitheme`, so every file should be referenced accordingly f.e let's see you have to change the image QRadiaButtons indicator, so to reference a `light/radio_button.svg` inside your bundle file, you should do something like this qBittorrent uses [QResources::registerResource](https://doc.qt.io/qt-5/qresource.html#registerResource) to use the bundle file, you can imagine it like QBittorrent extracts bundle file in a special path which is `:/uitheme`, so every file should be referenced accordingly f.e let's see you have to change the image QRadiaButtons indicator, so to reference a `light/radio_button.svg` inside your bundle file, you should do something like this
``` ```
QRadioButton::indicator:unchecked, QRadioButton::indicator:unchecked,
@ -100,11 +100,11 @@ QRadioButton::indicator:unchecked:focus
reserved files and their structure in bundle files are - `stylesheet.qss` and `config.json` both should occur at the root of your bundle file. reserved files and their structure in bundle files are - `stylesheet.qss` and `config.json` both should occur at the root of your bundle file.
# Changing icons of GUI ## Changing icons of GUI
Starting with v4.3.0 you can change the icons of GUIs too, you just have to include your icons in the theme bundle under icons prefix. Icon name should be the same as the originals icons. See all the icons here (https://github.com/qbittorrent/qBittorrent/tree/master/src/icons) Starting with v4.3.0 you can change the icons of GUIs too, you just have to include your icons in the theme bundle under icons prefix. Icon name should be the same as the originals icons. See all the icons here (https://github.com/qbittorrent/qBittorrent/tree/master/src/icons)
# Notes ## Notes
Following way of changing TransferList row's color is removed after version 4.2.5, please change you bundle files accordingly and For changing Transferlist row's color one should use `config.json` Following way of changing TransferList row's color is removed after version 4.2.5, please change you bundle files accordingly and For changing Transferlist row's color one should use `config.json`