mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
kcms/wifi: Fix wi-fi dialog position, port to Kirigami.Dialog
The Wi-Fi dialog position currently goes under the keyboard, fix it by porting to Kirigami.Dialog
This commit is contained in:
parent
5bf60c491e
commit
78781bcb6f
3 changed files with 23 additions and 100 deletions
|
|
@ -1,14 +1,15 @@
|
|||
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// SPDX-FileCopyrightText: 2020-2024 Devin Lin <espidev@gmail.com>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls 2.15 as Controls
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Layouts 1.2
|
||||
import QtQuick.Controls 2.2 as Controls
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.PromptDialog {
|
||||
id: dialogRoot
|
||||
title: headingText
|
||||
|
||||
property int securityType
|
||||
property string headingText
|
||||
property string devicePath
|
||||
|
|
@ -23,7 +24,6 @@ Kirigami.PromptDialog {
|
|||
passwordField.focus = true;
|
||||
}
|
||||
|
||||
title: headingText
|
||||
standardButtons: Controls.Dialog.Ok | Controls.Dialog.Cancel
|
||||
|
||||
onOpened: passwordField.forceActiveFocus()
|
||||
|
|
@ -58,4 +58,5 @@ Kirigami.PromptDialog {
|
|||
visible: false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2020 Devin Lin <espidev@gmail.com>
|
||||
// SPDX-FileCopyrightText: 2020-2024 Devin Lin <espidev@gmail.com>
|
||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Layouts 1.2
|
||||
import QtQuick.Controls 2.2 as Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import org.kde.kirigami 2.12 as Kirigami
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Controls.Dialog {
|
||||
Kirigami.PromptDialog {
|
||||
id: dialogRoot
|
||||
title: headingText
|
||||
|
||||
property int securityType
|
||||
property string headingText
|
||||
property string devicePath
|
||||
|
|
@ -25,8 +24,6 @@ Controls.Dialog {
|
|||
passwordField.focus = true;
|
||||
}
|
||||
|
||||
anchors.centerIn: parent
|
||||
modal: true
|
||||
standardButtons: Controls.Dialog.Ok | Controls.Dialog.Cancel
|
||||
|
||||
onOpened: passwordField.forceActiveFocus()
|
||||
|
|
@ -44,84 +41,8 @@ Controls.Dialog {
|
|||
passwordField.focus = false;
|
||||
}
|
||||
|
||||
property int translateY: (1 - opacity) * Kirigami.Units.gridUnit * 2
|
||||
|
||||
NumberAnimation on opacity {
|
||||
to: 1
|
||||
from: 0
|
||||
duration: Kirigami.Units.veryShortDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
running: true
|
||||
}
|
||||
|
||||
background: Item {
|
||||
transform: Translate { y: dialogRoot.translateY }
|
||||
|
||||
RectangularGlow {
|
||||
anchors.fill: rect
|
||||
anchors.topMargin: 1
|
||||
cornerRadius: rect.radius * 2
|
||||
glowRadius: 2
|
||||
spread: 0.2
|
||||
color: Qt.rgba(0, 0, 0, 0.3)
|
||||
}
|
||||
Rectangle {
|
||||
id: rect
|
||||
anchors.fill: parent
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
radius: Kirigami.Units.smallSpacing
|
||||
|
||||
Kirigami.Separator {
|
||||
id: topSeparator
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: dialogRoot.header.implicitHeight
|
||||
}
|
||||
|
||||
Kirigami.Separator {
|
||||
id: bottomSeparator
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: dialogRoot.footer.implicitHeight
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Kirigami.Theme.inherit: false
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: topSeparator.bottom
|
||||
anchors.bottom: bottomSeparator.top
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header: Item {
|
||||
transform: Translate { y: dialogRoot.translateY }
|
||||
implicitHeight: heading.implicitHeight + Kirigami.Units.largeSpacing * 2
|
||||
|
||||
Kirigami.Heading {
|
||||
id: heading
|
||||
level: 2
|
||||
text: headingText
|
||||
wrapMode: Text.WordWrap
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: Kirigami.Units.largeSpacing
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
footer.transform: Translate { y: dialogRoot.translateY }
|
||||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
transform: Translate { y: dialogRoot.translateY }
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
PasswordField {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ SimpleKCM {
|
|||
|
||||
ConnectDialog {
|
||||
id: connectionDialog
|
||||
parent: root
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
|||
Loading…
Reference in a new issue