Commit 647549a0 authored by Nate Graham's avatar Nate Graham 🔩

[applets/Weather] Improve station chooser window's default size and margins

parent 62574d3a
......@@ -86,88 +86,86 @@ ColumnLayout {
}
ColumnLayout {
RowLayout {
Layout.fillWidth: true
RowLayout {
Layout.fillWidth: true
QtControls.TextField {
id: searchStringEdit
QtControls.TextField {
id: searchStringEdit
Layout.fillWidth: true
Layout.minimumWidth: implicitWidth
placeholderText: i18nc("@info:placeholder", "Enter location")
onAccepted: {
searchLocation();
}
Layout.fillWidth: true
Layout.minimumWidth: implicitWidth
placeholderText: i18nc("@info:placeholder", "Enter location")
onAccepted: {
searchLocation();
}
}
QtControls.Button {
id: serviceSelectionButton
QtControls.Button {
id: serviceSelectionButton
iconName: "services"
tooltip: i18nc("@info:tooltip", "Select weather services providers")
menu: serviceSelectionMenu
}
iconName: "services"
tooltip: i18nc("@info:tooltip", "Select weather services providers")
menu: serviceSelectionMenu
}
Item {
Layout.preferredHeight: Math.max(searchButton.height, searchStringEdit.height)
Layout.preferredWidth: Layout.preferredHeight
Item {
Layout.preferredHeight: Math.max(searchButton.height, searchStringEdit.height)
Layout.preferredWidth: Layout.preferredHeight
PlasmaComponents.BusyIndicator {
id: busy
PlasmaComponents.BusyIndicator {
id: busy
anchors.fill: parent
visible: locationListModel.validatingInput
}
anchors.fill: parent
visible: locationListModel.validatingInput
}
}
QtControls.Button {
id: searchButton
QtControls.Button {
id: searchButton
iconName: "edit-find"
text: i18nc("@action:button", "Search")
enabled: canSearch
iconName: "edit-find"
text: i18nc("@action:button", "Search")
enabled: canSearch
onClicked: {
searchLocation();
}
onClicked: {
searchLocation();
}
}
}
QtControls.TableView {
id: locationListView
QtControls.TableView {
id: locationListView
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: implicitHeight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: implicitWidth
Layout.minimumHeight: implicitHeight
Layout.fillWidth: true
Layout.fillHeight: true
headerVisible: false
model: locationListModel
headerVisible: false
model: locationListModel
onActivated: {
if (row !== -1 && rowCount) {
source = locationListModel.valueForListIndex(row);
}
onActivated: {
if (row !== -1 && rowCount) {
source = locationListModel.valueForListIndex(row);
}
}
QtControls.TableViewColumn {
id: locationListViewStationColumn
QtControls.TableViewColumn {
id: locationListViewStationColumn
movable: false
resizable: false
role: "display"
}
movable: false
resizable: false
role: "display"
}
QtControls.Label {
id: noSearchResultReport
QtControls.Label {
id: noSearchResultReport
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
visible: false
}
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
visible: false
}
}
......
......@@ -22,6 +22,7 @@ import QtQuick.Controls 1.4 as QtControls
import QtQuick.Layouts 1.3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.5 as Kirigami
Window {
......@@ -33,8 +34,8 @@ Window {
flags: Qt.Dialog
modality: Qt.WindowModal
minimumWidth: mainColumn.Layout.minimumWidth
minimumHeight: mainColumn.Layout.minimumHeight
width: Kirigami.Units.gridUnit * 25
height: Kirigami.Units.gridUnit * 20
title: i18nc("@title:window", "Select Weather Station")
color: syspal.window
......@@ -79,9 +80,6 @@ Window {
fill: parent
margins: mainColumn.spacing * units.devicePixelRatio //margins are hardcoded in QStyle we should match that here
}
// TODO: not yet perfect
Layout.minimumWidth: Math.max(stationPicker.Layout.minimumWidth, buttonsRow.implicitWidth) + 2*anchors.margins
Layout.minimumHeight: stationPicker.Layout.minimumHeight + buttonsRow.implicitHeight + 2*anchors.margins
WeatherStationPicker {
id: stationPicker
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment