Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watchface settings page #87

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dodoradio
Copy link
Contributor

This allows the watchface to ship an embedded settings page.
To make use of this, watchface qml file must have property Component settingsPage referencing the id of the Component which contains the settings page qml.
The watchface page only shows the 'gear' icon when this property is present, which serves as an indicator that the current watchface has a settings page. This can be accessed with another tap.
The gear icon appears with a short delay, as the watchface must be loaded before the settingsPage property can be checked.

an example implementation of such a watchface can be found here: https://dodorad.io/uploads/analog-classy-roman.qml

This also adds the watchface filename to the selector

The visuals of these two commits might need some tweaking. On a first glance, for example, the way that the gear icon and text overlap isn't very pretty.
IMG_20230521_112308~2

There is still some discussion about whether this is the best way to implement watchface settings, so this is still a draft for now.

dodoradio added 2 commits May 21, 2023 12:14
Signed-off-by: Arseniy Movshev <[email protected]>
This allows the watchface to ship an embedded settings page.
To make use of this, watchface qml file must have `property Component settingsPage` referencing the `id` of the `Component` which contains the settings page qml.
The watchface page only shows the 'gear' icon when this property is present, which serves as an indicator that the current watchface has a settings page. This can be accessed with another tap.
The gear icon appears with a short delay, as the watchface must be loaded before the `settingsPage` property can be checked.
@dodoradio dodoradio force-pushed the add-watchface-settingspage branch from 8271047 to 5d38d7f Compare May 21, 2023 11:15
Copy link
Member

@FlorentRevest FlorentRevest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach and code looks fine to me.

Leaving the design review to @eLtMosen

@@ -108,7 +109,7 @@ Item {

z: 2
visible: !previewPng.previewExists
active: visible
active: visible || (watchface === folderModel.folder + "/" + fileName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This watchface === folderModel.folder + "/" + fileName is used quite extensively, maybe we should extract it into a bool property selected so it's easier to understand what it means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants