Commit Graph

5 Commits

Author SHA1 Message Date
Fabian Kosmale 79d24cacfb coffee example: Clean up dataflow (7/n)
Move the orientation value into its own singleton; it's not directly
coffee related, and we want to make use of it in many places, including
ui files, where we don't really want to have a dependency
ApplicationForm (so that they can be still be opened in QDS).

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: Ib60fe29e814af2e564a33239ba36afd0d7bf9537
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:04:28 +02:00
Fabian Kosmale daf3f87430 coffee example: Clean up dataflow (4/n)
Deal with Home. Home differs from the other pages, because it is used as
the initial item, and thus an actual instance is already created in the
ui.qml file, not only a Component.
As we still want to use a required property referencing the
ApplicationFlow instance, the instantiation is moved into
ApplicationFlow (instead of ApplicationFlowForm).

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I903352e17560c056fdb12e370ee5413adbe2fd1d
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:04:04 +02:00
Konsta Alajärvi 0cac392e36 Separate UI from business logic on re-designed Coffee Machine example
Added .ui.qml counterpart files for components that needed separation
between the UI and business logic.

Rebased to dev to get the newest changes

Added Cup snippet tags to ProgressForm.ui.qml

Added AbstractButton snippet tags to CoffeeCardForm.ui.qml

Fix ambiguous id's and corresponding property aliases in CoffeeCardForm.ui.qml

Added qdoc snippet tags to ChoosingCoffeeForm.ui.qml

Fixed incorrect file paths in snippet tags in coffee.qdoc

Moved transitions from ProgressForm.ui.qml to Progress.qml
as they did not work properly from there to make the coffee cup
animation work properly.

Added property alias "contentItem" to ProgressForm.ui.qml
to access it's properties from Progress.qml to make the progress bar
animation work properly.

Fixed x coordinates in custom sliders so that the slider handle
will not go over the slider bar and become unresponsive.

Removed "brewTime" property int from ProgressForm.ui.qml as it was
not needed there.

* Fixed x coordinate in Sliders to work like they are described
in official documentation.

* Created property int in Progress.qml to better describe cup animation
velocity factor.

Fixes: QTBUG-120280
Pick-to: 6.6 6.7
Change-Id: I3ed0e1c6777674e2d9502aab1e5c670b6099f60a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-02-08 10:18:18 +02:00
Konsta Alajärvi 4c3e6e6152 Fix Coffee Machine clipping UI elements on lower resolution displays
Reason for these changes is that it was discovered that some of the
UI elements of the re-designed Coffee Machine example did overflow the
target device display with lower than ~1080x1920 display resolution.

Added states to coffee cards that will scale the cards and their content
down if target device screen resolution is lower than set limit.

Added state to home component where text components will be scaled
down in target device screen resolution is lower than set limit.

Added some colors to Colors.qml to remove hardcoded color values.

Added states to sliders in Settings.qml and in CustomSlider.qml
that will scale them down if target device screen resolution is
lower than set limit.

Scaled the custom buttons heights down a bit throughout the
app to make them fit on screen.

Added state to progress page that will scale the caption text
down if target device screen resotion is lower than set limit
and set minimum width and height to dialog component so that
the text will not overflow its container.

Added states to ready page that will reduce the row spacing of the
grid component and scale the caption font size down if target device
screen resolution is lower than the set limit.

Tested successfully  with Android emulators with screen resolution
ranging from 320x480 to 1440x3120.

Removed multiple property changes regarding text sizes in
Settings.qml and replaced them by binding the text objects
font size to a new property int that will be modified through state.

Added the missing when condition in state change to change
the font size in Setting.qml.

Renamed ambiguous id's

* Removed unused property aliases

* Re-applied missing qdoc snippet tags to Settings.qml which were removed
by mistake. This should fix one of the qdoc warnings in CI.

Fixes: QTBUG-116402
Pick-to: 6.7 6.6
Change-Id: I2524be43f943494f5ab7b2689b222a977996dac6
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-01-10 07:19:54 +00:00
Konsta Alajärvi b40aaf48ca Re-design for Coffee Machine example
Implementing new design for Coffee Machine example, more information
on how the new design is going to look like in QTBUG-116402 and in
its subtasks.

Removed unused imports folder.

Changed the names of Home.ui.qml to Home.qml and FilledCup.qml to
Cup.qml in Coffee.qrc file.

Changed the names of the files stated above also in qmldir.

Fixes: QTBUG-116403
Fixes: QTBUG-116402
Task-number: QTBUG-116404
Change-Id: Ib4d33e28ce1e3f268172007e85f36eb1280d11a4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-24 11:42:21 +02:00