From 3704a616dfabb71ebd3ffc64f8efe32931c82a8b Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 25 Nov 2014 10:57:01 +0100 Subject: FontDialog: layout tweaks to fit better on small screens Change-Id: Ic6b5d69a15e67fae70b375fe84d4f094203f20c3 Reviewed-by: Liang Qi --- src/dialogs/DefaultFontDialog.qml | 52 +++++++++++++++++++-------------------- 1 file 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") -- cgit v1.2.1