forked from Blendman974/faceclaw
Unify vertical position and display mode settings; add to onboarding
This commit is contained in:
1 parent
6b1e64c5ac
commit
5a9ca08921
36 files changed
+810
-574
No files matched your search
@@ -1,8 +1,5 @@
|
||||
import { Dialogs, Observable } from '@nativescript/core';
|
||||
import {
|
||||
brightnessSetting, DISPLAY_MODE_VALUES, displayModeLabel, displayModeSetting,
|
||||
type BrightnessSetting, type DisplayModeSetting,
|
||||
} from '../ui/dashboard-settings';
|
||||
import { brightnessSetting, displayLayoutSetting, type BrightnessSetting } from '../ui/dashboard-settings';
|
||||
|
||||
type ControlsTab = 'settings' | 'watch' | 'ring';
|
||||
// Remember the tab across navigation on both platforms, without persisting it.
|
||||
@@ -65,17 +62,19 @@ export class RemoteControlsViewModel extends Observable {
|
||||
// ---- display mode and brightness, on the Settings tab ----
|
||||
|
||||
get displayModeLabel(): string {
|
||||
return displayModeLabel(displayModeSetting.get()) + " ▾";
|
||||
return displayLayoutSetting.displayValue() + " ▾";
|
||||
}
|
||||
|
||||
async onDisplayModeTap(): Promise<void> {
|
||||
const current = displayModeSetting.get();
|
||||
const options = DISPLAY_MODE_VALUES.map((value) => displayModeLabel(value) + (value === current ? " ✓" : ""));
|
||||
const current = displayLayoutSetting.get();
|
||||
// Full Screen is offered only with a bottom or popup app switcher.
|
||||
const values = displayLayoutSetting.values.filter((value) => !displayLayoutSetting.isDisabled(value));
|
||||
const options = values.map((value) => displayLayoutSetting.displayValue(value) + (value === current ? " ✓" : ""));
|
||||
const picked = await Dialogs.action({ title: "Display mode", cancelButtonText: "Cancel", actions: options });
|
||||
const index = options.indexOf(picked);
|
||||
if (index < 0) return;
|
||||
const value = DISPLAY_MODE_VALUES[index] as DisplayModeSetting;
|
||||
if (value !== current) displayModeSetting.set(value);
|
||||
const value = values[index]!;
|
||||
if (value !== current) displayLayoutSetting.set(value);
|
||||
this.notifyPropertyChange("displayModeLabel", this.displayModeLabel);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<!-- Settings tab -->
|
||||
<StackLayout visibility="{{ settingsTabVisibility }}">
|
||||
<GridLayout rows="auto" columns="auto,*" class="settings-row">
|
||||
<Label col="0" text="Screen size" class="settings-row-label" verticalAlignment="center" />
|
||||
<Label col="0" text="Display mode" class="settings-row-label" verticalAlignment="center" />
|
||||
<Button col="1" text="{{ displayModeLabel }}" tap="{{ onDisplayModeTap }}" class="mode-button" horizontalAlignment="left" />
|
||||
</GridLayout>
|
||||
<GridLayout rows="auto" columns="auto,*,auto" class="settings-row">
|
||||
|
||||
Reference in new issue
Block a user