filemanager/qml/Dialogs/EmptyTrashDialog.qml

104 lines
3.1 KiB
QML
Raw Permalink Normal View History

2021-05-24 04:01:26 -07:00
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: revenmartin <revenmartin@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/>.
*/
2021-05-21 00:55:58 -07:00
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-11-26 06:18:43 -08:00
FishUI.Window {
2021-05-21 00:55:58 -07:00
id: control
title: qsTr("File Manager")
2021-11-26 06:18:43 -08:00
flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
minimizeButtonVisible: false
2021-05-21 00:55:58 -07:00
visible: true
2021-11-26 06:18:43 -08:00
property int contentWidth: 300 + FishUI.Units.largeSpacing * 2
property int contentHeight: _mainLayout.implicitHeight + control.header.height + FishUI.Units.largeSpacing
2021-05-21 00:55:58 -07:00
2021-11-26 06:18:43 -08:00
width: contentWidth
height: contentHeight
// x: Screen.virtualX + (Screen.width - contentWidth) / 2
// y: Screen.virtualY + (Screen.height - contentHeight) / 2
2021-11-26 06:18:43 -08:00
minimumWidth: contentWidth
minimumHeight: contentHeight
maximumWidth: contentWidth
maximumHeight: contentHeight
headerBackground.color: FishUI.Theme.secondBackgroundColor
DragHandler {
target: null
acceptedDevices: PointerDevice.GenericPointer
grabPermissions: PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything
onActiveChanged: if (active) { control.helper.startSystemMove(control) }
}
2021-05-21 00:55:58 -07:00
Fm {
id: fm
}
Rectangle {
anchors.fill: parent
2021-07-19 01:11:42 -07:00
color: FishUI.Theme.secondBackgroundColor
2021-05-21 00:55:58 -07:00
}
ColumnLayout {
id: _mainLayout
anchors.fill: parent
2021-11-26 06:18:43 -08:00
anchors.topMargin: 0
2021-05-21 00:55:58 -07:00
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
2021-11-26 06:18:43 -08:00
anchors.bottomMargin: FishUI.Units.largeSpacing
2021-05-21 00:55:58 -07:00
spacing: FishUI.Units.largeSpacing
Label {
text: qsTr("Do you want to permanently delete all files from the Trash?")
Layout.fillWidth: true
wrapMode: Text.Wrap
}
RowLayout {
spacing: FishUI.Units.largeSpacing
Button {
text: qsTr("Cancel")
Layout.fillWidth: true
onClicked: control.close()
}
Button {
text: qsTr("Empty Trash")
focus: true
Layout.fillWidth: true
onClicked: {
fm.emptyTrash()
control.close()
}
flat: true
}
}
}
}