1
0
Fork 0

Launcher: explicit sizes in aircraft list

Fix some scaling issues when mixing pixel- and point- sized fonts,
especially on Windows
This commit is contained in:
James Turner 2018-03-02 21:09:10 +00:00
parent 7f815c4c51
commit 5020e4655e
9 changed files with 17 additions and 3 deletions

View file

@ -95,6 +95,7 @@ Item {
width: parent.width width: parent.width
text: root.__showAlternateText ? root.alternateText() text: root.__showAlternateText ? root.alternateText()
: model.description : model.description
font.pixelSize: Style.baseFontPixelSize
maximumLineCount: 3 maximumLineCount: 3
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight elide: Text.ElideRight

View file

@ -100,7 +100,7 @@ Rectangle {
width: parent.width width: parent.width
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: aircraft.description != "" visible: aircraft.description != ""
font.pixelSize: 14 font.pixelSize: Style.baseFontPixelSize
} }
Text { Text {
@ -110,7 +110,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: (aircraft.authors != undefined) visible: (aircraft.authors != undefined)
font.pixelSize: Style.baseFontPixelSize
} }
} }
@ -146,6 +146,7 @@ Rectangle {
Text { Text {
id: ratingsLabel id: ratingsLabel
text: qsTr("Ratings:") text: qsTr("Ratings:")
font.pixelSize: Style.baseFontPixelSize
} }
@ -192,6 +193,7 @@ Rectangle {
width: parent.width width: parent.width
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
visible: aircraft.pathOnDisk != undefined visible: aircraft.pathOnDisk != undefined
font.pixelSize: Style.baseFontPixelSize
} }
} // main layout column } // main layout column

View file

@ -1,5 +1,6 @@
import QtQuick 2.0 import QtQuick 2.0
import FlightGear.Launcher 1.0 import FlightGear.Launcher 1.0
import "." // -> forces the qmldir to be loaded
Item { Item {
id: root id: root
@ -143,6 +144,7 @@ Item {
anchors.leftMargin: 6 anchors.leftMargin: 6
anchors.verticalCenter: button.verticalCenter anchors.verticalCenter: button.verticalCenter
text: "Size: " + (root.packageSize / 0x100000).toFixed(1) + "MB" text: "Size: " + (root.packageSize / 0x100000).toFixed(1) + "MB"
font.pixelSize: Style.baseFontPixelSize
} }
Column { Column {
@ -185,6 +187,7 @@ Item {
visible: false visible: false
text: (compact ? "" : "Downloaded ") + (root.downloadedBytes / 0x100000).toFixed(1) + text: (compact ? "" : "Downloaded ") + (root.downloadedBytes / 0x100000).toFixed(1) +
"MB of " + (root.packageSize / 0x100000).toFixed(1) + "MB"; "MB of " + (root.packageSize / 0x100000).toFixed(1) + "MB";
font.pixelSize: Style.baseFontPixelSize
} }
} // item container for progress bar and text } // item container for progress bar and text
} }

View file

@ -18,6 +18,7 @@ Item {
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
text: root.title + ":" text: root.title + ":"
font.pixelSize: Style.baseFontPixelSize
} }
Row { Row {

View file

@ -1,5 +1,6 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import "." // -> forces the qmldir to be loaded
import FlightGear.Launcher 1.0 import FlightGear.Launcher 1.0
@ -37,8 +38,9 @@ Rectangle {
anchors.rightMargin: 4 anchors.rightMargin: 4
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font.pixelSize: 24 font.pixelSize: Style.baseFontPixelSize * 2
text: aircraftInfo.name text: aircraftInfo.name
fontSizeMode: Text.Fit
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1

View file

@ -20,6 +20,7 @@ Rectangle {
anchors.centerIn: parent anchors.centerIn: parent
color: "white" color: "white"
text: (mouse.containsMouse && hoverText != "") ? root.hoverText : root.text text: (mouse.containsMouse && hoverText != "") ? root.hoverText : root.text
font.pixelSize: Style.baseFontPixelSize
} }
MouseArea { MouseArea {

View file

@ -20,6 +20,7 @@ Item {
id: labelText id: labelText
width: parent.width - (emptyTrack.width + Style.margin) width: parent.width - (emptyTrack.width + Style.margin)
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
font.pixelSize: Style.baseFontPixelSize
} }
Rectangle { Rectangle {

View file

@ -18,5 +18,7 @@ QtObject
readonly property string inactiveThemeColor: "#9f9f9f" readonly property string inactiveThemeColor: "#9f9f9f"
readonly property string baseTextColor: "#3f3f3f" readonly property string baseTextColor: "#3f3f3f"
readonly property int baseFontPixelSize: 12
} }

View file

@ -45,6 +45,7 @@ Item {
anchors.left: track.right anchors.left: track.right
anchors.leftMargin: Style.margin anchors.leftMargin: Style.margin
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Style.baseFontPixelSize
} }
MouseArea { MouseArea {