Commit Graph

10 Commits

Author SHA1 Message Date
Soheil Armin f8da375cf9 Dice: Set realistic values of PhysicsMaterial of dice
These new values better matches to a acrylic D6 dice
material.

Pick-to: 6.8 6.9 6.9.0
Change-Id: I120f35815ffdcb1af56cc5505b752ca356bd61c0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-24 09:13:01 +00:00
Soheil Armin f865c01f0a Dice: Hide menu button when drawer is shown
Pick-to: 6.8 6.9 6.9.0
Change-Id: I17f4e81f9821bd413fd7d1a24cf43cf0ff0f93c9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-24 09:12:53 +00:00
Soheil Armin a7c2e00368 Dice: Improve shake detection
This change enhances the readability of the code and improves the
behavior of triggering a roll. It adds a small delay to prevent
multiple rolls from occurring in short intervals.

Pick-to: 6.8 6.9 6.9.0
Change-Id: I657450be50742d9b6236e2c29cf365b04349f191
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2025-03-24 09:12:43 +00:00
Soheil Armin a15fe391af Dice: Show values of sliders in front of related Labels
The user could not see actual values that are set with
sliders. This change appends those values to their related
labels.

Pick-to: 6.8 6.9 6.9.0
Change-Id: I0683a2765368e8385e103639695f7f337902e996
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-20 18:52:06 +02:00
Soheil Armin a9ac96fe36 Dice: Remove redundant RowLayouts with one item inside
Pick-to: 6.8 6.9 6.9.0
Change-Id: Ib10806101288af892ed4040d596ab36a3af04dc7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-20 18:52:00 +02:00
Soheil Armin 630a817385 Dice: Improve tapLabel disappearing logic
This removes the hide() function and the manual animation
from the tapLabel and uses Behavior as an alternative.

Pick-to: 6.8 6.9 6.9.0
Change-Id: Ib4cb924ff1ac3dce70dfde3a80e00efa39a5799a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-03-20 18:51:56 +02:00
Soheil Armin d4752094b4 Dice: Fix cameraController stealing drawer flickable gestures
The OrbitCameraController inside the Scene, steals gestures from
the Flickable inside the drawer.

This change disables the camera controller when drawer is shown.

Pick-to: 6.8 6.9 6.9.0
Change-Id: I557f1196db0da2d1b30ddbfbe804585de2519f1a
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2025-03-20 18:51:53 +02:00
Soheil Armin fc4f30767e Dice: Improve DiceSpawner and its property bindings
This change replaces the imperative logic of DiceSpawner
with a more declarative approach using Repeater3D.

It also replaces sending properties via functions, with
property binding and property aliases.

Pick-to: 6.8 6.9 6.9.0
Change-Id: Ic5c166fb50b0ede393cc72411f1a4a7e08a6ccd7
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2025-03-20 18:51:37 +02:00
Assam Boudjelthia 7668e5a746 Android: optimize dice app for mobile orientation
Now, the camera position is set too close so that not the whole view
is shown on portrait mode. So set the camera position close or far based
on the orientation.

Increase the default size of the dice so it's more visible and not tiny.

Don't move/shift the whole scene when the drawer is opened, this just
causes huge drop in fps on Android devices, instead the drawer opens
without affecting the scene's postion or dimentions.

Pick-to: 6.8
Task-number: QTBUG-127813
Change-Id: I3c7c54e4a1dbb3378045d86debaa21c8e50e8e94
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-09-26 15:39:24 +03:00
Sami Shalayel c4d3c1690a dice demo: use qt_add_qml_module
Use qt_add_qml_module for the dice demo.

Make the demo qmllint clean by removing unused imports, unqualified
accesses and more.

Use loadFromModule instead of load, and rename main.qml to Main.qml to
be loadable. Also add a missing qmldir file for the qmake project to
work with loadFromModule, and fix the prefixes in the .pro file.

Pick-to: 6.8
Task-number: QTBUG-100100
Change-Id: I786dcb971980f48e91b0aeaf9d65f285a78c260e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-07-09 08:57:19 +02:00