-
Notifications
You must be signed in to change notification settings - Fork 12
03‐ Ribbon design
When clicking on the button "Ribbon Design" in the Application menu, a Ribbon Design dialog will show up.
Please be aware that in order to get all the commands per toolbar and per workbench, all workbenches need to be loaded. This will result in a loading time of the menu. It can take a minute or two.
The dialog will modify the "RibbonStructure.json" file which is used to store the design of the ribbon UI.
The Ui is divided in 5 main sections:
- The button to generate or update the data file
- The tab bar
- Reset and restore buttons
- Dialog buttons
- Help button
Create or update the data file
In previous versions of the FreeCAD Ribbon, every workbench had to be activated during opening of the Layout dialog. This resulted in a long loading time. Now the first time the Layout dialog is opened, a datafile is generated which stores all the information needed to show all the commands with their icons. With this datafile activating every workbench is no longer needed, which reduces the loading time of the dialog.
Press the reload button when an update is needed.
Tab bar
With the tab bar you can select the different tabs
Reset and restore buttons
The restore button is used to restore the current "RibbonStructure.json" to a previous version. For this the backup function needs to be enabled.
With the reset button you can reset the ribbon to the initial design. For this the file "RibbonStructure_default.json" is used. See chapter "Scripts"on how to create your own "RibbonStructure_default.json" file.
Dialog buttons
The update button updates the "RibbonStructure.json" without closing the dialog.
The cancel button closes the dialog without updating "RibbonStructure.json".
The close button updates the "RibbonStructure.json" and closes the dialog. When changes are made, a dialog will be shown to ask you to restart FreeCAD.
This is the same dialog used with the addon manager.
Help button
This button opens the home page of this wiki in your default browser.
Import/Export functions
On the top left you find the functions to import and export the ribbon design file. This is the file "RibbonStructure.json". There are currently 5 functions:
- Import an entire layout.
- Export the current layout.
- Import custom panels.
- Import dropdown buttons
- Import layouts for specific workbenches
The file from which the import is done, can be either a complete RibbonStructure.json file or a json file that contains only the data that needs to be added or updated.
Set the initial position of custom panels
When you create a custom panel, its position is initially put at the end (right side) of the ribbon. Here you can set the position to the left if desired.
Note: This is only the initial position. After you have changed its position in the ribbon design tab, you have to change its position from the design tab always.
Set the default size of the buttons
You can set the button size for the buttons for:
- Every workbench
- Specific workbenches
- Specific panels. The section in the middle is used to set the icon for the workbenches. Select any workbench or "All". On the top set the dropdown button to the desired size and press generate.
On the right you can select any panel, select the desired size in the dropdown button and press generate.
Filter area The filter area can be used to shorten the list of commands. This can be helpful when searching for a command.
Add commands to the quick access toolbar
On the left you will see all commands with an icon that are present in FreeCAD. You can select multiple commands and add them to the list on the right by clicking on the right arrow. If you select a command on the list on the right and click on the left arrow, you remove the command from the quick access toolbar.
You can sort the commands on the quick access toolbar by select a command and click on the up and down arrows.
It is important to understand that all panels are based on FreeCAD toolbars. (Except for custom panels) This tab will show a list of panelss which can be excluded from being used for the ribbon.
Filter area
The filter area can be used to shorten the list of panelss. This can be helpful when searching for a command.
Exclude panels
You can exclude panels by selecting one or more panels from the list on the left.
Click on the right arrow, to exclude the selected panel(s).
Select an excluded panel and click on the left arrow, to include the toolbar again.
Include workbenches
You can include workbenches by selecting one or more workbenches from the list on the left. Click on the right arrow, to include the selected workbench(s).
Select an included workbench and click on the left arrow, to exclude the workbench again.
This is one of two methods to create custom panels. With this method you can create your own custom panels by combining panels. This can be useful when a workbench has a few panels with only one or two buttons.
Combined panels are workbench specific. It is not possible to mix panels from different workbenches into one panel.
However, custom made panels are included. So you can create a custom panel with the normal FreeCAD toolbar UI. This toolbar is then also included in the ribbon as a panel.
Combine panels
To combine panels, take the following steps:
- In the top dropdown select "new". The left and right list will be cleared.
- Select a workbench in the second dropdown. On the left the toolbars of this workbench well be shown.
- Now select one or more panels and click on the arrow pointing to the right. On the right all the commands of these toolbar will be shown.
- On the right you can select a command and use the up/down arrows to change the position of the command. (This can also be done in the Ribbon design tab)
- In the input box, enter a name for your panel. Click on the "add" button to add your panel. The panels which are replaced by this combined will not be used by the ribbon.
remove a panel
You can remove a panel, by selecting it in the top dropdown and click on the "remove" button.
From version 1.5.0 onwards it is possible to create your own dropdown buttons.
The dropdown buttons can be used with the quickaccess toolbar and with the custom panels based on commands
Create a dropdown button
To create dropdown button, take the following steps:
- On the top right corner select "New". The list with commands for the dropdown command will be cleared.
- Select any command from the left list and click on the arrow pointing to the right. On the right all the commands for the dropdown button will be shown.
- Enter a name for the dropdown command in the field above the list with the commands
- Press "Create/update dropdown button". The dropdown button is now stored and added to every list with commands across the dialog.
remove a dropdown button
You can remove a dropdown button, by selecting it in the top right dropdown and click on the "remove" button.
This is the second method to create a custom panel. This method is very similar to the first method. Only instead of adding panels, you can add a command from a list of commands. These panels can mix command from any workbench and can be used globally.
Combine panels
To create a panel, take the following steps:
- In the top dropdown select "new". The right list will be cleared.
- Select a workbench in the second dropdown. The panel will be added this workbench. If you select the global workbench, the panel will be added to all workbenches.
- Now select one or more commands and click on the arrow pointing to the right. On the right the commands will be shown.
- On the right you can select a command and use the up/down arrows to change the position of the command. (This can also be done in the Ribbon design tab)
- In the input box, enter a name for your panel. Click on the "add" button to add your panel.
remove a panel
You can remove a panel, by selecting it in the top dropdown and click on the "remove" button.
Here you can design your ribbon for each workbench that you have installed. On the left part of the dialog, you can change per panel the following:
- Set the size of the command button to small, medium or large
- Enable or disable a command button
- Change the text for the command
- change the position of the command
- add separators to organize your commands
On the right part of the dialog, you can change the order of the panels.
When selecting a toolbar in the second dropdown, you can also check "Icon only". This toolbar/panel will then show commands with icons only. despite what setting is set in the preference dialog.
Important to understand is that is function is based on the name of the toolbar/panel. This means that a panel with the same name in another workbench will also show commands with icons only.