mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-05-02 13:42:32 +00:00
Set showing icons for types as default
This commit is contained in:
@ -45,7 +45,7 @@
|
||||
|
||||
<setting
|
||||
propertyKey="@Properties.types_representation"
|
||||
title="Representing types with labels (off) or with icons (on)"
|
||||
title="Representing types with icons (off) or with labels (on)"
|
||||
>
|
||||
<settingConfig
|
||||
type="boolean"
|
||||
|
@ -27,7 +27,7 @@ class HomeAssistantMenuItemFactory {
|
||||
private var mMenuItemAlignment;
|
||||
private var mLabelToggle;
|
||||
private var strMenuItemTap;
|
||||
private var bRepresentTypesWithIcons;
|
||||
private var bRepresentTypesWithLabels;
|
||||
|
||||
private var mTapTypeIcon;
|
||||
|
||||
@ -41,7 +41,7 @@ class HomeAssistantMenuItemFactory {
|
||||
:disabled => WatchUi.loadResource($.Rez.Strings.MenuItemOff) as Lang.String
|
||||
};
|
||||
|
||||
bRepresentTypesWithIcons = Application.Properties.getValue("types_representation") as Lang.Boolean;
|
||||
bRepresentTypesWithLabels = Application.Properties.getValue("types_representation") as Lang.Boolean;
|
||||
|
||||
var menuItemAlignment = Application.Properties.getValue("menu_alignment") as Lang.Boolean;
|
||||
|
||||
@ -76,7 +76,7 @@ class HomeAssistantMenuItemFactory {
|
||||
function toggle(label as Lang.String or Lang.Symbol, identifier as Lang.Object or Null) as WatchUi.MenuItem{
|
||||
var subLabel = null;
|
||||
|
||||
if (bRepresentTypesWithIcons == false){
|
||||
if (bRepresentTypesWithLabels == true){
|
||||
subLabel=mLabelToggle;
|
||||
}
|
||||
|
||||
@ -90,7 +90,15 @@ class HomeAssistantMenuItemFactory {
|
||||
}
|
||||
|
||||
function tap(label as Lang.String or Lang.Symbol, identifier as Lang.Object or Null, service as Lang.String or Null) as WatchUi.MenuItem{
|
||||
if (bRepresentTypesWithIcons) {
|
||||
if (bRepresentTypesWithLabels) {
|
||||
return new HomeAssistantMenuItem(
|
||||
label,
|
||||
strMenuItemTap,
|
||||
identifier,
|
||||
service,
|
||||
mMenuItemAlignment
|
||||
);
|
||||
} else {
|
||||
return new HomeAssistantIconMenuItem(
|
||||
label,
|
||||
null,
|
||||
@ -99,23 +107,14 @@ class HomeAssistantMenuItemFactory {
|
||||
mTapTypeIcon,
|
||||
mMenuItemAlignment
|
||||
);
|
||||
|
||||
} else {
|
||||
return new HomeAssistantMenuItem(
|
||||
label,
|
||||
strMenuItemTap,
|
||||
identifier,
|
||||
service,
|
||||
mMenuItemAlignment
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function group(definition as Lang.Dictionary) as WatchUi.MenuItem{
|
||||
if (bRepresentTypesWithIcons) {
|
||||
return new HomeAssistantViewIconMenuItem(definition, mGroupTypeIcon, mMenuItemAlignment);
|
||||
} else {
|
||||
if (bRepresentTypesWithLabels) {
|
||||
return new HomeAssistantViewMenuItem(definition);
|
||||
} else {
|
||||
return new HomeAssistantViewIconMenuItem(definition, mGroupTypeIcon, mMenuItemAlignment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user