diff --git a/applets/systemtray/package/contents/ui/ConfigEntries.qml b/applets/systemtray/package/contents/ui/ConfigEntries.qml --- a/applets/systemtray/package/contents/ui/ConfigEntries.qml +++ b/applets/systemtray/package/contents/ui/ConfigEntries.qml @@ -17,27 +17,27 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ -import QtQuick 2.0 -import QtQuick.Controls 1.0 as QtControls -import QtQuick.Layouts 1.1 as QtLayouts +import QtQuick 2.5 +import QtQuick.Controls 1.4 as QQC1 +import QtQuick.Controls 2.5 as QQC2 +import QtQuick.Layouts 1.3 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrols 2.0 as KQC +import org.kde.kirigami 2.5 as Kirigami -QtLayouts.GridLayout { +ColumnLayout { id: iconsPage signal configurationChanged property var cfg_shownItems: [] property var cfg_hiddenItems: [] property alias cfg_showAllItems: showAllCheckBox.checked - columns: 2 // so we can indent the entries below... - function saveConfig () { for (var i in tableView.model) { //tableView.model[i].applet.globalShortcut = tableView.model[i].shortcut @@ -63,27 +63,29 @@ } } - QtControls.CheckBox { - id: showAllCheckBox - QtLayouts.Layout.fillWidth: true - QtLayouts.Layout.columnSpan: iconsPage.columns - QtLayouts.Layout.row: 1 - text: i18n("Always show all entries") - } - QtControls.Button { // just for measurement - id: measureButton - text: "measureButton" - visible: false - } + Kirigami.FormLayout { + + QQC2.CheckBox { + id: showAllCheckBox + text: i18n("Always show all entries") + } - // resizeToContents does not take into account the heading - QtControls.Label { - id: shortcutColumnMeasureLabel - text: shortcutColumn.title - visible: false + QQC2.Button { // just for measurement + id: measureButton + text: "measureButton" + visible: false + } + + // resizeToContents does not take into account the heading + QQC2.Label { + id: shortcutColumnMeasureLabel + text: shortcutColumn.title + visible: false + } } + function retrieveAllItems() { var list = []; for (var i = 0; i < statusNotifierModel.count; ++i) { @@ -114,12 +116,11 @@ return list; } - QtControls.TableView { + // There is no QQC2 version of TableView yet + QQC1.TableView { id: tableView - QtLayouts.Layout.fillWidth: true - QtLayouts.Layout.fillHeight: true - QtLayouts.Layout.row: 2 - QtLayouts.Layout.column: 1 + Layout.fillWidth: true + Layout.fillHeight: true model: retrieveAllItems() horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff @@ -139,41 +140,41 @@ border.left: 4 ; border.right: 4 } - QtControls.TableViewColumn { + QQC1.TableViewColumn { id: entryColumn width: tableView.viewport.width - visibilityColumn.width - shortcutColumn.width title: i18nc("Name of the system tray entry", "Entry") movable: false resizable: false - delegate: QtLayouts.RowLayout { + delegate: RowLayout { Item { // spacer - QtLayouts.Layout.preferredWidth: 1 - QtLayouts.Layout.fillHeight: true + Layout.preferredWidth: 1 + Layout.fillHeight: true } QIconItem { width: units.iconSizes.small height: width icon: modelData.iconName || modelData.icon || "" } - QtControls.Label { - QtLayouts.Layout.fillWidth: true + QQC2.Label { + Layout.fillWidth: true text: modelData.name elide: Text.ElideRight wrapMode: Text.NoWrap } } } - QtControls.TableViewColumn { + QQC1.TableViewColumn { id: visibilityColumn title: i18n("Visibility") movable: false resizable: false - delegate: QtControls.ComboBox { + delegate: QQC2.ComboBox { implicitWidth: Math.round(units.gridUnit * 6.5) // ComboBox sizing is broken enabled: !showAllCheckBox.checked @@ -227,7 +228,7 @@ } } - QtControls.TableViewColumn { + QQC1.TableViewColumn { id: shortcutColumn title: i18n("Keyboard Shortcut") // FIXME doesn't fit movable: false