Changeset View
Changeset View
Standalone View
Standalone View
src/qtquick/qml/Dialog.qml
Show All 28 Lines | |||||
29 | * @since 5.63 | 29 | * @since 5.63 | ||
30 | */ | 30 | */ | ||
31 | 31 | | |||
32 | import QtQuick 2.11 | 32 | import QtQuick 2.11 | ||
33 | import QtQuick.Controls 2.5 as QtControls | 33 | import QtQuick.Controls 2.5 as QtControls | ||
34 | import QtQuick.Layouts 1.11 as QtLayouts | 34 | import QtQuick.Layouts 1.11 as QtLayouts | ||
35 | import QtQuick.Dialogs 1.3 as QtDialogs | 35 | import QtQuick.Dialogs 1.3 as QtDialogs | ||
36 | 36 | | |||
37 | import org.kde.kirigami 2.7 as Kirigami | ||||
37 | import org.kde.newstuff 1.62 as NewStuff | 38 | import org.kde.newstuff 1.62 as NewStuff | ||
38 | 39 | | |||
39 | QtDialogs.Dialog { | 40 | QtDialogs.Dialog { | ||
40 | id: component | 41 | id: component | ||
41 | 42 | | |||
42 | /** | 43 | /** | ||
43 | * The configuration file to use for this button | 44 | * The configuration file to use for this button | ||
44 | */ | 45 | */ | ||
Show All 36 Lines | |||||
81 | property alias changedEntries: component.engine.changedEntries | 82 | property alias changedEntries: component.engine.changedEntries | ||
82 | 83 | | |||
83 | onVisibleChanged: { | 84 | onVisibleChanged: { | ||
84 | if (visible === true) { | 85 | if (visible === true) { | ||
85 | newStuffPage.engine.resetChangedEntries(); | 86 | newStuffPage.engine.resetChangedEntries(); | ||
86 | } | 87 | } | ||
87 | } | 88 | } | ||
88 | 89 | | |||
89 | contentItem: QtLayouts.ColumnLayout { | 90 | contentItem: Rectangle { | ||
91 | color: Kirigami.Theme.backgroundColor | ||||
92 | implicitWidth: 700 | ||||
93 | implicitHeight: 540 | ||||
94 | Keys.onEscapePressed: component.close() | ||||
90 | NewStuff.DialogContent { | 95 | NewStuff.DialogContent { | ||
91 | id: newStuffPage | 96 | id: newStuffPage | ||
92 | QtLayouts.Layout.fillWidth: true | 97 | anchors { | ||
93 | QtLayouts.Layout.fillHeight: true | 98 | top: parent.top | ||
99 | left: parent.left | ||||
100 | right: parent.right | ||||
101 | bottom: buttonBox.top | ||||
102 | } | ||||
94 | downloadNewWhat: component.downloadNewWhat | 103 | downloadNewWhat: component.downloadNewWhat | ||
95 | } | 104 | } | ||
96 | QtControls.DialogButtonBox { | 105 | QtControls.DialogButtonBox { | ||
97 | QtLayouts.Layout.fillWidth: true | 106 | id: buttonBox | ||
98 | QtControls.Button { | 107 | anchors { | ||
99 | action: QtControls.Action { | 108 | left: parent.left | ||
100 | text: i18n("Close") | 109 | right: parent.right | ||
101 | shortcut: "esc" | 110 | bottom: parent.bottom | ||
102 | onTriggered: { | | |||
103 | component.close(); | | |||
104 | } | | |||
105 | } | | |||
106 | QtControls.DialogButtonBox.buttonRole: QtControls.DialogButtonBox.RejectRole // this is a close button, dialog close buttons have a rejection role... | | |||
107 | } | 111 | } | ||
112 | standardButtons: QtControls.DialogButtonBox.Close | ||||
113 | onRejected: component.close() | ||||
108 | } | 114 | } | ||
109 | } | 115 | } | ||
110 | } | 116 | } |