├── README.md ├── compile.bat ├── legacy-qBittorrent.qbtheme ├── make-resource.py ├── style.qss └── tools └── rcc.exe /README.md: -------------------------------------------------------------------------------- 1 | # legacy-qBittorrent 2 | 3 | This is a very minimal qbtheme for qBittorrent that brings back the compact layout for the transfer list from pre-4.2.2. 4 | 5 | ## Downloading 6 | 7 | Get the .qbtheme file from this repo by cloning it or from the [Releases](https://github.com/FoxInFlame/legacy-qBittorrent/releases) page. 8 | 9 | ## Compiling (Windows only) 10 | 11 | With a python3 executable called `python`, run `compile.bat`. 12 | 13 | ## Making Your Own Styles 14 | 15 | Due to the minimal nature of this repository, it also serves as a useful starting point for new theme developers. Here's what you need to know about qBittorrent theming: 16 | 17 | - `.qbtheme` files are binary resource packages for Qt, and they are compiled using the Resource Compiler (`rcc`) tool. 18 | - `make-resource.py` (by @jagannatharjun) is a wrapper for `rcc` specifically designed for qBittorrent, which makes compilation as easy as calling the python file with input and output file arguments. 19 | 20 | To get started with making your own style: 21 | 22 | 1. `git clone` this repository to your file system. 23 | 2. Edit `style.qss` to your liking. Although I haven't tried, you can certainly include custom icon assets to your compilation. Take a look at other developers for examples. 24 | 3. Compile using `compile.bat`. 25 | -------------------------------------------------------------------------------- /compile.bat: -------------------------------------------------------------------------------- 1 | python make-resource.py -output legacy-qBittorrent -style style.qss -------------------------------------------------------------------------------- /legacy-qBittorrent.qbtheme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FoxInFlame/legacy-qBittorrent/6e5f6f7426fe842da5394215fa28e7aa249850ed/legacy-qBittorrent.qbtheme -------------------------------------------------------------------------------- /make-resource.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import glob 3 | import argparse 4 | import os.path 5 | import sys 6 | import fnmatch 7 | import re 8 | 9 | def allFiles(glob): 10 | [dir, pattern] = os.path.split(glob) 11 | l = list() 12 | for root, subdir, files in os.walk(dir): 13 | l.extend([os.path.join(root, x) for x in files if fnmatch.fnmatch(x, pattern)]) 14 | return l 15 | 16 | parser = argparse.ArgumentParser(description='helper to create qbtthemes') 17 | parser.add_argument('-output', type=str, help='output qbtheme file', default='style.qbtheme') 18 | parser.add_argument('-style', type=str, help='stylesheet', required=True) 19 | parser.add_argument('-base-dir', type=str, dest='baseDir', default='.') 20 | parser.add_argument('-dir-prefix', type=str, default='', dest='dirPrefix', help='prefix added to all files') 21 | parser.add_argument('-find-files', action='store_true', dest='findFiles', help='find files included in qss and only include those') 22 | parser.add_argument('files', metavar='files', type=str, 23 | nargs='*', default=['*'], help='files to include in resources from baseDir, supports glob patterns') 24 | 25 | args = parser.parse_args() 26 | 27 | if not args.output.endswith('.qbtheme'): 28 | args.output += '.qbtheme' 29 | 30 | if os.path.exists(args.output): 31 | print("WARNING! %s already exists. overwriting" % (args.output)) 32 | 33 | 34 | files = allFiles(os.path.join(args.baseDir, '*')) 35 | if args.findFiles: 36 | print('finding files') 37 | args.files = [] 38 | stylesheet = open(os.path.join(args.baseDir, args.style)).read() 39 | for f in re.findall(':\/uitheme\/(.*)\)', stylesheet): 40 | args.files.append(f) 41 | 42 | 43 | ResourceFiles = list() 44 | for f in files: 45 | alias = os.path.relpath(f, args.baseDir) 46 | for i in args.files: 47 | if fnmatch.fnmatch(alias, i): 48 | ResourceFiles.append((alias, f)) 49 | print('adding ' + f) 50 | break 51 | 52 | with open('resources.qrc', 'w') as rcc: 53 | rcc.write('\n') 54 | rcc.write('\t\n' % ('prefix=\'' + args.dirPrefix + '\'' if args.dirPrefix else '')) 55 | rcc.writelines(['\t\t%s\n' % x for x in ResourceFiles]) 56 | rcc.write('\t\n') 57 | rcc.write('\t\n') 58 | rcc.write('\t\t%s\n' % (os.path.join(args.baseDir, args.style))) 59 | rcc.write('\t\n') 60 | rcc.write('') 61 | 62 | 63 | cmd = [os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tools/rcc'), '-binary', '-o', args.output, 'resources.qrc'] 64 | print(' '.join(cmd)) 65 | 66 | if not subprocess.call(cmd): 67 | os.remove('resources.qrc') 68 | -------------------------------------------------------------------------------- /style.qss: -------------------------------------------------------------------------------- 1 | QTreeView::item { 2 | height: 16px; 3 | } 4 | 5 | QListView::item, 6 | QTableView::item, 7 | CategoryFilterWidget::item, 8 | TagFilterWidget::item { 9 | height: 18px; 10 | } 11 | -------------------------------------------------------------------------------- /tools/rcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FoxInFlame/legacy-qBittorrent/6e5f6f7426fe842da5394215fa28e7aa249850ed/tools/rcc.exe --------------------------------------------------------------------------------