Commit 3704a616 authored by Shawn Rutledge's avatar Shawn Rutledge
Browse files

FontDialog: layout tweaks to fit better on small screens


Change-Id: Ic6b5d69a15e67fae70b375fe84d4f094203f20c3
Reviewed-by: default avatarLiang Qi <liang.qi@theqtcompany.com>
Showing with 26 additions and 26 deletions
...@@ -58,8 +58,8 @@ AbstractFontDialog { ...@@ -58,8 +58,8 @@ AbstractFontDialog {
id: content id: content
SystemPalette { id: palette } SystemPalette { id: palette }
implicitWidth: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 60, mainLayout.implicitWidth + 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 * 40, mainLayout.implicitHeight + outerSpacing * 2)) implicitHeight: Math.min(root.__maximumDimension, Math.max(Screen.pixelDensity * 60, mainLayout.implicitHeight + outerSpacing * 2))
property real spacing: 6 property real spacing: 6
property real outerSpacing: 12 property real outerSpacing: 12
color: palette.window color: palette.window
...@@ -126,7 +126,7 @@ AbstractFontDialog { ...@@ -126,7 +126,7 @@ AbstractFontDialog {
focus: true focus: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.minimumWidth: fontColumn.width Layout.preferredWidth: fontColumn.width
headerVisible: false headerVisible: false
function reset() { function reset() {
fontModel.findIndex() fontModel.findIndex()
...@@ -200,7 +200,7 @@ AbstractFontDialog { ...@@ -200,7 +200,7 @@ AbstractFontDialog {
function reset() { function reset() {
weightModel.findIndex() weightModel.findIndex()
} }
TableViewColumn{ id: weightColumn; role: "name"; title: qsTr("Weight") } TableViewColumn { id: weightColumn; role: "name"; title: qsTr("Weight") }
model: ListModel { model: ListModel {
id: weightModel id: weightModel
ListElement { ListElement {
...@@ -339,28 +339,6 @@ AbstractFontDialog { ...@@ -339,28 +339,6 @@ AbstractFontDialog {
} }
Item { Layout.fillHeight: true; } //spacer Item { Layout.fillHeight: true; } //spacer
Label { id: writingSystemLabel; text: qsTr("Writing System"); font.bold: true } 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 { ColumnLayout {
...@@ -397,6 +375,28 @@ AbstractFontDialog { ...@@ -397,6 +375,28 @@ AbstractFontDialog {
id: buttonRow id: buttonRow
Layout.columnSpan: 3 Layout.columnSpan: 3
spacing: content.spacing 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 Item { Layout.fillWidth: true; } //spacer
Button { Button {
text: qsTr("Cancel") text: qsTr("Cancel")
......
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