summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-11-25 10:57:01 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2014-11-25 15:55:25 +0100
commit3704a616dfabb71ebd3ffc64f8efe32931c82a8b (patch)
treeeede1c2d8a016f441f7b0d8f9277a7ec05f75a37
parentdb77a10eb5a02ad558212faf78fcbc13cf1a694a (diff)
downloadqtquickcontrols-3704a616dfabb71ebd3ffc64f8efe32931c82a8b.tar.gz
FontDialog: layout tweaks to fit better on small screens
Change-Id: Ic6b5d69a15e67fae70b375fe84d4f094203f20c3 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
-rw-r--r--src/dialogs/DefaultFontDialog.qml52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/dialogs/DefaultFontDialog.qml b/src/dialogs/DefaultFontDialog.qml
index 26f92466..d5c4570a 100644
--- a/src/dialogs/DefaultFontDialog.qml
+++ b/src/dialogs/DefaultFontDialog.qml
@@ -58,8 +58,8 @@ AbstractFontDialog {
id: content
SystemPalette { id: palette }
- implicitWidth: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 60, mainLayout.implicitWidth + outerSpacing * 2))
- implicitHeight: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 40, mainLayout.implicitHeight + outerSpacing * 2))
+ implicitWidth: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 100, mainLayout.implicitWidth + outerSpacing * 2))
+ implicitHeight: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 60, mainLayout.implicitHeight + outerSpacing * 2))
property real spacing: 6
property real outerSpacing: 12
color: palette.window
@@ -126,7 +126,7 @@ AbstractFontDialog {
focus: true
Layout.fillWidth: true
Layout.fillHeight: true
- Layout.minimumWidth: fontColumn.width
+ Layout.preferredWidth: fontColumn.width
headerVisible: false
function reset() {
fontModel.findIndex()
@@ -200,7 +200,7 @@ AbstractFontDialog {
function reset() {
weightModel.findIndex()
}
- TableViewColumn{ id: weightColumn; role: "name"; title: qsTr("Weight") }
+ TableViewColumn { id: weightColumn; role: "name"; title: qsTr("Weight") }
model: ListModel {
id: weightModel
ListElement {
@@ -339,28 +339,6 @@ AbstractFontDialog {
}
Item { Layout.fillHeight: true; } //spacer
Label { id: writingSystemLabel; text: qsTr("Writing System"); font.bold: true }
- ComboBox {
- id: wsComboBox
- function reset() {
- if (wsModel.count > 0) {
- currentIndex = 0
- }
- }
- textRole: "name"
- model: WritingSystemListModel {
- id: wsModel
- Component.onCompleted: wsComboBox.reset()
- }
- onCurrentIndexChanged: {
- if (currentIndex == -1)
- return
-
- content.writingSystem = wsModel.get(currentIndex).name
- fontModel.writingSystem = content.writingSystem
- content.writingSystemSample = wsModel.get(currentIndex).sample
- fontListView.reset()
- }
- }
}
ColumnLayout {
@@ -397,6 +375,28 @@ AbstractFontDialog {
id: buttonRow
Layout.columnSpan: 3
spacing: content.spacing
+ ComboBox {
+ id: wsComboBox
+ function reset() {
+ if (wsModel.count > 0) {
+ currentIndex = 0
+ }
+ }
+ textRole: "name"
+ model: WritingSystemListModel {
+ id: wsModel
+ Component.onCompleted: wsComboBox.reset()
+ }
+ onCurrentIndexChanged: {
+ if (currentIndex == -1)
+ return
+
+ content.writingSystem = wsModel.get(currentIndex).name
+ fontModel.writingSystem = content.writingSystem
+ content.writingSystemSample = wsModel.get(currentIndex).sample
+ fontListView.reset()
+ }
+ }
Item { Layout.fillWidth: true; } //spacer
Button {
text: qsTr("Cancel")