Tutorial 15 - Desktop Theme Editor
When going through Maqetta's tutorials, it is suggested that you have two side-by-side
browser windows open, one showing the tutorial, and the other where you run the application
and perform the steps listed in the tutorial.
Cloning the Claro theme and launching the theme editor
To create a new CSS theme and launch the theme editor,
select Create > Theme... from the Maqetta menu bar.
A dialog will appear. In the first field, choose "claro" as the theme to clone.
In the second field, enter "myclaro" as the name for the cloned theme.
(Note: theme names must not contain spaces or other special characters.)
This will create a new CSS styling theme in your workspace named "myclaro" and launch
the theme editor on your new "myclaro".
Subsequently, you can open the theme editor on your new theme
using the Open > Theme Editor... command.
After issuing the Create > Theme command, the Maqetta application should look something like this:

All of the supported widgets are displayed on the theme editor canvas. The widgets are divided into
three sections: Global Styling, Primitive Widgets and Container Widgets.
- Click on any widget to select it.
- When a widget is selected, its properties can be customized in the Properties palette.
Subwidget Selection Panel
Some widgets contain subwidgets, which can be customized individually.
When you click on a widget that has subwidgets, a panel pops up displaying a list of the subwidgets:
- Click on the Calendar widget to display its subwidget panel.
- Click on each check box and notice how the corresponding subwidget is highlighted in red on the Calendar widget.
- When a subwidget is selected, property changes will be applied to the subwidget.
- When WidgetOuterContainer is selected, property changes will be applied to the main widget.
To close the subwidget panel, you must select a different widget. (In a future release the panel will close when you click anywhere off the widget.)
Global Styling
The Global Styling section is for setting styles that apply globally. There are two types of elements that can be set globally: text and widgets.
Using the Generic text widget to make global changes
The Generic text widget is for setting text styles that apply to all widgets that contain text elements.
- Select the Generic text widget (at the top under Global Styling).
- Open the Fonts and Text section of the Properties palette.
- Set the font color to red.
- Notice how the text for all the widgets is now red.
- If you wish to commit this theme change, click on the Save button on the toolbar to save your changes.
(Note: You can undo after saving within the same editing session.)
- Create a new HTML file to see the new font color:
- Select Create > Desktop Application from the Maqetta menu bar.
You can either accept the default filename
(e.g.,
file1.html) or enter a custom filename. Click on the Create button.
- Drag a Button onto the canvas.
The button's text should be black. This is because each new desktop composition by default starts off using the Claro theme,
and the default text color with Claro is black.
- Drag the HTML Rich Text widget onto the canvas and type in some text.
- Click off of the rich text widget to close it.
- Note that all of the text is black.
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Note that all of the text is now red.
- Save and close the HTML file.
Using the Global Background and Border widget to make global changes
The Global Background and Border widget represents a generic widget and allows you to globally set the background and border for all widgets. These properties are under the Background and Border sections of the Properties palette.
- Select the Global Background and Border widget in the theme editor.
- Open the Background section of the Properties palette.
- Set the background color to a pale green.
- Notice how the color on the Primitive widgets is now green.
- Click on the Save icon button on the toolbar to save your changes.
- Create a new HTML file to see the new background color:
- Select Create > Desktop Application from the Maqetta menu bar to create a new HTML file.
- Drag a Button onto the canvas.
- Drag a Calendar onto the canvas.
- Note that both widgets are blue. This is because new HTML files start with the Claro theme.
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Note that the two widgets are now green.
- Close the HTML file.
Note: Changes made with the Global Background and Border widget will override changes previously made to individual widgets. If you want to customize individual widgets for your theme, you should make all global changes first, then make the individual widget changes.
Customizing the look of a particular type of widget
To customize the visual styling for a particular type of widget, select the widget on the theme editor canvas and modify the styling properties for that widget using the Properties palette.
Customizing the button widget
- Change the button style in the Theme editor:
- Click on the Button widget to select it.
- In the Properties palette, open the Fonts and Text section.
- Adjust the various text properties (e.g., font family, font size, color).
- Notice how the changes are applied to the Button widget on the canvas.
- Click on the Save button on the toolbar to save your theme modifications.
- Create a new HTML file to use the new button style:
- Select Create > Desktop Application from the Maqetta menu bar to create a new HTML file.
- Drag two buttons from the Widget palette onto the canvas.
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Notice how the two buttons reflect the styling settings that you defined in the theme editor.
- In the page editor toolbar, click the Preview in Browser
icon. This will launch a new browser window that contains the HTML page you just created.
Sometimes changes made in the theme editor don't show up in the page editor until you do a browser refresh.
Save and close the theme editor before doing a browser refresh, then reopen it if needed.
Changing background colors
- Change Button's background color:
- Select the Button widget in the theme editor.
- Open the Background section of the Properties palette.
- Click on the color input field to bring up the Color Picker
- Pick a green color.
- Click off the Color Picker to close it.
- Note that Button's color is now green.
- Change Calendar's background color:
- Select the Calendar widget in the theme editor.
- A window will pop up containing a list of all the subwidgets for Calendar.
- Check the box next to the SelectedDate subwidget.
- Open the Background section of the Properties palette.
- Click on the color input field to bring up the Color Picker
- Note that the same green color is still selected.
- Click off the Color Picker to accept the same color and close the picker.
- Note that the background on the currently selected date is now green.
- Change TitlePane's background color:
- Select the TitlePane widget in the theme editor (container widget that has Pane at the top).
- A window will pop up containing a list of all the subwidgets for TitlePane.
- Check the box next to the TitlePaneTitle subwidget.
- Open the Background section of the Properties palette.
- Click on the color input field to bring up the Color Picker
- Note that the same green color is still selected.
- Click off the Color Picker to accept the same color and close the picker.
- Note that the TitlePane's title color is now green.
Changing background colors for different states
When a tab is selected on TabContainer, it puts the tab in the Selected state. Any tab that is not selected is considered to be in the Normal state. This exercise shows how to set tab background color for the Normal state, and then the Selected state.
- Change TabContainer for the Normal state:
- Select TabContainer.
- A window will pop up containing a list of all the subwidgets for TabContainer.
- Check the box next to the Tab subwidget.
- Make sure Normal is selected in the States palette.
- Open the Background section of the Properties palette.
- Click on the color input field to bring up the Color Picker
- Pick a green color.
- Click off the Color Picker to close it.
- Change TabContainer for the Selected state:
- Make sure that TabContainer is still selected and the Tab subwidget box is checked in the popup.
- Select the Selected state in the States palette.
- Open the Background section of the Properties palette.
- Click on the color input field to bring up the Color Picker
- Click off the Color Picker to accept the same color and close the picker.
- View TabContainer in various states:
- Click on the Save button on the toolbar to save your changes.
- Open a new HTML file (select Create > Desktop Application from the Maqetta menu bar).
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Drag a TabContainer onto the canvas (accept the default tab names).
- Click on each tab to view the color differences.
- Click the Preview in Browser
icon in the toolbar. This will launch a new browser window that contains the HTML page you just created.
- Click on each tab to view the color differences.
- Note the difference in color when you hover over each tab. This is controlled by the Hover state. Try changing the tab color for the hover state, then view the results.
Be sure to return to Normal state in the States palette before continuing with the remainder of the tutorial.
Styling inheritance
The styling assigned to certain widgets will have an indirect effect on other widgets.
For example, Accordion, TabContainer and BorderContainer use ContentPanes as wrapper widgets for each of their sub-panes,
so these widgets will be affected by any changes made to ContentPane.
Styling inheritance exercises
- Changing ContentPane affects multiple widgets:
- Click on the ContentPane widget (the 1st widget in the Container widgets section) to select it.
- In the Properties palette under Fonts and Text, set font color to a dark blue color.
- Notice that the same font color is used for ContentPane, Accordion, TabContainer and BorderContainer.
This is because Accordion, TabContainer and BorderContainer use ContentPanes as a wrapper widget for each of their sub-panes.
(Note that TitlePane's font color does not change, because TitlePane does not use ContentPanes.)
- Click the Undo
icon to undo the changes.
- Changing the Global Styling font:
- Click on the Generic text block under Global Styling at the top of the theme editor.
- In the Properties palette under Fonts and Text and note that the default font-family is "Verdana,Arial,Helvetica,sans-serif".
- Set the font-family to Arial Black.
- Notice that all widget fonts are now set to Arial Black.
- Now select the Button widget and set the font-family to Courier New.
- Notice that all buttons are now set to Courier New (including Toolbar which contains Buttons as subwidgets).
- Setting the font on individual widgets will override the global font set on the Generic text block.
- Click the Undo
icon twice to undo the Button and Generic text changes.
- Changing the Global Background and Border widget affects multiple widgets:
- Click on the Global Background and Border widget under Global Styling.
- In the Properties palette under Background, set the color to pale yellow.
- Notice that the background color for many of the Primitive widgets changes to the selected color.
- (Notice that the background color for the container widgets does not change. Use ContentPane to globally change the background for container widgets.)
- Click on the Save button on the toolbar to save your theme changes.
- Open Sample1.html and Sample2.html, for each file switch to the "myclaro" theme (using the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar)), and preview them in the browser
(using the Preview in Browser
toolbar icon) to see the affects this change.
Complex widgets and subwidgets
Some complex widgets, such as Calendar, allow different styling for different "subwidgets", which are particular sub-elements to the given widget. For Calendar, you can customize the styling on several things, including the year, the month, the days of the week (Sun to Sat), and the dates (0 to 31).
Experiment with subwidgets
- Click on the Calendar widget to select it.
- In the subwidget popup, check the box next to SelectedDate.
- In the Properties palette, change the font color to red.
- Notice how the font color for the month name changes on the Calendar widget.
- In the subwidget popup check the box next to CalendarDayLabel and change the font color.
- Continue to select other subwidgets and change the styling.
- Click on the Save button on the toolbar to save your theme changes.
- Create a new HTML file (select Create > Desktop Application from the Maqetta menu bar).
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Drag a Calendar widget onto the canvas.
- Notice that the theme changes you made to the Calendar widget are visible in the HTML page editor.
Widget States
The term widget states refers to the various interactive states that a widget might have.
For example, the Dojo Button widget has three widget states: Normal, Hover and Disabled.
For each state Dojo displays a different set of CSS properties, such as border color, font color,
and background properties, in order to provide visual feedback at runtime.
Experiment with widget states
- Understanding the States palette:
- Close all files except the Claro theme editor (claro.theme).
- Open the Claro theme editor if it is not already open.
- In the States palette, select the Active state.
- Notice that some widgets are grayed out. This indicates that these widgets do not have an Active state.
Any widgets that are not grayed out (such as Button) do have an Active state.
- Select the Disabled state in the States palette.
- Notice that Button and Checkbox are light gray, indicating that these widgets are styled as light gray when they are disabled.
- Select the Hover state in the States palette.
- Notice that many of the widgets have a slightly darker blue coloring than they do in the Normal state.
This styling is displayed when you hover over the widget with your mouse.
- Select the Selected state in the States palette.
- Notice that the CheckBox widget now displays with a check mark, to show that it displays as checked in the Selected state.
(At runtime the Checkbox widget toggles between the Selected and Normal states when you click on it.)
- Change the styling for different states:
- In the States palette, make sure the Normal state is highlighted (it is by default).
- In the Styling palette, change the Button's styling (e.g., font family, font size or font color).
This will change the styling for the Button's Normal state.
- Notice how the button's appearance changes on the theme editor canvas updates as you change styling properties.
- Now select Hover in the States palette.
- Notice that the Button's styling now shows the current styling for the Hover state.
- In the Styling palette, change the Button's styling for the Hover state, making it different from the styling you gave it for the Normal state.
- In the States palette, alternately click on the Normal and Hover states and observe the style changes on the Button widget.
- Click on the Save button on the toolbar to save your theme changes.
- Test your theme changes:
- Select Create > Desktop Application from the Maqetta menu bar open up a new HTML page.
- On the toolbar, choose the "Switch theme" command from the dropdown menu on the Document Settings icon (2nd from right on toolbar).
This will bring up a dialog that allows you to switch to a different theme.
In the menu, choose "myclaro" as the theme to use.
- Drag a Button widget onto the canvas.
- In the page editor toolbar, click the Preview in Browser
icon. This will launch a new browser window that contains the HTML page you just created (which only contains the Button widget).
- The button should reflect the styles you set for the Normal state.
- Hover your mouse over the button to observe the styling for the Hover state.
Previous / Next