Page 1 of 1

Customize Gui with Plugin

Posted: Tue Oct 01, 2019 12:42 pm
by moppi
Hello,

Is it possible to customize the default GUI of QCAD with a plugin?
I want to:
- hide menu entries
- hide buttons / buttonbars / widgets

Result should be a customized default gui of qcad.

Best regards

Moppi

Re: Customize Gui with Plugin

Posted: Tue Oct 01, 2019 2:44 pm
by andrew
Yes, you can do that from either a plugin or a simple script.

Example script to hide the tool Draw > Line > Freehand Line:

File: scripts/Misc/MyCustomUI/MyCustomUI.js

Code: Select all

function MyCustomUI() {
} 

MyCustomUI.init = function() {

    // hide the tool Draw > Line > Freehand Line

    // hide tool from menu:
    RSettings.setValue("LineFreehand/VisibleInMenu", false);

    // hide tool from line tool bar:
    RSettings.setValue("LineFreehand/VisibleInToolBar", false);

    // hide tool from CAD tool bar at the left:
    RSettings.setValue("LineFreehand/VisibleInCadToolBar", false);

    // hide tool from tool matrix (View > Toolbars and Widgets > Widgets > Tool Matrix):
    RSettings.setValue("LineFreehand/VisibleInMatrixPanel", false);
};

Re: Customize Gui with Plugin

Posted: Tue Oct 01, 2019 5:44 pm
by moppi
Hello,

thank you very much.
Is there any overview to take a look what you can change with "setValue"?
I used scripts-directory to take a look, but maybe there is a list for it.

Is it possible to change application name too?

Best regards

moppi

Re: Customize Gui with Plugin

Posted: Sat Nov 16, 2019 3:21 am
by John Hyslop
Hi Andrew

Love the ability to be able to switch off tools I may never use or rarely use, so I'm going to
just switch off the toolbar items and leave the menu in case I need to use at some time..

I have these 2 lines that now switch off the Clip Rectangle & Edit Text but I'd like to know if
there is a list somewhere with these values as I pretty much guessed the clip rectangle one
by trying ClipRectangle then ClipRect then ClipToRectangle... is there any documentation
available for these settings on toolbars? these work for me below, added to your JS file MyCustomUI.

// hide tool Edit Text From Toolbar
RSettings.setValue("EditText/VisibleInToolBar", false);

// hide tool Clip Rectangle From Toolbar
RSettings.setValue("ClipToRectangle/VisibleInToolBar", false);
};

Cheers
John