Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Widgets

creewick edited this page Jun 30, 2022 · 3 revisions

Files and Folders

Each widget is stored in a folder that matches it's name, inside Monterey\Widgets\
Each widget size is a separate .ini file in that folder, with a name that matches it's size/state.

Generally, your folder will look like:

Monterey\Widgets\YourWidgetName

- Small.ini
- Medium.ini
- Wide.ini
- Large.ini
- Settings.ini

Includes

Use predefined modules

Widgets have a modular structure. You can import predefined modules from #@#/Scripts/Includes/ or create your own modules in that directory.
For a basic widget you'll only need to import Widget.inc. It also requires you to fill WidgetName and WidgetSize variables.

So, the minimal working .ini file would look like:

[Variables]
WidgetName=YourWidgetName
WidgetSize=Medium
@Include=#@#Scripts\Includes\Widget.inc

You'll find information about other modules in the Includes section

Store script file

If your .ini files have some repeated code, you can create an .inc file in this folder: Monterey/@Resources/Scripts/Widgets/.
The file name should match your widget's name.

Then you can import this file to your .inis.

Variables

Use provided global variables

The list of all variables is located in Variables section

Store variables file

If you need to store some variables for your widget, create an .inc file in this folder: Monterey/@Resources/Variables/.
The file name should match your widget's name.

If you created a variables file, remember to add it's path into Monterey/Variables.txt so these variables would save between suite's updates

Media

If you need to store some images or sounds, put them into /Monterey/@Resources/Images or /Monterey/@Resources/Sounds respectfuly

Localization

If you need to display some text on your widget, remember to use localization files.
Inside each folder in Monterey/Languages/ search for Widget/ subfolder and create an .inc file that matches your widget's name.
Put all your strings of text as variables with a key started with t prefix, ex. tAppearence=Оформление

Guidelines

  • Follow the Apple's design guidelines
    or at least try to make your widget look similar to Apple's native widgets
  • Respect users's theme and other options
    by using provided global variables, such as BackgroundColor, WidgetSize, BatterySaverMode etc
  • Make adaptive layout for your widget
    so it will display correctly when overriding WidgetBase size