1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-02-11 15:07:16 +00:00
UTPass/qml/components/FileDir.qml

82 lines
2.2 KiB
QML
Raw Normal View History

2025-01-10 15:28:42 +01:00
import "../dialogs"
import "../styles"
import Lomiri.Components 1.3
import Lomiri.Components.Popups 1.3
import Lomiri.Components.Themes 1.3
2019-09-20 21:29:39 +02:00
import Pass 1.0
2025-01-10 15:28:42 +01:00
import QtQuick 2.4
2019-09-20 21:29:39 +02:00
Item {
//property string folder
id: fileDir
property string fName
property bool fIsDir
property bool commonBorder: true
property int lBorderwidth: 0
property int rBorderwidth: 0
property int tBorderwidth: 0
property int bBorderwidth: 0
property int commonBorderWidth: 0
property string borderColor: LomiriColors.warmGrey
signal clicked()
anchors.right: parent.right
anchors.left: parent.left
height: units.gu(5)
2019-09-20 21:29:39 +02:00
Rectangle {
anchors.fill: parent
color: theme.palette.normal.background
2019-09-20 21:29:39 +02:00
Text {
text: fileDir.fIsDir ? fileDir.fName : fileDir.fName.slice(0, -4) // remove .gpg if it's a file
2019-09-20 21:29:39 +02:00
anchors.left: parent.left
anchors.leftMargin: units.gu(2)
anchors.verticalCenter: parent.verticalCenter
color: theme.palette.normal.backgroundText
2019-09-20 21:29:39 +02:00
}
Icon {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: units.gu(2)
height: units.gu(4)
name: fileDir.fIsDir ? "go-next" : "lock"
color: LomiriColors.orange
2019-09-20 21:29:39 +02:00
}
MouseArea {
// onClicked: {
// var path = fileDir.fdfolder + "/" + fileName;
// if (fileIsDir) {
// fileDir.fdfolder = path;
// //backAction.visible = true;
// // passwordListHeader.title = fileName;
// } else {
// console.debug("pass show %1".arg(path));
// Pass.show(path);
// }
// }
2019-09-20 21:29:39 +02:00
anchors.fill: parent
onClicked: fileDir.clicked()
2019-09-20 21:29:39 +02:00
}
CustomBorder {
id: cb
commonBorder: fileDir.commonBorder
lBorderwidth: fileDir.lBorderwidth
rBorderwidth: fileDir.rBorderwidth
tBorderwidth: fileDir.tBorderwidth
bBorderwidth: fileDir.bBorderwidth
borderColor: fileDir.borderColor
2019-09-20 21:29:39 +02:00
}
}
2025-01-10 15:28:42 +01:00
2019-09-20 21:29:39 +02:00
}