| | 940 | |
| | 941 | === Grouping settings === |
| | 942 | |
| | 943 | Similar settings can be grouped together by defining ''settings groups'' (since r15289): |
| | 944 | |
| | 945 | {{{ |
| | 946 | #!mapcss |
| | 947 | settings::my_group { |
| | 948 | label: tr("my wonderful group"); |
| | 949 | icon: "my_beautiful_icon"; |
| | 950 | } |
| | 951 | }}} |
| | 952 | |
| | 953 | Label is mandatory, icon is optional. |
| | 954 | |
| | 955 | Once a setting group is defined, it can be referenced from all settings belonging to it: |
| | 956 | |
| | 957 | {{{ |
| | 958 | #!mapcss |
| | 959 | setting::hide_icons { |
| | 960 | type: boolean; |
| | 961 | label: tr("Hide icons at low zoom"); |
| | 962 | default: true; |
| | 963 | group: "my_group"; |
| | 964 | } |
| | 965 | }}} |
| | 966 | |
| | 967 | Settings groups are displayed as sub-menus from the style settings menu. If at least two settings belong to a group, a special "Toggle all settings" menu item allows to quickly switch on/off all settings from this group at once. |