Skip to content

Latest commit

 

History

History
258 lines (175 loc) · 7.07 KB

customize.rst

File metadata and controls

258 lines (175 loc) · 7.07 KB

Customizing LibreCAD's Interface

In addition to be able to move and reorganize menus and toolbars <app-layout>, LibreCAD can be customized with user-defined pop-up menus, custom toolbars and alternative "window decoratons".

Menu Creator

The Menu Creator is used to create, modify, or delete custom pop-up menus. The pop-up menu is actived by using the mouse assigments described below. Open the Menu Creator by selecting Options -> Widgets -> Menu Creator

html

latex

To create a new menu:

  1. Input a name for the menu into the Name drop-down box.
  2. Select an action from the left-hand list and use the right arrow (or double-click on the action) to add it to the new menu (right-hand list).
  3. Drag and drop the items on the right-hand list to arrange the actions in the menu.
  4. Click the Create button.

To edit an existing menu:

  1. Select the menu from the Name drop-down box.
  2. Add additional items as described above.
  3. To remove an item from the menu, select an action from the right-hand list and use the left arrow (or double-click on the action) to remove it from the menu.
  4. Drag and drop the items on the right-hand list to arrange the actions.
  5. Click the Update button.

To delete an existing menu:

  1. Select the menu from the Name drop-down menu.
  2. Click the Destroy button.

html

latex

A custom pop-up menu needs to be assigned to a mouse button to make them accessible:

  1. Click the Assign button
  2. Enable one or more of the activators ("Double-Click", "Right-Click", "Ctrl-Right-Click", and / or "Shift-Right-Click") with a check in the check-box.
  3. Click the Save button

Toolbar Creator

Custom toolbars can be created, modified and deleted using the Toolbar Creator. From the menubar, select Options ->Widgets -> Toolbar Creator.

html

latex

To create a new toolbar:

  1. Input a name into the Name drop-down box
  2. Double-click on an action to add it
  3. Drag and drop to arrange actions
  4. Click the Create button

To modify an existing toolbar:

  1. Select the toolbar from the Name drop-down box
  2. Double-click to remove actions
  3. Drag and drop to arrange actions
  4. Click the Create button

To delete an existing toolbar:

  1. Select the toolbar from the Name drop-down box
  2. Click the Destroy button

Widget Options

html

latex

"Widgets" in this context refer to appearance of LibreCAD's border and title bar, icons and the statusbar. Select Options - > Widget Options from the menubar to change these options. The following options are available for:

  • General: LibreCAD's application window decorations (borders, buttons, etc.) and permits the use of custom style sheets (see below).
  • Toolbar: change the Theme and size of the toolbars' icons.
  • Statusbar: change the height of the statusbar and the size of the font used.

To enable an option, place a check in the checkbox and specify the desired option.

Style Sheets

In “Widget Options” you can also choose a style; the style list is dependent on your operating system and the version of Qt used to build LibreCAD. For example on Windows 7 and using Qt 5 the list is: ("Windows", "Fusion"). More information can be found at http://doc.qt.io/qt-5/stylesheet.html and http://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/

Any style of a “Style Sheet” can be modified, but it is recommended that the “Fusion” style (Qt 5) be used as a base, because it is intended to be a cross platform style. After setting a style sheet you can edit it & save and then switch back to LibreCAD and use “Reload Style Sheet” (Ctrl+T).

Tips:

  • Start with the example below to obtain and understanding of how style sheet affect the appearance of LibreCAD.
  • Look at the examples for “Color” and “Gradient” in the list of property types.
  • Check out the widget specific examples at: http://doc.qt.io/qt-5/stylesheet-examples.html

Example

A style sheet can be as simple as:

QMenu { font-size: 16px; }

Or as a more complex example, save the following text as alpha.qss or alpha.txt, and then load the file with Options -> Widget Options -> Style Sheet:

/* alpha.qss v.01 a modification of the Fusion style */

/* Layer List */
QTableView
{
    selection-background-color: #ccffcc;
    selection-color: Blue;
    font-size: 16px;
    font-family: "Arial";
}

QMenu 
{
    padding: 4px;
    font-size: 16px;
}

QMenu::item 
{
    padding: 2px 25px 2px 20px;
    border: 1px solid transparent; /* reserve space for selection border */
}

QMenu::item:selected 
{
    border-color: darkblue;
    background: rgba(240, 255, 255, 150);
}

QMenu::icon:selected 
{
    border-color: darkblue;
    background: rgba(255, 255, 255, 255);
}

QToolBar 
{
    background-color: rgb(230, 230, 230);
    spacing: 3px;
    padding: 4px;
}

QToolButton 
{
    background-color: #eeeeee;
    border-style: outset;
    border-width: 2px;
    border-radius: 2px;
    border-color: beige;
    font: 12px;
    padding: 2px;
}

QToolButton:checked 
{
    border-color: grey;
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                  stop: 0 #dadbde, stop: 1 #f6f7fa);
}

QToolButton:hover 
{
    border-color: grey;
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                                  stop: 0 #dadbde, stop: 1 #f6f7fa);
}

QStatusBar { background-color: azure;}

QMenuBar { background-color: #fefefe; }

QTextEdit { background-color: honeydew; }

QToolTip { background-color: white; }