Mobileread
Custom toolbar
#1  Ashjuk 02-19-2021, 09:12 AM
Since working on the updated images for the Sigil user manual I have been toying with the idea of creating my own custom toolbar.

I have located the current icons at https://github.com/Sigil-Ebook/Sigil/tree/master/src/Resource_Files/main and have downloaded all the svg files.

I am fairly good at using CorelDraw and Photoshop so I can create any new icons (or modify existing) to suit, but it's the compiling bit that is the daunting bit - "You can use the command line to run rcc: rcc -binary -o PATH_TO_OUTPUT_FILE.RCC PATH_TO_QRC_FILE"

I have located and dowloaded qt-unified for Windows (but not yet installed) so I was wondering if one of the experts could do a simple tutorial as to how one goes about compiling all the svg files into the required .rcc file.

Thanks,
Ashley
Reply 

#2  BeckyEbook 02-19-2021, 10:25 AM
It's simple. It's best to do everything in a separate, external folder.

In "main" folder are *.svg files and important file: main.qrc
You can rename the main.qrc file with your own (ashjuk.qrc) to avoid confusion.

Important: It's best not to change ANYTHING inside the qrc file, because you don't need to.

Change your graphics while keeping the original svg file names.

After that, it is really enough to run the command rcc:
Code
rcc.exe --binary ashjuk.qrc -o custom_icon_theme.rcc
Copy your custom_icon_theme.rcc file to the Sigil settings folder.
You can find it easily by going to "Preferences" and pressing the button in the lower left corner of this window.

The last thing is setting "Custom icons" in "Preferences".

Restart Sigil and enjoy your own icons.

If necessary, repeat the last steps (rcc, copying the result file to the settings folder, restart Sigil).
Reply 

#3  KevinH 02-19-2021, 10:29 AM
BeckyEbook beat me to it and her reply is better!



You are talking about a custom IconTheme not a custom toolbar (I think).
If you look at our IconTheme repo you will see each theme has its own folder (ie. fluent, material, main, etc.

Inside each folder is a set of svg files whose names are important (and can not be changed as Sigil looks for those file names) and a file that ends in .qrc (ie. fluent.qrc, material.qrc,etc).

That qrc file gives the filename and path to every file in the icon theme.

If you have Qt installed it will come with a command line tool called "rcc.exe".

So to create your iwn icons, start by copying one of those folders, give the folder and the .qrc file a new name. Edit the contents of each svg file to your heart is content but do not add height and width to them as they should be freely rescalable svg.

Once you are happy with each svg file run the rcc.exe executable as shown in the IconThemes read me and point it at your new folder's .qrc file.

It will compile the resources into a binary file which you can copy to your Sigil Preferences folder and rename it as described in that ReadMe. Then once properly named and placed, open Sigil and use its preferences menu to tell it to use a custom icon theme and then close out of Sigil and relaunch.

They should appear in place of the normal Sigil icons.
Reply 

#4  Ashjuk 02-19-2021, 11:54 AM
Thank you both, I think I know what to do now.

You are right Kevin, I do mean a custom set of icons.

I was happy with the vector image part of the operation, but it was the "rcc.exe" bit I was not certain about. I assume that if I install the QT-Unified package I have downloaded it will have that executable?

I grew-up in the days of DOS so command line working holds no fears...
Reply 

#5  Thasaidon 02-20-2021, 08:30 PM
Quote Ashjuk
I grew-up in the days of DOS so command line working holds no fears...
Happy days
Reply 

#6  DiapDealer 02-20-2021, 09:44 PM
Quote Ashjuk
I assume that if I install the QT-Unified package I have downloaded it will have that executable?
I'm not familiar with the unified installer. Last time I downloaded a binary Qt installer, it was the full (huge) package for a particular version of Qt. The unified installer appears to be a small installer that will then download the rest of the necessary components depending on the options selected.

You SHOULD be able to get the rcc executable using the unified installer, but I don't know the particulars of how. Any version of Qt's rcc.exe up to and including 5.12.9 should work, but you won't be able to use an external compiled binary resource built with a version of rcc newer than the version of Qt that is currently shipping with Sigil.
Reply 

#7  Ashjuk 02-21-2021, 03:48 AM
Quote DiapDealer
I'm not familiar with the unified installer. Last time I downloaded a binary Qt installer, it was the full (huge) package for a particular version of Qt. The unified installer appears to be a small installer that will then download the rest of the necessary components depending on the options selected.

You SHOULD be able to get the rcc executable using the unified installer, but I don't know the particulars of how. Any version of Qt's rcc.exe up to and including 5.12.9 should work, but you won't be able to use an external compiled binary resource built with a version of rcc newer than the version of Qt that is currently shipping with Sigil.
Thanks, I will make sure any version I do use is compatible with Sigil.
Reply 

Today's Posts | Search this Thread | Login | Register