Skip to content

Commit 3fc61a4

Browse files
vsklencarwonder-sk
authored andcommittedSep 11, 2020
[QgsQuick] Date time widget - adjusted for small screens
1 parent 4e6acb6 commit 3fc61a4

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed
 

‎src/quickgui/plugin/editor/qgsquickdatetime.qml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import QtQuick.Controls 2.2
1818
import QtQuick.Layouts 1.1
1919
import QtQuick.Controls 1.4 as Controls1
2020
import QtGraphicalEffects 1.0
21+
import QtQuick.Window 2.0
2122
import QgsQuick 0.1 as QgsQuick
2223

2324
/**
@@ -167,11 +168,16 @@ Item {
167168
parent: ApplicationWindow.overlay
168169
anchors.centerIn: parent
169170

170-
ColumnLayout {
171-
Rectangle {
171+
ScrollView {
172+
clip: true
173+
width: parent.width
174+
height: parent.height
175+
176+
ColumnLayout {
177+
Rectangle {
172178
id: calendarOverlay
173179
color: "transparent"
174-
implicitWidth: ApplicationWindow.window.width * 0.8
180+
implicitWidth: Math.min(Screen.width, Screen.height) * 0.8
175181
implicitHeight: implicitWidth
176182
visible: main.typeFromFieldFormat === "Date" || main.typeFromFieldFormat === "Date Time"
177183

@@ -185,7 +191,6 @@ Item {
185191
id: calendarGrid
186192
anchors.left: parent.left
187193
anchors.right: parent.right
188-
//Layout.alignment: Qt.AlignHCenter
189194
columns: 1
190195
implicitWidth: calendarOverlay.width
191196
implicitHeight: calendarOverlay.height
@@ -302,7 +307,8 @@ Item {
302307
popup.close()
303308
}
304309
}
305-
}
310+
}
311+
}
306312
}
307313
}
308314

0 commit comments

Comments
 (0)
Please sign in to comment.