Index: sources/gui/qml/pages/settings/SettingsLocalization.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -redb8ee3edc41b1d324cd8a53e8e27a2a58289563 --- sources/gui/qml/pages/settings/SettingsLocalization.qml (.../SettingsLocalization.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/settings/SettingsLocalization.qml (.../SettingsLocalization.qml) (revision edb8ee3edc41b1d324cd8a53e8e27a2a58289563) @@ -15,11 +15,11 @@ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 // Switch - // Qml imports import "qrc:/globals" +import "qrc:/components" +import "qrc:/compounds" /*! * \brief SettingsROInput is the screen @@ -30,90 +30,41 @@ confirmVisible : true notificationText: vLocalization.notification + contentArea.anchors.topMargin: Variables.defaultMargin * 10 - Row { id: _settingsRoInputRow - anchors.centerIn: parent + contentItem: Item { + LabelUnitContainer { id: _settingsLanguageItem + anchors.horizontalCenter : parent.horizontalCenter + width : Variables.adjustmentLabelUnitContainerWidth + height : Variables.adjustmentLabelUnitContainerHeight + showUnit : false + text : qsTr("Language") - Text { id : _settingsLanguageLabel - text : qsTr("Language") - width : 150 - height : _settingsLanguageCombo.height - color : Colors.white - font.pixelSize : Fonts.fontPixelTextRectTitle - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft - } - - // FIXME: This combobox needs to be a global Component - ComboBox { id : _settingsLanguageCombo - currentIndex : vLocalization.languageIndex - displayText : currentText - font.pixelSize : Fonts.fontPixelTextRectTitle - width : 300 - height : 55 - padding : 10 - model : vLocalization.languageList - - background : Rectangle { - color : Colors.transparent - border.color : enabled ? Colors.borderButton : Colors.borderDisableButton - radius : Variables.dialogRadius + contentItem: BaseComboBox { id: _settingsLanguageCombo + anchors.rightMargin : Variables.defaultMargin * 2 + anchors.leftMargin : anchors.rightMargin + anchors.topMargin : Variables.defaultMargin / 2 + anchors.bottomMargin: anchors.topMargin + currentIndex : vLocalization.languageIndex + model : vLocalization.languageList } - - delegate: ItemDelegate { id : _settingsLanguageDelegate - width : _settingsLanguageCombo.width // + anchors.margins - 2 // 2 is the border width - height : 50 - contentItem: Text { - text : modelData - color : Colors.textMain - font : _settingsLanguageCombo.font - padding : 10 - verticalAlignment : Text.AlignVCenter - } - background : Rectangle { - anchors.fill : parent - anchors.margins : 10 / 2 - visible : _settingsLanguageDelegate.down || _settingsLanguageDelegate.highlighted || _settingsLanguageDelegate.visualFocus - color : _settingsLanguageDelegate.down ? Colors.backgroundButtonSelect : - Colors.backgroundButtonSelectDark - } - highlighted : _settingsLanguageCombo.highlightedIndex === index - } - popup: Popup { - y : _settingsLanguageCombo.height - x : - _settingsLanguageCombo.anchors.leftMargin - width : _settingsLanguageCombo.width + _settingsLanguageCombo.anchors.leftMargin - implicitHeight : contentItem.implicitHeight - contentItem : ListView { - clip : true - implicitHeight : contentHeight - currentIndex : _settingsLanguageCombo.highlightedIndex - model : _settingsLanguageCombo.popup.visible ? _settingsLanguageCombo.delegateModel : null - } - background: Rectangle { - color : Colors.backgroundMain - border.color : Colors.borderButton - radius : Variables.dialogRadius - } - } } } onConfirmClicked : { - _confirmDialog.titleText = _root.title + _confirmDialog.titleText = _headerBar.titleText _confirmDialog.open() } Connections { target: _confirmDialog function onAccepted() { - if ( _confirmDialog.titleText == _root.title ) { // use the title as the indication of what has been confirmed and if that is related to this function. + if ( _confirmDialog.titleText === _headerBar.titleText ) { // use the title as the indication of what has been confirmed and if that is related to this function. vLocalization.doAdjustment(_settingsLanguageCombo.currentIndex) } } } Connections { target: _settingsLanguageCombo - function onCurrentIndexChanged() { vLocalization.notification = "" }