-
Notifications
You must be signed in to change notification settings - Fork 62
Widgets
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
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
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.
The list of all variables is located in Variables section
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
If you need to store some images or sounds, put them into /Monterey/@Resources/Images or /Monterey/@Resources/Sounds respectfuly
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=Оформление
- 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 asBackgroundColor,WidgetSize,BatterySaverModeetc - Make adaptive layout for your widget
so it will display correctly when overridingWidgetBasesize