You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filemanager/qml/Dialogs/PropertiesDialog.qml

162 lines
4.6 KiB
QML

5 years ago
/*
* 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/>.
*/
6 years ago
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
6 years ago
import FishUI 1.0 as FishUI
6 years ago
FishUI.Window {
6 years ago
id: control
property int widthValue: _mainLayout.implicitWidth + FishUI.Units.largeSpacing * 3
property int heightValue: _mainLayout.implicitHeight + control.header.height + FishUI.Units.largeSpacing * 2
title: qsTr("Properties")
flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
minimizeButtonVisible: false
visible: false
width: widthValue
height: heightValue
minimumWidth: widthValue
minimumHeight: heightValue
maximumWidth: widthValue
maximumHeight: heightValue
Keys.enabled: true
Keys.onEscapePressed: control.close()
background.color: FishUI.Theme.secondBackgroundColor
6 years ago
ColumnLayout {
id: _mainLayout
6 years ago
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing * 1.5
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
anchors.topMargin: FishUI.Units.smallSpacing
anchors.bottomMargin: FishUI.Units.largeSpacing * 1.5
spacing: FishUI.Units.largeSpacing
RowLayout {
spacing: FishUI.Units.largeSpacing * 2
FishUI.IconItem {
width: 48
height: 48
Layout.preferredWidth: 48
Layout.preferredHeight: 48
source: main.iconName
6 years ago
}
Label {
text: main.fileName
Layout.fillWidth: true
elide: Text.ElideMiddle
}
}
6 years ago
GridLayout {
columns: 2
Layout.fillWidth: true
columnSpacing: FishUI.Units.largeSpacing
rowSpacing: FishUI.Units.largeSpacing
Layout.alignment: Qt.AlignTop
6 years ago
Label {
text: qsTr("Type:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
visible: mimeType.visible
}
6 years ago
Label {
id: mimeType
text: main.mimeType
visible: text
}
6 years ago
Label {
text: qsTr("Location:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
}
6 years ago
Label {
id: location
text: main.location
Layout.fillWidth: true
wrapMode: Text.Wrap
}
6 years ago
Label {
text: qsTr("Size:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
}
6 years ago
Label {
id: size
text: main.fileSize ? main.fileSize : qsTr("Calculating...")
}
6 years ago
Label {
text: qsTr("Created:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
visible: creationTime.visible
}
6 years ago
Label {
id: creationTime
text: main.creationTime
visible: text
}
6 years ago
Label {
text: qsTr("Modified:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
visible: modifiedTime.visible
}
6 years ago
Label {
id: modifiedTime
text: main.modifiedTime
visible: text
}
6 years ago
Label {
text: qsTr("Accessed:")
Layout.alignment: Qt.AlignRight
color: FishUI.Theme.disabledTextColor
visible: accessTime.visible
6 years ago
}
Label {
id: accessTime
text: main.accessedTime
visible: text
6 years ago
}
}
6 years ago
}
}