diff --git a/qml/components_generic/RoundButtonIcon.qml b/qml/components_generic/RoundButtonIcon.qml index cc14c98..0266466 100644 --- a/qml/components_generic/RoundButtonIcon.qml +++ b/qml/components_generic/RoundButtonIcon.qml @@ -8,6 +8,9 @@ Item { implicitWidth: Theme.componentHeight implicitHeight: Theme.componentHeight + property url source + property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) + // actions signal clicked() signal pressed() @@ -17,13 +20,10 @@ Item { property bool selected: false // settings - property url source - property int sourceSize: UtilsNumber.alignTo(height * 0.666, 2) - property int rotation: 0 - property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off - property bool border: false property bool background: false + property int rotation: 0 + property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off // colors property string iconColor: Theme.colorIcon @@ -62,13 +62,6 @@ Item { visible: (control.highlightMode === "circle" || control.highlightMode === "both" || control.background) color: control.backgroundColor - border.width: { - if (control.border || ((mouseArea.containsMouse || control.selected) && control.highlightMode === "border")) - return Theme.componentBorderWidth - return 0 - } - border.color: control.borderColor - opacity: { if (mouseArea.containsMouse) { return (control.highlightMode === "circle" || control.highlightMode === "both" || control.background) ? 1 : 0.75 @@ -78,6 +71,15 @@ Item { } Behavior on opacity { NumberAnimation { duration: 333 } } } + Rectangle { // border + anchors.fill: control + radius: width + + visible: control.border + color: "transparent" + border.width: Theme.componentBorderWidth + border.color: control.borderColor + } //////////////////////////////////////////////////////////////////////////// diff --git a/qml/components_generic/RoundButtonText.qml b/qml/components_generic/RoundButtonText.qml index c72b0b5..7c9232a 100644 --- a/qml/components_generic/RoundButtonText.qml +++ b/qml/components_generic/RoundButtonText.qml @@ -8,6 +8,9 @@ Item { implicitWidth: Theme.componentHeight implicitHeight: Theme.componentHeight + property string text + property int textSize: Math.round(width * 0.333) + // actions signal clicked() signal pressed() @@ -17,12 +20,9 @@ Item { property bool selected: false // settings - property string text - property int textSize: Math.round(width * 0.33) - property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off - property bool border: false property bool background: false + property string highlightMode: "circle" // available: border, circle, color, both (circle+color), off // colors property string textColor: Theme.colorText @@ -57,13 +57,6 @@ Item { visible: (control.highlightMode === "circle" || control.highlightMode === "both" || control.background) color: control.backgroundColor - border.width: { - if (control.border || ((mouseArea.containsMouse || control.selected) && control.highlightMode === "border")) - return Theme.componentBorderWidth - return 0 - } - border.color: control.borderColor - opacity: { if (mouseArea.containsMouse) { return (control.highlightMode === "circle" || control.highlightMode === "both" || control.background) ? 1 : 0.75 @@ -73,6 +66,15 @@ Item { } Behavior on opacity { NumberAnimation { duration: 333 } } } + Rectangle { // border + anchors.fill: control + radius: width + + visible: control.border + color: "transparent" + border.width: Theme.componentBorderWidth + border.color: control.borderColor + } //////////////////////////////////////////////////////////////////////////// diff --git a/qml/components_themed/ComboBoxThemed.qml b/qml/components_themed/ComboBoxThemed.qml index 16cfd17..e4d2e0b 100644 --- a/qml/components_themed/ComboBoxThemed.qml +++ b/qml/components_themed/ComboBoxThemed.qml @@ -17,6 +17,7 @@ T.ComboBox { rightPadding: 16 font.pixelSize: Theme.fontSizeComponent + opacity: enabled ? 1.0 : 0.4 //////////////////////////////////////////////////////////////////////////// @@ -26,7 +27,6 @@ T.ComboBox { radius: Theme.componentRadius color: control.down ? Theme.colorComponentDown : Theme.colorComponent - opacity: enabled ? 1.0 : 0.33 border.width: 1 border.color: Theme.colorComponentBorder } @@ -42,7 +42,6 @@ T.ComboBox { verticalAlignment: Text.AlignVCenter color: Theme.colorComponentContent - opacity: enabled ? 1.0 : 0.33 } //////////////////////////////////////////////////////////////////////////// @@ -83,7 +82,6 @@ T.ComboBox { implicitHeight: Theme.componentHeight radius: Theme.componentRadius - opacity: enabled ? 1 : 0.3 color: highlighted ? "#F6F6F6" : "white" } diff --git a/qml/components_themed/SpinBoxThemed.qml b/qml/components_themed/SpinBoxThemed.qml index 8b1fe45..f8b1d9b 100644 --- a/qml/components_themed/SpinBoxThemed.qml +++ b/qml/components_themed/SpinBoxThemed.qml @@ -15,7 +15,9 @@ T.SpinBox { value: 50 editable: true + font.pixelSize: Theme.fontSizeComponent + opacity: enabled ? 1 : 0.4 property string legend @@ -27,7 +29,6 @@ T.SpinBox { radius: Theme.componentRadius color: Theme.colorComponentBackground - opacity: enabled ? 1 : 0.33 Rectangle { width: control.height @@ -76,7 +77,6 @@ T.SpinBox { anchors.verticalCenter: parent.verticalCenter color: Theme.colorComponentText - opacity: enabled ? 1.0 : 0.33 selectionColor: Theme.colorPrimary selectedTextColor: "white" selectByMouse: control.editable @@ -132,7 +132,6 @@ T.SpinBox { height: control.height anchors.verticalCenter: control.verticalCenter x: control.mirrored ? 0 : control.width - width - opacity: enabled ? 1.0 : 0.33 Rectangle { anchors.centerIn: parent @@ -158,7 +157,6 @@ T.SpinBox { height: control.height anchors.verticalCenter: control.verticalCenter x: control.mirrored ? control.width - width : 0 - opacity: enabled ? 1.0 : 0.33 Rectangle { anchors.centerIn: parent diff --git a/src/thirdparty/AppUtils/utils_app.cpp b/src/thirdparty/AppUtils/utils_app.cpp index 90b6d84..735e0e8 100644 --- a/src/thirdparty/AppUtils/utils_app.cpp +++ b/src/thirdparty/AppUtils/utils_app.cpp @@ -384,6 +384,30 @@ bool UtilsApp::getMobilePhoneStatePermission() /* ************************************************************************** */ +bool UtilsApp::checkMobileCameraPermission() +{ +#if defined(Q_OS_ANDROID) + return UtilsAndroid::checkPermission_camera(); +#elif defined(Q_OS_IOS) + return false; +#else + return true; +#endif +} + +bool UtilsApp::getMobileCameraPermission() +{ +#if defined(Q_OS_ANDROID) + return UtilsAndroid::getPermission_camera(); +#elif defined(Q_OS_IOS) + return false; +#else + return true; +#endif +} + +/* ************************************************************************** */ + bool UtilsApp::isMobileGpsEnabled() { #if defined(Q_OS_ANDROID) diff --git a/src/thirdparty/AppUtils/utils_app.h b/src/thirdparty/AppUtils/utils_app.h index 890be38..24c70d7 100644 --- a/src/thirdparty/AppUtils/utils_app.h +++ b/src/thirdparty/AppUtils/utils_app.h @@ -89,6 +89,9 @@ class UtilsApp : public QObject static Q_INVOKABLE bool checkMobilePhoneStatePermission(); static Q_INVOKABLE bool getMobilePhoneStatePermission(); + static Q_INVOKABLE bool checkMobileCameraPermission(); + static Q_INVOKABLE bool getMobileCameraPermission(); + static Q_INVOKABLE bool isMobileGpsEnabled(); static Q_INVOKABLE QString getMobileDeviceModel(); diff --git a/src/thirdparty/AppUtils/utils_os_android_qt5.cpp b/src/thirdparty/AppUtils/utils_os_android_qt5.cpp index eb82f86..d840580 100644 --- a/src/thirdparty/AppUtils/utils_os_android_qt5.cpp +++ b/src/thirdparty/AppUtils/utils_os_android_qt5.cpp @@ -31,7 +31,7 @@ int UtilsAndroid::getSdkVersion() { - return QtAndroid::sdkVersion(); + return QtAndroid::androidSdkVersion(); } /* ************************************************************************** */