mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile-widgets: do not use fontmetric for height
In order to remove fontMetrics from QML, replace references (height) in DownloadFromDiveComputer and Settings Add include kirigami as needed Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2cc215d3f2
commit
3d871ef0de
3 changed files with 9 additions and 9 deletions
|
@ -57,12 +57,12 @@ Kirigami.Page {
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: comboVendor
|
id: comboVendor
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: fontMetrics.height * 2.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
||||||
model: vendorList
|
model: vendorList
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
delegate: Controls.ItemDelegate {
|
delegate: Controls.ItemDelegate {
|
||||||
width: comboVendor.width
|
width: comboVendor.width
|
||||||
height: fontMetrics.height * 2.0
|
height: Kirigami.Units.gridUnit * 2.5
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
text: modelData
|
text: modelData
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
|
@ -99,12 +99,12 @@ Kirigami.Page {
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: comboProduct
|
id: comboProduct
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: fontMetrics.height * 2.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
||||||
model: null
|
model: null
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
delegate: Controls.ItemDelegate {
|
delegate: Controls.ItemDelegate {
|
||||||
width: comboProduct.width
|
width: comboProduct.width
|
||||||
height: fontMetrics.height * 2.0
|
height: Kirigami.Units.gridUnit * 2.5
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
text: modelData
|
text: modelData
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
|
@ -139,12 +139,12 @@ Kirigami.Page {
|
||||||
Controls.ComboBox {
|
Controls.ComboBox {
|
||||||
id: comboConnection
|
id: comboConnection
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: fontMetrics.height * 2.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
||||||
model: connectionListModel
|
model: connectionListModel
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
delegate: Controls.ItemDelegate {
|
delegate: Controls.ItemDelegate {
|
||||||
width: comboConnection.width
|
width: comboConnection.width
|
||||||
height: fontMetrics.height * 2.0
|
height: Kirigami.Units.gridUnit * 2.5
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
text: modelData
|
text: modelData
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
|
|
@ -91,9 +91,6 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
id: defaultCylinderBox
|
id: defaultCylinderBox
|
||||||
Layout.preferredHeight: fontMetrics.height * 2.5
|
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
|
||||||
Layout.fillWidth: true
|
|
||||||
onActivated: {
|
onActivated: {
|
||||||
// the entry for 'no default cylinder' is known to be the top, but its text
|
// the entry for 'no default cylinder' is known to be the top, but its text
|
||||||
// is possibly translated so check against the index
|
// is possibly translated so check against the index
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
import QtQuick 2.11
|
import QtQuick 2.11
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
import QtQuick.Layouts 1.11
|
import QtQuick.Layouts 1.11
|
||||||
|
import org.kde.kirigami 2.4 as Kirigami
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
||||||
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue