diff --git a/qml/ComponentLibrary/generic/AndroidButtonIcon.qml b/qml/ComponentLibrary/generic/AndroidButtonIcon.qml index 93505b2..31f0a52 100644 --- a/qml/ComponentLibrary/generic/AndroidButtonIcon.qml +++ b/qml/ComponentLibrary/generic/AndroidButtonIcon.qml @@ -24,6 +24,7 @@ T.Button { // settings property url source property int sourceSize: 26 + property int sourceRotation: 0 property int layoutDirection: Qt.LeftToRight // colors @@ -93,6 +94,7 @@ T.Button { width: control.sourceSize height: control.sourceSize + rotation: control.sourceRotation source: control.source color: control.colorPrimary diff --git a/qml/ComponentLibrary/generic/ButtonChip.qml b/qml/ComponentLibrary/generic/ButtonChip.qml index 3c0ed19..a426dbf 100644 --- a/qml/ComponentLibrary/generic/ButtonChip.qml +++ b/qml/ComponentLibrary/generic/ButtonChip.qml @@ -30,11 +30,13 @@ T.Button { // colors property color color: Theme.colorPrimary - // icon + // icons property string leftIcon property int leftIconSize: UtilsNumber.alignTo(height * 1.0, 2) + property int leftIconRotation: 0 property string rightIcon property int rightIconSize: UtilsNumber.alignTo(height * 0.5, 2) + property int rightIconRotation: 0 //////////////// @@ -99,9 +101,10 @@ T.Button { visible: control.leftIcon.length IconSvg { + anchors.centerIn: parent width: control.leftIconSize height: control.leftIconSize - anchors.centerIn: parent + rotation: control.leftIconRotation color: control.color source: control.leftIcon @@ -129,9 +132,10 @@ T.Button { visible: control.rightIcon.length IconSvg { + anchors.centerIn: parent width: control.rightIconSize height: control.rightIconSize - anchors.centerIn: parent + rotation: control.rightIconRotation color: control.color source: control.rightIcon diff --git a/qml/ComponentLibrary/maps/MapButton.qml b/qml/ComponentLibrary/maps/MapButton.qml index 007a588..0c53369 100644 --- a/qml/ComponentLibrary/maps/MapButton.qml +++ b/qml/ComponentLibrary/maps/MapButton.qml @@ -57,11 +57,10 @@ T.Button { } /* RippleThemed { - width: parent.width - height: parent.height + anchors.fill: parent + anchor: control clip: visible - anchor: control pressed: control.pressed active: enabled && (control.down || control.visualFocus || control.hovered) color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.9) diff --git a/qml/ComponentLibrary/maps/MapButtonCompass.qml b/qml/ComponentLibrary/maps/MapButtonCompass.qml index a378469..532b7af 100644 --- a/qml/ComponentLibrary/maps/MapButtonCompass.qml +++ b/qml/ComponentLibrary/maps/MapButtonCompass.qml @@ -58,11 +58,10 @@ T.Button { } /* RippleThemed { - width: parent.width - height: parent.height + anchors.fill: parent + anchor: control clip: visible - anchor: control pressed: control.pressed active: enabled && (control.down || control.visualFocus || control.hovered) color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.9) diff --git a/qml/ComponentLibrary/menus/ActionMenuItem.qml b/qml/ComponentLibrary/menus/ActionMenuItem.qml index ade2486..a69d20d 100644 --- a/qml/ComponentLibrary/menus/ActionMenuItem.qml +++ b/qml/ComponentLibrary/menus/ActionMenuItem.qml @@ -27,6 +27,7 @@ T.Button { property int index property url source property int sourceSize: 20 + property int sourceRotation: 0 property int layoutDirection: Qt.RightToLeft //////////////// @@ -81,6 +82,7 @@ T.Button { Layout.preferredHeight: control.sourceSize source: control.source + rotation: control.sourceRotation color: Theme.colorIcon } diff --git a/qml/ComponentLibrary/menus/ActionMenu_bottom.qml b/qml/ComponentLibrary/menus/ActionMenu_bottom.qml index e9a290f..5ae7346 100644 --- a/qml/ComponentLibrary/menus/ActionMenu_bottom.qml +++ b/qml/ComponentLibrary/menus/ActionMenu_bottom.qml @@ -47,8 +47,10 @@ T.Popup { background: Rectangle { color: Theme.colorComponentBackground + Rectangle { - width: parent.width + anchors.left: parent.left + anchors.right: parent.right height: Theme.componentBorderWidth color: Theme.colorSeparator } @@ -59,7 +61,8 @@ T.Popup { contentItem: Item { Column { id: contentColumn - width: parent.width + anchors.left: parent.left + anchors.right: parent.right topPadding: 12 bottomPadding: 8 diff --git a/qml/ComponentLibrary/menus/ActionMenu_floating.qml b/qml/ComponentLibrary/menus/ActionMenu_floating.qml index d92ac2f..bc07add 100644 --- a/qml/ComponentLibrary/menus/ActionMenu_floating.qml +++ b/qml/ComponentLibrary/menus/ActionMenu_floating.qml @@ -56,7 +56,8 @@ T.Popup { contentItem: Item { Column { id: contentColumn - width: parent.width + anchors.left: parent.left + anchors.right: parent.right topPadding: 10 bottomPadding: 10 diff --git a/qml/ComponentLibrary/menus/DesktopSidebarItem.qml b/qml/ComponentLibrary/menus/DesktopSidebarItem.qml index 1f2ebeb..05f67d2 100644 --- a/qml/ComponentLibrary/menus/DesktopSidebarItem.qml +++ b/qml/ComponentLibrary/menus/DesktopSidebarItem.qml @@ -13,13 +13,14 @@ T.Button { implicitHeight: 64 width: parent.width // width drive the size of this element - height: Math.max(parent.width, content.height + 24) + height: Math.max(parent.width, contentColumn.height + 24) focusPolicy: Qt.NoFocus // settings property url source property int sourceSize: 40 + property int sourceRotation: 0 property string highlightMode: "background" // available: background, indicator, circle, content // colors @@ -30,7 +31,7 @@ T.Button { property bool indicatorVisible: false property bool indicatorAnimated: false property color indicatorColor: "white" - property url indicatorSource: "" + property url indicatorSource //////////////////////////////////////////////////////////////////////////// @@ -38,8 +39,8 @@ T.Button { implicitWidth: 64 implicitHeight: 64 - width: (control.highlightMode === "circle") ? height : parent.width - height: parent.height + width: control.width + height: control.height radius: (control.highlightMode === "circle") ? width : 0 visible: (control.highlightMode === "background" || @@ -67,31 +68,25 @@ T.Button { //////////////////////////////////////////////////////////////////////////// ColumnLayout { - id: content + id: contentColumn anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter spacing: -4 - IconSvg { - id: contentImage - width: control.sourceSize - height: control.sourceSize - + IconSvg { // contentImage + Layout.preferredWidth: control.sourceSize + Layout.preferredHeight: control.sourceSize Layout.alignment: Qt.AlignHCenter - Layout.minimumWidth: control.sourceSize - Layout.minimumHeight: control.sourceSize - Layout.maximumWidth: control.sourceSize - Layout.maximumHeight: control.sourceSize visible: source.toString().length source: control.source + rotation: control.sourceRotation color: (!control.highlighted && control.highlightMode === "content") ? control.colorHighlight : control.colorContent opacity: control.enabled ? 1 : 0.66 - Item { - id: contentIndicator + Item { // activityIndicator width: 24; height: 24; anchors.right: parent.right anchors.rightMargin: -4 @@ -124,9 +119,9 @@ T.Button { } } - Text { - id: contentText - width: parent.width + Text { // contentText + Layout.preferredWidth: control.sourceSize + Layout.alignment: Qt.AlignHCenter visible: control.text text: control.text @@ -135,7 +130,6 @@ T.Button { font.pixelSize: Theme.fontSizeContentVerySmall font.bold: true - Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter } diff --git a/qml/ComponentLibrary/menus/DrawerButton.qml b/qml/ComponentLibrary/menus/DrawerButton.qml index cf27514..2cd4bbe 100644 --- a/qml/ComponentLibrary/menus/DrawerButton.qml +++ b/qml/ComponentLibrary/menus/DrawerButton.qml @@ -42,8 +42,8 @@ T.ItemDelegate { anchors.rightMargin: 8 RippleThemed { - width: parent.width - height: parent.height + anchors.fill: parent + anchor: control pressed: control.pressed active: enabled && (control.down || control.visualFocus || control.hovered) diff --git a/qml/ComponentLibrary/menus/DrawerItem.qml b/qml/ComponentLibrary/menus/DrawerItem.qml index e784cf3..70d28fe 100644 --- a/qml/ComponentLibrary/menus/DrawerItem.qml +++ b/qml/ComponentLibrary/menus/DrawerItem.qml @@ -34,11 +34,10 @@ T.ItemDelegate { color: control.highlighted ? Theme.colorForeground : Theme.colorBackground RippleThemed { - width: parent.width - height: parent.height + anchors.fill: parent + anchor: control clip: visible - anchor: control pressed: control.pressed active: enabled && (control.down || control.visualFocus || control.hovered) color: Qt.rgba(Theme.colorForeground.r, Theme.colorForeground.g, Theme.colorForeground.b, 0.5)