Qcad Theme Designer

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Qcad Theme Designer

Post by petevick » Fri Jun 04, 2021 9:25 am

See here for latest versions - https://www.qcad.org/rsforum/viewtopic. ... 295#p37339

Qcad Theme Designer v1.0
See below for a new version - https://www.qcad.org/rsforum/viewtopic. ... 765#p33765

Qcad Theme Designer is a radical redesign of the graphical user interface of Qcad User Theme (QUT).

It works in exactly the same way as QUT, it produces exactly the same stylesheets, and will edit any stylesheet created by QUT. It uses all of the same buttons as QUT, although these are now contained in a 'toolbar' area across the top of the app. The colour buttons are still accessed from the four tabs. The BIG difference is that in Qcad Theme Designer the entire Preview is constantly displayed, You'll notice that as you click on each tab various group boxes in the Preview area become 'highlighted', this is to accentuate which area of the Preview each tab manages (see the gif below). So you can now see how all the elements look simultaneously after a colour change, without having to click through the tabs.

CopyQcad.png
CopyQcad.png (17.29 KiB) Viewed 11467 times
There is a new Copy to Qcad button at the top right of the app. This enables you to copy the current stylesheet folder to the Qcad theme folder. Click on the button and a Select Folder dialogue is displayed, select the Qcad themes folder.
  • In Linux the path will be something like /home/username/opt/qcad-3.26.3-pro-linux-qt5.14-x86_64/themes
  • In Windows the path will probably be C:\Program Files\QCAD\themes
The current stylesheet folder is then copied into the Qcad's themes folder, allowing you to use this theme in Qcad. The current stylesheet doesn't change location. If the folder already exists in the themes folder, a dialogue box will ask if you want to overwrite or cancel.
In Windows you will need Admin rights to use the Copy to Qcad function. See the Installation section below for details.

Installation
Download the appropriate zip file for your particular operating system. Extract the Qcad Theme Designer folder in the zip file to anywhere that you have permission to read and write to on your system.

For Linux installations there is an additional file in the zip folder called QcadThemeDesigner.desktop. This is a desktop launcher. You can copy or extract this to your desktop, but you MUST complete the following two actions after you have copied it to your desktop.....
  1. Now the file is on your desktop the .desktop file extension will no longer be visible. Right click on the file, select Properties and in the Command field, edit the /home/username/ part to reflect where on your system you have placed the 'Qcad Theme Designer' folder. To change the icon, click on it and browse to the Qcad Theme Designer folder and select the QcadThemeDesigner.png icon.
  2. Still in the Properties window, click on the Permissions button at the top and make sure 'Allow executing file as program' is checked, this part is is essential for the launcher to work.
For Windows users the new Copy to Qcad function requires that you or this app have Admin rights. You have two options....
  1. Right click on the QcadThemeDesigner.exe and select Properties. Click on the Compatibility tab and check the 'Run this program as an Administrator' option. At the 'Do you want to allow this app from an unknown publisher to make changes to your device' select 'Yes'. If you are not happy with doing that then use option 2.
  2. Copy the stylesheet manually, you will still get a UAC dialogue asking you to allow the copy.
Qcad Theme Designer is offered as an alternative to Qcad User Theme, use which ever one suits you.

A huge thank you to forum member John Hyslop who's been badgering me to do this since I started QUT.
I was sceptical as I thought it wouldn't be possible, but the more I worked on QUT, the more convinced I became that it might work.
Personally, I like Qcad Theme Designer now more than QUT!!.

Screenshots of Qcad Theme Designer v1.0 in Linux and then Windows.
Qcad Theme Designer v1 Linux.png
Qcad Theme Designer v1 Linux.png (186.71 KiB) Viewed 11467 times
.
Qcad Theme Designer v1 Windows.png
Qcad Theme Designer v1 Windows.png (103.96 KiB) Viewed 11467 times

GIF of Qcad Theme Designer showing Auto Fill and Preview highlighting in action.
Tabs.gif
Tabs.gif (1.97 MiB) Viewed 11467 times
v1.0 Linux 64bit downloaded 19 times
v1.0 Linux 32bit downloaded 16 times
v1.0 Windows 32bit downloaded 20 times

See below for new version - https://www.qcad.org/rsforum/viewtopic. ... 765#p33765
Last edited by petevick on Thu Jun 02, 2022 8:57 am, edited 4 times in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Fri Jun 25, 2021 4:54 pm

Qcad Theme Designer update, version 2.0

see below for a new version - viewtopic.php?f=30&p=34179#p34179

Version 2.0 introduces major changes and a couple of bug fixes, all as listed below.

Many changes have been made to the code that you will obviously never see, but these changes equate to Qcad Theme Designer running more efficiently, and will also, hopefully, make it easier to use. There have been no visual changes to this version.

** Changes **
  • An asterisk will be displayed at the end of the filename field and also to the Save button. This indicates that changes have been made to the stylesheet and that it should be saved to avoid the loss of those changes.
    .
  • Pop-up message dialogues now display centrally in the main app window. This is a more common way to display them.
    .
  • The number of pop-up message dialogues has been significantly reduced.
    .
  • The way the stylesheet is handled internally has been changed making it quicker.
    .
  • The New button has been renamed Reset, as this better describes its function.
    .
  • Apart from the Undo/Redo buttons, there are now no disabled buttons at any time.
    .
  • The whole of the Undo/Redo coding has been re-written making the function much quicker.
    .
  • Any change to the check icon colour drop down list is now saved in the Undo/Redo buffer.
    .
  • The Undo/Redo buffer has been increased from 100 to 210, this allows for four full AutoFill operations to be carried out and Undone.
    .
  • The check icon colour can now be changed at any time, even after a Reset.
    .
  • The backup coding has been totally re-written. There is now just one backup made named stylesheet.bak, if the Backup file checkbox is checked, the backup is written each time you click Save. Any old backups named stylesheet(1..2..3).css will be automatically deleted.
** Bug Fixes **
  • After starting Qcad Theme Designer the main window now displays before any pop-up message dialogues.
    .
  • The Combo box drop down list selection font was not being written to.

A massive thank you to forum member John Hyslop, for all the testing he's done to get QTD to this level, it's a thankless task, cheques in the post mate!

v2.0 Linux 64bit downloaded 23 times
v2.0 Linux 32bit downloaded 25 times
v2.0 Windows 32bit downloaded 27 times
Last edited by petevick on Thu Jul 29, 2021 11:25 am, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

John Hyslop
Premier Member
Posts: 473
Joined: Mon Sep 30, 2019 6:21 am
Location: Melbourne - Australia

Re: Qcad Theme Designer

Post by John Hyslop » Sat Jun 26, 2021 7:39 am

Hi Pete

What can I say, a huge thank you for your contribution, your cheque cleared today :D
and I bought myself something with it "I had to put a bit in myself but it covered most of it.."
Thank you sooo much...
Smarties.png
Smarties.png (273.97 KiB) Viewed 10759 times
Cheers
John
IF IT IS TO BE IT IS UP TO ME [ Ten most powerful 2 letter words ]

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Thu Jul 29, 2021 11:21 am

Qcad Theme Designer update, version 2.5.5

Version 2.5 introduces a few changes and one bug fix, all as listed below.

** Changes **
  • The configuration file location has been changed to conform to the operating system default location. For Linux this is
    /home/user name/.config/QcadThemeDesigner
    For Windows this is
    C:\Users\user name\AppData\Roaming\QcadThemeDesigner\.
    The Linux configuration file extension is .conf and Windows is .ini.
    When first run, Qcad Theme Designer will automatically create the required folder and configuration file according to which operating system you are running. The old configuration file will also be deleted.
    .
  • A Config button has been added, this reloads the configuration file if one exists. This can be useful if you get in a mess with undo/redo's, it saves you closing the app without saving and then reloading.
    .
  • The folder name that the current stylesheet resides in is now displayed in the Application caption.
    .
  • the * has been removed from the Save button and appended to the Application caption.
    .
  • All message pop-ups have been totally re-coded, and they now display a caption relative to the message.
    .
  • The button on all single choice message pop-ups has changed from OK to Close.
    .
  • The buttons on some multi choice message pop-ups has changed from Yes/No to OK/Cancel.
    .
  • The Exit button has been renamed to Quit to bring it inline with what QCAD uses.
.
** Bug Fixes **
  • Clicking on Reset followed by changing the icon colour, if you then clicked AutoFill, the icon colour would reset to black.
This could well be the last update, barring any major bugs. I seem to have exhausted my ability to come up with any more additions. If anyone has any ideas for future additions or changes I would be more than happy to consider them.
So far I've hardly had any feedback, good or bad, this could be down to all the testing that John Hyslop has done for me, which I am forever grateful.

EDIT I've removed the attachments as I've found a 'bug', I'll add them back when it's fixed.

The bug was preventing AutoFill from working but has now been fixed, sorry for that. Attachments re-uploaded, version now at 2.5.5. Sorry for any confusion.

v2.5.5 Linux 64bit downloaded 62 times
v2.5.5 Linux 32bit downloaded 60 times
v2.5.5 Windows 32bit downloaded 77 times

Latest update below
Last edited by petevick on Sat Nov 27, 2021 5:04 pm, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Sat Nov 27, 2021 5:01 pm

Qcad Theme Designer update, version 2.5.6

Version 2.5.6 is mainly a bug fix, but with one addition, all as listed below.

** Additions **
  • Dark Blue icons added
** Bug Fixes **
  • The Disabled background label in the Combo Lists area was not being displayed correctly.
  • Line 203 of the stylesheet was being incorrectly saved.
  • The widths of some combo boxes in Qcad were only one character wide.
v2.5.5 Linux 64bit downloaded 4 times
v2.5.5 Linux 32bit downloaded 3 times
v2.5.5 Windows 32bit downloaded 4 times

Latest update below
Last edited by petevick on Mon Nov 29, 2021 8:37 am, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
lphilpot
Senior Member
Posts: 119
Joined: Mon Oct 30, 2017 4:03 am
Location: Deep South USA

Re: Qcad Theme Designer

Post by lphilpot » Sun Nov 28, 2021 11:22 pm

Pete,

Many thanks for this handy tool! I downloaded 2.5.6 from the links in your previous post, but FYI it still errors when Dark Blue is selected. There are no "Dark Blue" folder / icons in any of the zip files:

Code: Select all

[len@europa:160] ~/Downloads $ for each in *.zip; do unzip -l "$each" | grep do-not-delete | grep "Dark .*/$"; done
        0  2021-05-10 14:53   Qcad Theme Designer/do-not-delete/Dark Brown/
        0  2021-05-10 14:53   Qcad Theme Designer/do-not-delete/Dark Brown/
        0  2021-05-10 14:53   Qcad Theme Designer/do-not-delete/Dark Brown/
[len@europa:161] ~/Downloads $ for each in *.zip; do unzip -l "$each" | grep do-not-delete | grep "Blue/$"; done
        0  2021-05-23 12:52   Qcad Theme Designer/do-not-delete/Blue/
        0  2021-06-03 05:55   Qcad Theme Designer/do-not-delete/Steel Blue/
        0  2021-05-23 12:52   Qcad Theme Designer/do-not-delete/Blue/
        0  2021-06-03 05:55   Qcad Theme Designer/do-not-delete/Steel Blue/
        0  2021-05-23 12:52   Qcad Theme Designer/do-not-delete/Blue/
        0  2021-06-03 05:55   Qcad Theme Designer/do-not-delete/Steel Blue/
[len@europa:164] ~/Downloads $ for each in *.zip; do unzip -l "$each"; done | grep do-not-delete | cut -d/ -f3 | sort -u

Black
Blue
Brown
Cyan
Dark Brown
Green
Indigo
Orange
Red
Steel Blue
stylesheet.qss
Violet
White
Yellow
Creating the missing folder is simple enough (and modifying one of the other icons sets not difficult), but they're not there - At least in the files I got.

Thanks again.
Len
QCAD Pro

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Mon Nov 29, 2021 8:35 am

Qcad Theme Designer update, version 2.5.7

Version 2.5.7 is a bug fix

** Bug Fixes **
  • Added missing Dark Blue icons folder
Sorry for this omission, and thanks to lphilpot for bringing this to my attention.

v2.5.5 Windows 32bit downloaded 28 times
v2.5.5 Linux 64bit downloaded 29 times
v2.5.5 Linux 32bit downloaded 26 times
Last edited by petevick on Fri Jan 21, 2022 11:34 am, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Fri Dec 03, 2021 12:04 pm

This is a theme I've created with Qcad Theme Designer.
Google tells me the main background colour is called Nepal, so that's what I've called it :mrgreen:

Partial screenshot...
Nepal.png
Nepal.png (26.48 KiB) Viewed 7599 times
Attachments
Nepal.zip
(49.93 KiB) Downloaded 342 times
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Fri Jan 21, 2022 11:33 am

Qcad Theme Designer update, version 2.7

Version 2.7 is a significant update, it introduces quite a few additions together with a number of changes and bug fixes, all as listed below.
The main additions are Adjust AutoFill, this gives the ability to lighten or darken the colour that AutoFill uses, and Swap / Swap All buttons which allow you to invert the gradient colours.

ADDITIONS
  • Adjust AutoFill colour slider added to the right of the AutoFill button. This lightens or darkens the colour that AutoFill applies to the colour buttons.
    To use, simply adjust the value by moving the slider and click the AutoFill button. Positive numbers 1 to 6 will give lighter colours, negative numbers -1 to -12 will give darker colours. 0 is the default value. The slider value is saved to the stylesheet.css file.
    slider.gif
    slider.gif (88.24 KiB) Viewed 6946 times
    .
  • To compliment the Adjust AutoFill colour slider, a sample button has been added to the right. As the value of the slider is changed, the colour of the sample button updates to give an indication of the effect the slider value has when the AutoFill button is clicked. Hovering over and clicking this button also shows the AutoFill colours for those states.
    .
  • A Swap button has been added to all the gradient button top and bottom pairs
    .
  • A Swap All button has been added to the Push Button, Tool Bar and Tool Button tabs.
    swap.gif
    swap.gif (64.52 KiB) Viewed 6946 times
    .
  • A Stylesheet Basic Information button has been added. This displays basic information about the stylesheet such as which app created the stylesheet, the date/time the file was modified and the file size.
    .
  • The following keyboard shortcuts have been added...
    • Open - Ctrl+O
      Autofill - Ctrl+A
      Load Defaults - Ctrl+D
      Reload Config file - Ctrl+C
      Save to Qcad - Ctrl+Q
      Save - Ctrl+S
      File Info - Ctrl+I
      SaveAs - Alt+S
      About - Alt+A
      Quit - Alt+Q
    .
  • Animation has been added to the scroll bar handle, because why not?. e_geek
    .
  • The app name and version level is now saved with the stylesheet on the first line.

CHANGES
  • When opening a stylesheet you now no longer have to select the stylesheet.css file, just select or highlight the folder that the stylesheet resides in and click the Open button. If no stylesheet can be found, a message to that effect will be displayed.
    .
  • The current file field is now truncated to just the folder name, and, depending on the path length, is shortened at the beginning of the file path. The hint tip will display the full path.
    .
  • The widget background colour button size has been increased.
    .
  • The About and Quit buttons have been moved to accommodate the new Adjust AutoFill slider and sample button.
    .
  • Prior to this version, if there were any unsaved changes when you quit the app, a message gave two options to either quit or not. In this version you now have three options. The message displayed is 'Do you want to save the stylesheet ?', Yes will save and quit, No will quit, Cancel will close the message without quitting.
    .
  • Prior to this version when using SaveAs, you were tied to creating a new folder in the same path as the source folder. Now a 'Create or Open a Destination Folder' dialog is displayed that enables you to create a folder anywhere that has write privileges. Click on the 'Create Folder' (Linux) or 'New Folder' (Windows) button and enter the new stylesheet folder name, NOTE In Linux, you must now press the Enter button on your keyboard for the folder to be created, and then click on the 'Open' button.

    Note that in Windows you will get a 'Destination Folder Access Denied' message if you try to create a new folder in an Admin privileges path. You should click either Skip or Cancel as although you could create the folder, you would not be able to write into it.

    The current stylesheet will be saved into this new folder and will then become the active stylesheet. You can select an existing stylesheet folder, and you will have the option to overwrite.

FIXED BUGS
  • After clicking the Undo/Redo button when either the Undo or Redo buffer is at it's max, clicking the Cancel button in the warning massage still cleared the buffer.
    .
  • In Windows OS it was possible to get a write error when using either Save, SaveAs or CopyToQcad. A message to the effect that it's not possible to save or copy will now be displayed.
    .
  • Under certain conditions, particularly in Windows OS, an error could occur when accessing a read only folder.
v2.7 Linux 64bit downloaded 24 times
v2.7 Linux 32bit downloaded 23 times
v2.7 Windows downloaded 24 times
Last edited by petevick on Thu Feb 24, 2022 12:50 pm, edited 1 time in total.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

User avatar
petevick
Premier Member
Posts: 392
Joined: Tue May 19, 2020 9:34 am
Location: North Norfolk coast UK

Re: Qcad Theme Designer

Post by petevick » Thu Feb 24, 2022 12:48 pm

Qcad Theme Designer update, version 2.8

Version 2.8 is a moderate update, it introduces a few changes and bug fixes, all as listed below.

CHANGES
  • The system folder browser has quite a few disadvantages, so I've changed it for a custom folder browser. Apart from selecting a specific folder, this browser also allows you to rename , add or delete a folder. This can be done by either clicking the buttons in the toolbar, right click on a folder to display a context menu or via keyboard shortcuts (see below). Click the Select button or use the S keyboard shortcut to accept the selected folder. Click the Cancel button or press the keyboard Esc button to exit the browser with no selection. The browser window is sizeable and it's size is saved to the config file. The icons in the browser vary between the Linux and Windows versions as seen below.
    browsers.PNG
    browsers.PNG (70.63 KiB) Viewed 6478 times
    Toolbar button details....
    • folder-del-both.png
      folder-del-both.png (14.04 KiB) Viewed 6478 times
    • Click this button to Delete the selected folder, confirmation is required.
      You can also right click on a folder and select Delete from the context menu, or
      press the Delete keyboard button or Press the - numeric keyboard button.
      .
      folder-new-both.png
      folder-new-both.png (10.93 KiB) Viewed 6478 times
    • Click this button to create a New folder. A temporary folder is created in the selected folder, in Linux it's called 'Untitled Folder', in Windows it's called 'New folder', it'll be in an edit ready state, just start typing the name you want.
      You can also right click on a folder and select New Folder from the context menu, or use the N keyboard shortcut, or press the + numeric keyboard button.
      .
      folder-edit-both.png
      folder-edit-both.png (13.06 KiB) Viewed 6478 times
    • Click this button to Rename the selected folder. The name will enter the editing state, just type in the new name.
      You can also long double click on the folder name or right click on a folder and select Rename from the context menu, or use the R keyboard shortcut.
      .
    • Visual changes to the Adjust AutoFill slider, there was a display problem in Linux.
    FIXED BUGS
    • The app would hang when the Exit button was clicked if there was no named stylesheet loaded, and if the value of the Adjust AutoFill slider had been changed without clicking AutoFill
      .
    • An error would occur when using either Open, Copy to Qcad or SaveAs if a stylesheet was loaded that was saved by a version prior to 6.1, and if the value of the Adjust AutoFill slider had been changed without clicking AutoFill.
    See here for latest versions - https://www.qcad.org/rsforum/viewtopic. ... 295#p37339
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”