filemanager/qml/Dialogs/DeleteDialog.qml

83 lines
2.4 KiB
QML
Raw Normal View History

2021-09-03 11:26:01 -07:00
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong <reionwong@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.12
import FishUI 1.0 as FishUI
import Cutefish.FileManager 1.0
2021-12-31 20:20:58 -08:00
FishUI.Window {
2021-09-03 11:26:01 -07:00
id: control
2021-12-31 20:20:58 -08:00
flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
minimizeButtonVisible: false
visible: true
2021-09-03 11:26:01 -07:00
2021-12-31 20:20:58 -08:00
width: contentWidth
height: contentHeight
minimumWidth: contentWidth
minimumHeight: contentHeight
maximumWidth: contentWidth
maximumHeight: contentHeight
property var contentWidth: _mainLayout.implicitWidth + FishUI.Units.largeSpacing * 2
property var contentHeight: _mainLayout.implicitHeight + control.header.height + FishUI.Units.largeSpacing * 2
background.color: FishUI.Theme.secondBackgroundColor
2021-09-03 11:26:01 -07:00
ColumnLayout {
id: _mainLayout
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
anchors.bottomMargin: FishUI.Units.smallSpacing
spacing: FishUI.Units.largeSpacing
Label {
text: qsTr("Do you want to delete it permanently?")
Layout.fillWidth: true
wrapMode: Text.Wrap
}
RowLayout {
spacing: FishUI.Units.largeSpacing
Button {
text: qsTr("Cancel")
Layout.fillWidth: true
2021-12-31 20:20:58 -08:00
onClicked: control.close()
2021-09-03 11:26:01 -07:00
}
Button {
text: qsTr("Delete")
focus: true
Layout.fillWidth: true
onClicked: {
2021-12-31 20:20:58 -08:00
control.close()
2021-09-03 11:26:01 -07:00
model.deleteSelected()
}
flat: true
}
}
}
}