Skip to content

Commit

Permalink
feat: settings for temp unit and display toggles
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadon committed Jul 7, 2023
1 parent ffc3d20 commit f86a777
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 152 deletions.
3 changes: 3 additions & 0 deletions resources/settings/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
<property id="DarkMode" type="boolean">true</property>
<property id="UseMilitaryFormat" type="boolean">false</property>
<property id="ShowSeconds" type="boolean">true</property>
<property id="UseFarenheit" type="boolean">false</property>
<property id="ShowLines" type="boolean">true</property>
<property id="ShowEnvironment" type="boolean">true</property>

</properties>
12 changes: 12 additions & 0 deletions resources/settings/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@
<settingConfig type="boolean" />
</setting>

<setting propertyKey="@Properties.UseFarenheit" title="@Strings.UseFarenheitTitle">
<settingConfig type="boolean" />
</setting>

<setting propertyKey="@Properties.ShowLines" title="@Strings.ShowLinesTitle">
<settingConfig type="boolean" />
</setting>

<setting propertyKey="@Properties.ShowEnvironment" title="@Strings.ShowEnvironmentTitle">
<settingConfig type="boolean" />
</setting>

</settings>
8 changes: 8 additions & 0 deletions resources/strings/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@
<string id="SecondsDisplayTitle">Show Seconds</string>
<string id="SecondsDisplaySubtitle">Update the seconds display</string>

<string id="UseFarenheitTitle">Use Farenheit</string>
<string id="UseFarenheitSubtitle">On for °F and off for °C</string>

<string id="ShowLinesTitle">Show lines</string>
<string id="ShowLinesSubtitle">Lines between data points</string>

<string id="ShowEnvironmentTitle">Show environment</string>
<string id="ShowEnvironmentSubtitle">Environment data</string>
</strings>
33 changes: 33 additions & 0 deletions source/SnoutSettingsMenu.mc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,39 @@ class SnoutSettingsMenu extends WatchUi.Menu2 {
null
)
);

var useFarenheit = Properties.getValue("UseFarenheit") as Boolean;
Menu2.addItem(
new WatchUi.ToggleMenuItem(
Rez.Strings.UseFarenheitTitle,
Rez.Strings.UseFarenheitSubtitle,
"UseFarenheit",
useFarenheit,
null
)
);

var showLines = Properties.getValue("ShowLines") as Boolean;
Menu2.addItem(
new WatchUi.ToggleMenuItem(
Rez.Strings.ShowLinesTitle,
Rez.Strings.ShowLinesSubtitle,
"ShowLines",
showLines,
null
)
);

var showEnvironment = Properties.getValue("ShowEnvironment") as Boolean;
Menu2.addItem(
new WatchUi.ToggleMenuItem(
Rez.Strings.ShowEnvironmentTitle,
Rez.Strings.ShowEnvironmentSubtitle,
"ShowEnvironment",
showEnvironment,
null
)
);
}
}

Expand Down
Loading

0 comments on commit f86a777

Please sign in to comment.