diff options
-rw-r--r-- | mobile-widgets/qml/StatisticsPage.qml | 12 | ||||
-rw-r--r-- | mobile-widgets/qml/TemplateSlimComboBox.qml | 22 | ||||
-rw-r--r-- | mobile-widgets/qml/mobile-resources.qrc | 1 |
3 files changed, 28 insertions, 7 deletions
diff --git a/mobile-widgets/qml/StatisticsPage.qml b/mobile-widgets/qml/StatisticsPage.qml index fe6e3666d..2948dd067 100644 --- a/mobile-widgets/qml/StatisticsPage.qml +++ b/mobile-widgets/qml/StatisticsPage.qml @@ -43,11 +43,10 @@ Kirigami.Page { TemplateLabelSmall { text: qsTr("Base variable") } - TemplateComboBox { + TemplateSlimComboBox { id: var1 model: statsManager.var1List currentIndex: statsManager.var1Index; - Layout.fillWidth: false onCurrentIndexChanged: { statsManager.var1Changed(currentIndex) } @@ -61,11 +60,10 @@ Kirigami.Page { TemplateLabelSmall { text: qsTr("Binning") } - TemplateComboBox { + TemplateSlimComboBox { id: var1Binner model: statsManager.binner1List currentIndex: statsManager.binner1Index; - Layout.fillWidth: false onCurrentIndexChanged: { statsManager.var1BinnerChanged(currentIndex) } @@ -79,7 +77,7 @@ Kirigami.Page { TemplateLabelSmall { text: qsTr("Data") } - TemplateComboBox { + TemplateSlimComboBox { id: var2 model: statsManager.var2List currentIndex: statsManager.var2Index; @@ -97,7 +95,7 @@ Kirigami.Page { TemplateLabelSmall { text: qsTr("Binning") } - TemplateComboBox { + TemplateSlimComboBox { id: var2Binner model: statsManager.binner2List currentIndex: statsManager.binner2Index; @@ -115,7 +113,7 @@ Kirigami.Page { TemplateLabelSmall { text: qsTr("Operation") } - TemplateComboBox { + TemplateSlimComboBox { id: var2Operation model: statsManager.operation2List currentIndex: statsManager.operation2Index; diff --git a/mobile-widgets/qml/TemplateSlimComboBox.qml b/mobile-widgets/qml/TemplateSlimComboBox.qml new file mode 100644 index 000000000..36137770a --- /dev/null +++ b/mobile-widgets/qml/TemplateSlimComboBox.qml @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.11 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.11 +import org.kde.kirigami 2.4 as Kirigami + +TemplateComboBox { + id: cb + Layout.fillWidth: false + Layout.preferredHeight: Kirigami.Units.gridUnit * 2 + Layout.preferredWidth: Kirigami.Units.gridUnit * 8 + contentItem: Text { + text: cb.displayText + font.pointSize: subsurfaceTheme.regularPointSize + anchors.right: indicator.left + anchors.left: cb.left + color: subsurfaceTheme.textColor + leftPadding: Kirigami.Units.smallSpacing * 0.5 + rightPadding: Kirigami.Units.smallSpacing * 0.5 + verticalAlignment: Text.AlignVCenter + } +} diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc index d0b285ab6..ffbaaac88 100644 --- a/mobile-widgets/qml/mobile-resources.qrc +++ b/mobile-widgets/qml/mobile-resources.qrc @@ -4,6 +4,7 @@ <file>TemplateButton.qml</file> <file>TemplateCheckBox.qml</file> <file>TemplateComboBox.qml</file> + <file>TemplateSlimComboBox.qml</file> <file>TemplateEditComboBox.qml</file> <file>TemplateLabel.qml</file> <file>TemplateLabelSmall.qml</file> |