Commit 437ab84c authored by J-P Nurmi's avatar J-P Nurmi
Browse files

Android: fix GroupBoxStyle top margin


GroupBoxStyle was using checkmark indicator's height even when
the GroupBox was not checkable => too much spacing.

Change-Id: Ic68d8428471b8835cd92f44610a0d8b281bcc734
Reviewed-by: default avatarMitch Curtis <mitch.curtis@digia.com>
Showing with 6 additions and 4 deletions
...@@ -53,7 +53,7 @@ GroupBoxStyle { ...@@ -53,7 +53,7 @@ GroupBoxStyle {
readonly property var styleDef: AndroidStyle.styleDef.checkboxStyle readonly property var styleDef: AndroidStyle.styleDef.checkboxStyle
readonly property real contentMargin: label.implicitHeight / 3 readonly property real contentMargin: label.implicitHeight / 3
readonly property real topMargin: indicator.height readonly property real topMargin: control.checkable ? indicator.height : label.height
Binding { target: root; property: "padding.top"; value: topMargin + contentMargin } Binding { target: root; property: "padding.top"; value: topMargin + contentMargin }
Binding { target: root; property: "padding.left"; value: contentMargin } Binding { target: root; property: "padding.left"; value: contentMargin }
Binding { target: root; property: "padding.right"; value: contentMargin } Binding { target: root; property: "padding.right"; value: contentMargin }
...@@ -95,14 +95,15 @@ GroupBoxStyle { ...@@ -95,14 +95,15 @@ GroupBoxStyle {
DrawableLoader { DrawableLoader {
id: indicator id: indicator
visible: control.checkable active: control.checkable
checked: control.checked checked: control.checked
pressed: check.pressed pressed: check.pressed
focused: check.activeFocus focused: check.activeFocus
window_focused: control.Window.active window_focused: control.Window.active
styleDef: AndroidStyle.styleDef.checkboxStyle.CompoundButton_button styleDef: AndroidStyle.styleDef.checkboxStyle.CompoundButton_button
anchors.verticalCenter: label.verticalCenter
width: control.checkable ? item.implicitWidth : 0 width: control.checkable ? item.implicitWidth : 0
anchors.verticalCenter: parent.top
anchors.verticalCenterOffset: topMargin / 2
} }
LabelStyle { LabelStyle {
...@@ -114,9 +115,10 @@ GroupBoxStyle { ...@@ -114,9 +115,10 @@ GroupBoxStyle {
window_focused: control.Window.active window_focused: control.Window.active
styleDef: AndroidStyle.styleDef.checkboxStyle styleDef: AndroidStyle.styleDef.checkboxStyle
anchors.top: parent.top
anchors.left: indicator.right anchors.left: indicator.right
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.top
anchors.verticalCenterOffset: topMargin / 2
} }
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment