Improve HButton behavior on small fixed size

This commit is contained in:
miruka 2019-12-02 04:40:01 -04:00
parent 92bfb02446
commit bbb872e5dc
2 changed files with 8 additions and 5 deletions

View File

@ -4,12 +4,12 @@ import QtQuick.Layouts 1.12
Button {
id: button
spacing: theme.spacing
topPadding: spacing / (circle ? 1.75 : 1.5)
bottomPadding: topPadding
leftPadding: spacing / (circle ? 1.5 : 1)
rightPadding: leftPadding
enabled: ! button.loading
spacing: theme.spacing
topPadding: padded ? spacing / (circle ? 1.75 : 1.5) : 0
bottomPadding: topPadding
leftPadding: padded ? spacing / (circle ? 1.5 : 1) : 0
rightPadding: leftPadding
iconItem.svgName: loading ? "hourglass" : icon.name
icon.color: theme.icons.colorize
@ -35,6 +35,7 @@ Button {
property bool disableWhileLoading: true
property bool loading: false
property bool circle: false
property bool padded: true
property HToolTip toolTip: HToolTip {
id: toolTip

View File

@ -21,6 +21,7 @@ HRowLayout {
Item {
id: iconWrapper
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: icon.width
Layout.preferredHeight: icon.height
@ -92,6 +93,7 @@ HRowLayout {
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
Layout.alignment: Qt.AlignCenter
Layout.fillWidth: true
Layout.fillHeight: true
}