blob: e18f0de3eca530746d82577bf0a30c5232472b73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.impl as ControlsImpl
import QtQuick.Controls.Fusion
import QtQuick.Controls.Fusion.impl
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
DialogsQuickImpl.FileDialogDelegate {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
padding: 6
spacing: 6
file: fileUrl
icon.width: 16
icon.height: 16
icon.color: highlighted ? palette.highlightedText : palette.text
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/folder-icon-round.png"
// We don't use index here, but in C++. Since we're using required
// properties, the index context property will not be injected, so we can't
// use its QQmlContext to access it.
required property int index
required property string fileName
required property url fileUrl
required property date fileModified
contentItem: FolderDialogDelegateLabel {
delegate: control
fileDetailRowTextColor: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.placeholderText
}
background: Rectangle {
implicitWidth: 100
implicitHeight: 20
color: control.down ? Fusion.buttonColor(control.palette, false, true, true)
: control.highlighted ? Fusion.highlight(control.palette) : control.palette.base
}
}
|