Aligned naming of menu item types

This commit is contained in:
SomeoneOnEarth
2023-11-19 02:04:23 +01:00
parent ab995db5ba
commit 440980a96f
39 changed files with 40 additions and 40 deletions

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 606 B

View File

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

View File

@ -17,6 +17,6 @@
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
<bitmap id="MenuIcon" filename="menu.svg"/>
<bitmap id="TapIcon" filename="tap.svg"/>
<bitmap id="GroupTypeIcon" filename="group_type.svg"/>
<bitmap id="TapTypeIcon" filename="tap_type.svg"/>
</drawables>

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

@ -24,7 +24,7 @@
<!-- Best be a public URL in order to work away from your home LAN and have a trusted HTTPS certificate -->
<property id="config_url" type="string"></property>
<property id="lean_ui" type="boolean"></property>
<property id="types_representation" type="boolean"></property>
<property id="menu_alignment" type="boolean"></property>
</properties>

View File

@ -44,8 +44,8 @@
</setting>
<setting
propertyKey="@Properties.lean_ui"
title="More leaner UI"
propertyKey="@Properties.types_representation"
title="Representing types with labels (off) or with icons (on)"
>
<settingConfig
type="boolean"

View File

@ -27,11 +27,11 @@ class HomeAssistantMenuItemFactory {
private var mMenuItemAlignment;
private var mLabelToggle;
private var strMenuItemTap;
private var bLeanDesign;
private var bRepresentTypesWithIcons;
private var mTapIcon;
private var mTapTypeIcon;
private var mMenuIcon;
private var mGroupTypeIcon;
private static var instance;
@ -41,7 +41,7 @@ class HomeAssistantMenuItemFactory {
:disabled => WatchUi.loadResource($.Rez.Strings.MenuItemOff) as Lang.String
};
bLeanDesign = Application.Properties.getValue("lean_ui") as Lang.Boolean;
bRepresentTypesWithIcons = Application.Properties.getValue("types_representation") as Lang.Boolean;
var menuItemAlignment = Application.Properties.getValue("menu_alignment") as Lang.Boolean;
@ -53,14 +53,14 @@ class HomeAssistantMenuItemFactory {
strMenuItemTap = WatchUi.loadResource($.Rez.Strings.MenuItemTap);
mTapIcon = new WatchUi.Bitmap({
:rezId=>$.Rez.Drawables.TapIcon,
mTapTypeIcon = new WatchUi.Bitmap({
:rezId=>$.Rez.Drawables.TapTypeIcon,
:locX=>WatchUi.LAYOUT_HALIGN_CENTER,
:locY=>WatchUi.LAYOUT_VALIGN_CENTER
});
mMenuIcon = new WatchUi.Bitmap({
:rezId=>Rez.Drawables.MenuIcon,
mGroupTypeIcon = new WatchUi.Bitmap({
:rezId=>$.Rez.Drawables.GroupTypeIcon,
:locX=>WatchUi.LAYOUT_HALIGN_CENTER,
:locY=>WatchUi.LAYOUT_VALIGN_CENTER
});
@ -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 (bLeanDesign == false){
if (bRepresentTypesWithIcons == false){
subLabel=mLabelToggle;
}
@ -90,13 +90,13 @@ 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 (bLeanDesign) {
if (bRepresentTypesWithIcons) {
return new HomeAssistantIconMenuItem(
label,
null,
identifier,
service,
mTapIcon,
mTapTypeIcon,
mMenuItemAlignment
);
@ -112,8 +112,8 @@ class HomeAssistantMenuItemFactory {
}
function group(definition as Lang.Dictionary) as WatchUi.MenuItem{
if (bLeanDesign) {
return new HomeAssistantViewIconMenuItem(definition, mMenuIcon, mMenuItemAlignment);
if (bRepresentTypesWithIcons) {
return new HomeAssistantViewIconMenuItem(definition, mGroupTypeIcon, mMenuItemAlignment);
} else {
return new HomeAssistantViewMenuItem(definition);
}