Fix tray visibility and message reception issues
- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,577 @@
|
||||
import QtQuick.tooling 1.2
|
||||
|
||||
// This file describes the plugin-supplied types contained in the library.
|
||||
// It is used for QML tooling purposes only.
|
||||
//
|
||||
// This file was auto-generated by qmltyperegistrar.
|
||||
|
||||
Module {
|
||||
Component {
|
||||
file: "private/qquickabstractdialog_p.h"
|
||||
lineNumber: 40
|
||||
name: "QQuickAbstractDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QObject"
|
||||
interfaces: ["QQmlParserStatus"]
|
||||
Enum {
|
||||
name: "StandardCode"
|
||||
lineNumber: 81
|
||||
values: ["Rejected", "Accepted"]
|
||||
}
|
||||
Property {
|
||||
name: "data"
|
||||
type: "QObject"
|
||||
isList: true
|
||||
read: "data"
|
||||
index: 0
|
||||
lineNumber: 44
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "parentWindow"
|
||||
type: "QWindow"
|
||||
isPointer: true
|
||||
read: "parentWindow"
|
||||
write: "setParentWindow"
|
||||
reset: "resetParentWindow"
|
||||
notify: "parentWindowChanged"
|
||||
index: 1
|
||||
lineNumber: 45
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "title"
|
||||
type: "QString"
|
||||
read: "title"
|
||||
write: "setTitle"
|
||||
notify: "titleChanged"
|
||||
index: 2
|
||||
lineNumber: 46
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "flags"
|
||||
type: "Qt::WindowFlags"
|
||||
read: "flags"
|
||||
write: "setFlags"
|
||||
notify: "flagsChanged"
|
||||
index: 3
|
||||
lineNumber: 47
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "modality"
|
||||
type: "Qt::WindowModality"
|
||||
read: "modality"
|
||||
write: "setModality"
|
||||
notify: "modalityChanged"
|
||||
index: 4
|
||||
lineNumber: 48
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "popupType"
|
||||
revision: 1546
|
||||
type: "QQuickPopup::PopupType"
|
||||
read: "popupType"
|
||||
write: "setPopupType"
|
||||
reset: "resetPopupType"
|
||||
notify: "popupTypeChanged"
|
||||
index: 5
|
||||
lineNumber: 49
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "visible"
|
||||
type: "bool"
|
||||
read: "isVisible"
|
||||
write: "setVisible"
|
||||
notify: "visibleChanged"
|
||||
index: 6
|
||||
lineNumber: 50
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "result"
|
||||
type: "int"
|
||||
read: "result"
|
||||
write: "setResult"
|
||||
notify: "resultChanged"
|
||||
index: 7
|
||||
lineNumber: 51
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "accepted"; lineNumber: 99 }
|
||||
Signal { name: "rejected"; lineNumber: 100 }
|
||||
Signal { name: "parentWindowChanged"; lineNumber: 101 }
|
||||
Signal { name: "titleChanged"; lineNumber: 102 }
|
||||
Signal { name: "flagsChanged"; lineNumber: 103 }
|
||||
Signal { name: "modalityChanged"; lineNumber: 104 }
|
||||
Signal { name: "visibleChanged"; lineNumber: 105 }
|
||||
Signal { name: "resultChanged"; lineNumber: 106 }
|
||||
Signal { name: "popupTypeChanged"; revision: 1546; lineNumber: 107 }
|
||||
Method { name: "open"; lineNumber: 92 }
|
||||
Method { name: "close"; lineNumber: 93 }
|
||||
Method { name: "accept"; lineNumber: 94 }
|
||||
Method { name: "reject"; lineNumber: 95 }
|
||||
Method {
|
||||
name: "done"
|
||||
lineNumber: 96
|
||||
Parameter { name: "result"; type: "int" }
|
||||
}
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickcolordialog_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickColorDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickAbstractDialog"
|
||||
extension: "QColorDialogOptions"
|
||||
extensionIsNamespace: true
|
||||
exports: [
|
||||
"QtQuick.Dialogs/ColorDialog 6.4",
|
||||
"QtQuick.Dialogs/ColorDialog 6.10"
|
||||
]
|
||||
exportMetaObjectRevisions: [1540, 1546]
|
||||
Property {
|
||||
name: "selectedColor"
|
||||
type: "QColor"
|
||||
read: "selectedColor"
|
||||
write: "setSelectedColor"
|
||||
notify: "selectedColorChanged"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
}
|
||||
Property {
|
||||
name: "options"
|
||||
type: "QColorDialogOptions::ColorDialogOptions"
|
||||
read: "options"
|
||||
write: "setOptions"
|
||||
reset: "resetOptions"
|
||||
notify: "optionsChanged"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
}
|
||||
Signal { name: "selectedColorChanged"; lineNumber: 45 }
|
||||
Signal { name: "optionsChanged"; lineNumber: 46 }
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickfiledialog_p.h"
|
||||
lineNumber: 28
|
||||
name: "QQuickFileDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickAbstractDialog"
|
||||
extension: "QFileDialogOptions"
|
||||
extensionIsNamespace: true
|
||||
exports: [
|
||||
"QtQuick.Dialogs/FileDialog 6.2",
|
||||
"QtQuick.Dialogs/FileDialog 6.10"
|
||||
]
|
||||
exportMetaObjectRevisions: [1538, 1546]
|
||||
Enum {
|
||||
name: "FileMode"
|
||||
lineNumber: 51
|
||||
values: ["OpenFile", "OpenFiles", "SaveFile"]
|
||||
}
|
||||
Property {
|
||||
name: "fileMode"
|
||||
type: "FileMode"
|
||||
read: "fileMode"
|
||||
write: "setFileMode"
|
||||
notify: "fileModeChanged"
|
||||
index: 0
|
||||
lineNumber: 31
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "selectedFile"
|
||||
type: "QUrl"
|
||||
read: "selectedFile"
|
||||
write: "setSelectedFile"
|
||||
notify: "selectedFileChanged"
|
||||
index: 1
|
||||
lineNumber: 32
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "selectedFiles"
|
||||
type: "QUrl"
|
||||
isList: true
|
||||
read: "selectedFiles"
|
||||
notify: "selectedFilesChanged"
|
||||
index: 2
|
||||
lineNumber: 33
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "currentFile"
|
||||
type: "QUrl"
|
||||
read: "currentFile"
|
||||
write: "setCurrentFile"
|
||||
notify: "currentFileChanged"
|
||||
index: 3
|
||||
lineNumber: 34
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "currentFiles"
|
||||
type: "QUrl"
|
||||
isList: true
|
||||
read: "currentFiles"
|
||||
write: "setCurrentFiles"
|
||||
notify: "currentFilesChanged"
|
||||
index: 4
|
||||
lineNumber: 35
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "currentFolder"
|
||||
type: "QUrl"
|
||||
read: "currentFolder"
|
||||
write: "setCurrentFolder"
|
||||
notify: "currentFolderChanged"
|
||||
index: 5
|
||||
lineNumber: 36
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "options"
|
||||
type: "QFileDialogOptions::FileDialogOptions"
|
||||
read: "options"
|
||||
write: "setOptions"
|
||||
reset: "resetOptions"
|
||||
notify: "optionsChanged"
|
||||
index: 6
|
||||
lineNumber: 37
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "nameFilters"
|
||||
type: "QStringList"
|
||||
read: "nameFilters"
|
||||
write: "setNameFilters"
|
||||
reset: "resetNameFilters"
|
||||
notify: "nameFiltersChanged"
|
||||
index: 7
|
||||
lineNumber: 38
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "selectedNameFilter"
|
||||
type: "QQuickFileNameFilter"
|
||||
isPointer: true
|
||||
read: "selectedNameFilter"
|
||||
index: 8
|
||||
lineNumber: 39
|
||||
isReadonly: true
|
||||
isPropertyConstant: true
|
||||
}
|
||||
Property {
|
||||
name: "defaultSuffix"
|
||||
type: "QString"
|
||||
read: "defaultSuffix"
|
||||
write: "setDefaultSuffix"
|
||||
reset: "resetDefaultSuffix"
|
||||
notify: "defaultSuffixChanged"
|
||||
index: 9
|
||||
lineNumber: 40
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "acceptLabel"
|
||||
type: "QString"
|
||||
read: "acceptLabel"
|
||||
write: "setAcceptLabel"
|
||||
reset: "resetAcceptLabel"
|
||||
notify: "acceptLabelChanged"
|
||||
index: 10
|
||||
lineNumber: 41
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "rejectLabel"
|
||||
type: "QString"
|
||||
read: "rejectLabel"
|
||||
write: "setRejectLabel"
|
||||
reset: "resetRejectLabel"
|
||||
notify: "rejectLabelChanged"
|
||||
index: 11
|
||||
lineNumber: 42
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "fileModeChanged"; lineNumber: 98 }
|
||||
Signal { name: "selectedFileChanged"; lineNumber: 99 }
|
||||
Signal { name: "selectedFilesChanged"; lineNumber: 100 }
|
||||
Signal { name: "currentFileChanged"; lineNumber: 101 }
|
||||
Signal { name: "currentFilesChanged"; lineNumber: 102 }
|
||||
Signal { name: "currentFolderChanged"; lineNumber: 103 }
|
||||
Signal { name: "optionsChanged"; lineNumber: 104 }
|
||||
Signal { name: "nameFiltersChanged"; lineNumber: 105 }
|
||||
Signal { name: "defaultSuffixChanged"; lineNumber: 106 }
|
||||
Signal { name: "acceptLabelChanged"; lineNumber: 107 }
|
||||
Signal { name: "rejectLabelChanged"; lineNumber: 108 }
|
||||
}
|
||||
Component {
|
||||
file: "private/qtquickdialogs2foreign_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickFileNameFilter"
|
||||
accessSemantics: "reference"
|
||||
prototype: "QObject"
|
||||
Property {
|
||||
name: "index"
|
||||
type: "int"
|
||||
read: "index"
|
||||
write: "setIndex"
|
||||
notify: "indexChanged"
|
||||
index: 0
|
||||
lineNumber: 31
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "name"
|
||||
type: "QString"
|
||||
read: "name"
|
||||
notify: "nameChanged"
|
||||
index: 1
|
||||
lineNumber: 32
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "extensions"
|
||||
type: "QStringList"
|
||||
read: "extensions"
|
||||
notify: "extensionsChanged"
|
||||
index: 2
|
||||
lineNumber: 33
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "globs"
|
||||
type: "QStringList"
|
||||
read: "globs"
|
||||
notify: "globsChanged"
|
||||
index: 3
|
||||
lineNumber: 34
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Signal {
|
||||
name: "indexChanged"
|
||||
lineNumber: 52
|
||||
Parameter { name: "index"; type: "int" }
|
||||
}
|
||||
Signal {
|
||||
name: "nameChanged"
|
||||
lineNumber: 53
|
||||
Parameter { name: "name"; type: "QString" }
|
||||
}
|
||||
Signal {
|
||||
name: "extensionsChanged"
|
||||
lineNumber: 54
|
||||
Parameter { name: "extensions"; type: "QStringList" }
|
||||
}
|
||||
Signal {
|
||||
name: "globsChanged"
|
||||
lineNumber: 55
|
||||
Parameter { name: "globs"; type: "QStringList" }
|
||||
}
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickfolderdialog_p.h"
|
||||
lineNumber: 28
|
||||
name: "QQuickFolderDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickAbstractDialog"
|
||||
extension: "QFileDialogOptions"
|
||||
extensionIsNamespace: true
|
||||
exports: [
|
||||
"QtQuick.Dialogs/FolderDialog 6.3",
|
||||
"QtQuick.Dialogs/FolderDialog 6.10"
|
||||
]
|
||||
exportMetaObjectRevisions: [1539, 1546]
|
||||
Property {
|
||||
name: "currentFolder"
|
||||
type: "QUrl"
|
||||
read: "currentFolder"
|
||||
write: "setCurrentFolder"
|
||||
notify: "currentFolderChanged"
|
||||
index: 0
|
||||
lineNumber: 31
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "selectedFolder"
|
||||
type: "QUrl"
|
||||
read: "selectedFolder"
|
||||
write: "setSelectedFolder"
|
||||
notify: "selectedFolderChanged"
|
||||
index: 1
|
||||
lineNumber: 32
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "options"
|
||||
type: "QFileDialogOptions::FileDialogOptions"
|
||||
read: "options"
|
||||
write: "setOptions"
|
||||
reset: "resetOptions"
|
||||
notify: "optionsChanged"
|
||||
index: 2
|
||||
lineNumber: 33
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "acceptLabel"
|
||||
type: "QString"
|
||||
read: "acceptLabel"
|
||||
write: "setAcceptLabel"
|
||||
reset: "resetAcceptLabel"
|
||||
notify: "acceptLabelChanged"
|
||||
index: 3
|
||||
lineNumber: 34
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "rejectLabel"
|
||||
type: "QString"
|
||||
read: "rejectLabel"
|
||||
write: "setRejectLabel"
|
||||
reset: "resetRejectLabel"
|
||||
notify: "rejectLabelChanged"
|
||||
index: 4
|
||||
lineNumber: 35
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "currentFolderChanged"; lineNumber: 62 }
|
||||
Signal { name: "selectedFolderChanged"; lineNumber: 63 }
|
||||
Signal { name: "optionsChanged"; lineNumber: 64 }
|
||||
Signal { name: "acceptLabelChanged"; lineNumber: 65 }
|
||||
Signal { name: "rejectLabelChanged"; lineNumber: 66 }
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickfontdialog_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickFontDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickAbstractDialog"
|
||||
extension: "QFontDialogOptions"
|
||||
extensionIsNamespace: true
|
||||
exports: [
|
||||
"QtQuick.Dialogs/FontDialog 6.2",
|
||||
"QtQuick.Dialogs/FontDialog 6.10"
|
||||
]
|
||||
exportMetaObjectRevisions: [1538, 1546]
|
||||
Property {
|
||||
name: "selectedFont"
|
||||
type: "QFont"
|
||||
read: "selectedFont"
|
||||
write: "setSelectedFont"
|
||||
notify: "selectedFontChanged"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
}
|
||||
Property {
|
||||
name: "currentFont"
|
||||
type: "QFont"
|
||||
read: "currentFont"
|
||||
write: "setCurrentFont"
|
||||
notify: "currentFontChanged"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "options"
|
||||
type: "QFontDialogOptions::FontDialogOptions"
|
||||
read: "options"
|
||||
write: "setOptions"
|
||||
reset: "resetOptions"
|
||||
notify: "optionsChanged"
|
||||
index: 2
|
||||
lineNumber: 30
|
||||
}
|
||||
Signal { name: "selectedFontChanged"; lineNumber: 50 }
|
||||
Signal { name: "currentFontChanged"; lineNumber: 51 }
|
||||
Signal { name: "optionsChanged"; lineNumber: 52 }
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickmessagedialog_p.h"
|
||||
lineNumber: 23
|
||||
name: "QQuickMessageDialog"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickAbstractDialog"
|
||||
extension: "QPlatformDialogHelper"
|
||||
extensionIsNamespace: true
|
||||
exports: [
|
||||
"QtQuick.Dialogs/MessageDialog 6.3",
|
||||
"QtQuick.Dialogs/MessageDialog 6.10"
|
||||
]
|
||||
exportMetaObjectRevisions: [1539, 1546]
|
||||
Property {
|
||||
name: "text"
|
||||
type: "QString"
|
||||
read: "text"
|
||||
write: "setText"
|
||||
notify: "textChanged"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "informativeText"
|
||||
type: "QString"
|
||||
read: "informativeText"
|
||||
write: "setInformativeText"
|
||||
notify: "informativeTextChanged"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "detailedText"
|
||||
type: "QString"
|
||||
read: "detailedText"
|
||||
write: "setDetailedText"
|
||||
notify: "detailedTextChanged"
|
||||
index: 2
|
||||
lineNumber: 30
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "buttons"
|
||||
type: "QPlatformDialogHelper::StandardButtons"
|
||||
read: "buttons"
|
||||
write: "setButtons"
|
||||
notify: "buttonsChanged"
|
||||
index: 3
|
||||
lineNumber: 31
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "textChanged"; lineNumber: 52 }
|
||||
Signal { name: "informativeTextChanged"; lineNumber: 53 }
|
||||
Signal { name: "detailedTextChanged"; lineNumber: 54 }
|
||||
Signal { name: "buttonsChanged"; lineNumber: 55 }
|
||||
Signal {
|
||||
name: "buttonClicked"
|
||||
lineNumber: 57
|
||||
Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" }
|
||||
Parameter { name: "role"; type: "QPlatformDialogHelper::ButtonRole" }
|
||||
}
|
||||
Method {
|
||||
name: "handleClick"
|
||||
lineNumber: 61
|
||||
Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" }
|
||||
Parameter { name: "role"; type: "QPlatformDialogHelper::ButtonRole" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
module QtQuick.Dialogs
|
||||
linktarget Qt6::qtquickdialogsplugin
|
||||
optional plugin qtquickdialogsplugin
|
||||
classname QtQuickDialogsPlugin
|
||||
typeinfo plugins.qmltypes
|
||||
depends QtQuick auto
|
||||
depends QtQuick.Dialogs.quickimpl auto
|
||||
prefer :/qt-project.org/imports/QtQuick/Dialogs/
|
||||
depends QtQuick
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,262 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.Fusion.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
ColorDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: 12
|
||||
|
||||
isHsl: true
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
ColorDialogImpl.eyeDropperButton: eyeDropperButton
|
||||
ColorDialogImpl.buttonBox: buttonBox
|
||||
ColorDialogImpl.colorPicker: colorPicker
|
||||
ColorDialogImpl.colorInputs: inputs
|
||||
ColorDialogImpl.alphaSlider: alphaSlider
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
|
||||
Rectangle {
|
||||
z: -1
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: control.palette.shadow
|
||||
opacity: 0.2
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
|
||||
header: RowLayout {
|
||||
Label {
|
||||
objectName: "titleLabel"
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 6
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.preferredWidth: control.title.length > 0 ? implicitWidth : 0
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 15
|
||||
Layout.leftMargin: 12
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
Button {
|
||||
id: eyeDropperButton
|
||||
objectName: "eyeDropperButton"
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/eye-dropper.png"
|
||||
flat: true
|
||||
visible: false
|
||||
|
||||
Layout.preferredWidth: implicitHeight
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: 6
|
||||
|
||||
Accessible.name: qsTr("Eye dropper")
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 12
|
||||
SaturationLightnessPicker {
|
||||
id: colorPicker
|
||||
objectName: "colorPicker"
|
||||
color: control.color
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: hueSlider
|
||||
objectName: "hueSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.hue
|
||||
implicitHeight: 20
|
||||
onMoved: function() { control.hue = value; }
|
||||
handle: PickerHandle {
|
||||
x: hueSlider.leftPadding + (hueSlider.horizontal
|
||||
? hueSlider.visualPosition * (hueSlider.availableWidth - width)
|
||||
: (hueSlider.availableWidth - width) / 2)
|
||||
y: hueSlider.topPadding + (hueSlider.horizontal
|
||||
? (hueSlider.availableHeight - height) / 2
|
||||
: hueSlider.visualPosition * (hueSlider.availableHeight - height))
|
||||
picker: hueSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: hueSlider.handle.width / 2
|
||||
anchors.rightMargin: hueSlider.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: HueGradient {
|
||||
orientation: Gradient.Horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Hue")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: alphaSlider
|
||||
objectName: "alphaSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.alpha
|
||||
implicitHeight: 20
|
||||
handle: PickerHandle {
|
||||
x: alphaSlider.leftPadding + (alphaSlider.horizontal
|
||||
? alphaSlider.visualPosition * (alphaSlider.availableWidth - width)
|
||||
: (alphaSlider.availableWidth - width) / 2)
|
||||
y: alphaSlider.topPadding + (alphaSlider.horizontal
|
||||
? (alphaSlider.availableHeight - height) / 2
|
||||
: alphaSlider.visualPosition * (alphaSlider.availableHeight - height))
|
||||
picker: alphaSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: parent.handle.width / 2
|
||||
anchors.rightMargin: parent.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: alphaSliderGradient
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: alphaSliderGradient
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: Qt.rgba(control.color.r, control.color.g, control.color.b, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Alpha")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
ColorInputs {
|
||||
id: inputs
|
||||
color: control.color
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: qsTr("Color")
|
||||
|
||||
Layout.leftMargin: 12
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
implicitWidth: (parent.height - 24) * 2
|
||||
implicitHeight: implicitWidth / 2
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: control.color
|
||||
}
|
||||
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 6
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 0
|
||||
|
||||
Layout.rightMargin: 12
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.ColorInputsImpl {
|
||||
id: control
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
padding: 1
|
||||
mode: colorSystemComboBox.currentIndex
|
||||
|
||||
delegate: TextField {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
ComboBox {
|
||||
id: colorSystemComboBox
|
||||
objectName: "colorSystemComboBox"
|
||||
editable: false
|
||||
flat: true
|
||||
background.implicitWidth: 0
|
||||
currentIndex: DialogsQuickImpl.ColorInputsImpl.Hex
|
||||
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
|
||||
model: [qsTr("Hex"), qsTr("RGB"), qsTr("HSV"), qsTr("HSL")]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.Fusion.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FileDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: 12
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Dialog {
|
||||
id: overwriteConfirmationDialog
|
||||
objectName: "confirmationDialog"
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
dim: true
|
||||
modal: true
|
||||
title: qsTr("Overwrite file?")
|
||||
width: contentItem.implicitWidth + leftPadding + rightPadding
|
||||
|
||||
contentItem: Label {
|
||||
text: qsTr("“%1” already exists.\nDo you want to replace it?").arg(control.fileName)
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
alignment: Qt.AlignHCenter
|
||||
standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Fusion.darkShade
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
We use attached properties because we want to handle logic in C++, and:
|
||||
- We can't assume the footer only contains a DialogButtonBox (which would allow us
|
||||
to connect up to it in QQuickFileDialogImpl); it also needs to hold a ComboBox
|
||||
and therefore the root footer item will be e.g. a layout item instead.
|
||||
- We don't want to create our own "FileDialogButtonBox" (in order to be able to handle the logic
|
||||
in C++) because we'd need to copy (and hence duplicate code in) DialogButtonBox.qml.
|
||||
*/
|
||||
FileDialogImpl.buttonBox: buttonBox
|
||||
FileDialogImpl.nameFiltersComboBox: nameFiltersComboBox
|
||||
FileDialogImpl.fileDialogListView: fileDialogListView
|
||||
FileDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
FileDialogImpl.fileNameLabel: fileNameLabel
|
||||
FileDialogImpl.fileNameTextField: fileNameTextField
|
||||
FileDialogImpl.overwriteConfirmationDialog: overwriteConfirmationDialog
|
||||
FileDialogImpl.sideBar: sideBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
|
||||
Rectangle {
|
||||
z: -1
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: control.palette.shadow
|
||||
opacity: 0.2
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
objectName: "dialogTitleBarLabel"
|
||||
text: control.title
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 6
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.topMargin: control.title.length > 0 ? 0 : 12
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent === Overlay.overlay ? 0 : 12
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.maximumWidth: parent.width - 24
|
||||
|
||||
KeyNavigation.tab: fileDialogListView
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: SplitView {
|
||||
id: contentLayout
|
||||
|
||||
contentHeight: sideBar.implicitHeight
|
||||
DialogsImpl.SideBar {
|
||||
id: sideBar
|
||||
dialog: control
|
||||
SplitView.minimumWidth: 50
|
||||
SplitView.maximumWidth: contentLayout.width / 2
|
||||
}
|
||||
|
||||
Frame {
|
||||
padding: 0
|
||||
verticalPadding: 1
|
||||
SplitView.fillWidth: true
|
||||
|
||||
ListView {
|
||||
id: fileDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
focus: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
nameFilters: control.selectedNameFilter.globs
|
||||
showDirsFirst: PlatformTheme.themeHint(PlatformTheme.ShowDirectoriesFirst)
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FileDialogDelegate {
|
||||
objectName: "fileDialogDelegate" + index
|
||||
x: 1
|
||||
width: ListView.view.width - 2
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
fileDetailRowWidth: nameFiltersComboBox.width
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: fileNameTextField.visible ? fileNameTextField : nameFiltersComboBox
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.base
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: GridLayout {
|
||||
columnSpacing: 12
|
||||
columns: 3
|
||||
|
||||
Label {
|
||||
id: fileNameLabel
|
||||
text: qsTr("File name")
|
||||
Layout.leftMargin: 12
|
||||
visible: false
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: fileNameTextField
|
||||
objectName: "fileNameTextField"
|
||||
visible: false
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Filter")
|
||||
Layout.column: 0
|
||||
Layout.row: 1
|
||||
Layout.leftMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
|
||||
|
||||
ComboBox {
|
||||
// OK to use IDs here, since users shouldn't be overriding this stuff.
|
||||
id: nameFiltersComboBox
|
||||
model: control.nameFilters
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 6
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 0
|
||||
background: null
|
||||
|
||||
// TODO: make the orientation vertical
|
||||
Layout.row: 1
|
||||
Layout.column: 2
|
||||
Layout.columnSpan: 1
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
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/"
|
||||
+ (fileIsDir ? "folder" : "file") + "-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 double fileSize
|
||||
required property date fileModified
|
||||
required property bool fileIsDir
|
||||
|
||||
required property int fileDetailRowWidth
|
||||
|
||||
Accessible.name: fileName
|
||||
|
||||
contentItem: DialogsQuickImpl.FileDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.highlighted ? Fusion.highlightedText(control.palette) : control.palette.text
|
||||
fileDetailRowWidth: control.fileDetailRowWidth
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.FolderBreadcrumbBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + (upButton ? upButton.implicitWidth + upButtonSpacing : 0)
|
||||
+ leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
upButtonSpacing: 6
|
||||
|
||||
contentItem: ListView {
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
orientation: ListView.Horizontal
|
||||
snapMode: ListView.SnapToItem
|
||||
highlightMoveDuration: 0
|
||||
interactive: false
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: control.palette.light
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
z: -1
|
||||
}
|
||||
}
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
text: folderName
|
||||
flat: true
|
||||
|
||||
// The default of 100 is a bit too wide for short directory names.
|
||||
Binding {
|
||||
target: buttonDelegateRoot.background
|
||||
property: "implicitWidth"
|
||||
value: 24
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
}
|
||||
separatorDelegate: IconImage {
|
||||
id: iconImage
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/crumb-separator-icon-round.png"
|
||||
sourceSize: Qt.size(8, 8)
|
||||
width: 8 + 6
|
||||
height: control.contentItem.height
|
||||
color: control.palette.dark
|
||||
y: (control.height - height) / 2
|
||||
}
|
||||
upButton: Button {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/up-icon-round.png"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
width: height
|
||||
height: Math.max(implicitHeight, control.contentItem.height)
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.name: qsTr("Up")
|
||||
}
|
||||
textField: TextField {
|
||||
text: (control.dialog as DialogsQuickImpl.FileDialogImpl)?.selectedFile
|
||||
?? (control.dialog as DialogsQuickImpl.FolderDialogImpl).currentFolder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.Fusion.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FolderDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: 12
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
FolderDialogImpl.folderDialogListView: folderDialogListView
|
||||
FolderDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
|
||||
Rectangle {
|
||||
z: -1
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: control.palette.shadow
|
||||
opacity: 0.2
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
objectName: "dialogTitleBarLabel"
|
||||
text: control.title
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 6
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.topMargin: control.title.length > 0 ? 0 : 12
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent === Overlay.overlay ? 0 : 12
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.maximumWidth: parent.width - 24
|
||||
|
||||
KeyNavigation.tab: folderDialogListView
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Frame {
|
||||
padding: 0
|
||||
verticalPadding: 1
|
||||
|
||||
ListView {
|
||||
id: folderDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
focus: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
showFiles: false
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FolderDialogDelegate {
|
||||
objectName: "folderDialogDelegate" + index
|
||||
x: 1
|
||||
width: ListView.view.width - 2
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: control.footer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 6
|
||||
leftPadding: 0
|
||||
rightPadding: 12
|
||||
topPadding: 0
|
||||
bottomPadding: 12
|
||||
background: null
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
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: DialogsQuickImpl.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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.Fusion.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
FontDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(control.implicitBackgroundWidth + control.leftInset + control.rightInset,
|
||||
control.implicitContentWidth + control.leftPadding + control.rightPadding,
|
||||
control.implicitHeaderWidth,
|
||||
control.implicitFooterWidth)
|
||||
implicitHeight: Math.max(control.implicitBackgroundHeight + control.topInset + control.bottomInset,
|
||||
control.implicitContentHeight + control.topPadding + control.bottomPadding
|
||||
+ (control.implicitHeaderHeight > 0 ? control.implicitHeaderHeight + control.spacing : 0)
|
||||
+ (control.implicitFooterHeight > 0 ? control.implicitFooterHeight + control.spacing : 0))
|
||||
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
FontDialogImpl.buttonBox: buttonBox
|
||||
FontDialogImpl.familyListView: content.familyListView
|
||||
FontDialogImpl.styleListView: content.styleListView
|
||||
FontDialogImpl.sizeListView: content.sizeListView
|
||||
FontDialogImpl.sampleEdit: content.sampleEdit
|
||||
FontDialogImpl.writingSystemComboBox: writingSystemComboBox
|
||||
FontDialogImpl.underlineCheckBox: content.underline
|
||||
FontDialogImpl.strikeoutCheckBox: content.strikeout
|
||||
FontDialogImpl.familyEdit: content.familyEdit
|
||||
FontDialogImpl.styleEdit: content.styleEdit
|
||||
FontDialogImpl.sizeEdit: content.sizeEdit
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
|
||||
Rectangle {
|
||||
z: -1
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: control.palette.shadow
|
||||
opacity: 0.2
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: content.parent?.parent === Overlay.overlay
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 6
|
||||
}
|
||||
|
||||
contentItem: FontDialogContent {
|
||||
id: content
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: qsTr("Writing System")
|
||||
|
||||
Layout.leftMargin: 12
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
ComboBox{
|
||||
id: writingSystemComboBox
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 6
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 0
|
||||
background: null
|
||||
|
||||
Layout.rightMargin: 12
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 6
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
MessageDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(control.implicitBackgroundWidth + control.leftInset + control.rightInset,
|
||||
control.implicitHeaderWidth,
|
||||
rowLayout.implicitWidth)
|
||||
implicitHeight: Math.max(control.implicitBackgroundHeight + control.topInset + control.bottomInset,
|
||||
control.implicitContentHeight + control.topPadding + control.bottomPadding
|
||||
+ (control.implicitHeaderHeight > 0 ? control.implicitHeaderHeight + control.spacing : 0)
|
||||
+ (control.implicitFooterHeight > 0 ? control.implicitFooterHeight + control.spacing : 0))
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: 12
|
||||
|
||||
MessageDialogImpl.buttonBox: buttonBox
|
||||
MessageDialogImpl.detailedTextButton: detailedTextButton
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 320
|
||||
implicitHeight: 120
|
||||
color: control.palette.window
|
||||
border.color: control.palette.mid
|
||||
radius: 2
|
||||
|
||||
Rectangle {
|
||||
z: -1
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: control.palette.shadow
|
||||
opacity: 0.2
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: parent?.parent === Overlay.overlay
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 6
|
||||
}
|
||||
|
||||
contentItem: Column {
|
||||
padding: 6
|
||||
spacing: 24
|
||||
|
||||
Label {
|
||||
id: textLabel
|
||||
objectName: "textLabel"
|
||||
text: control.text
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
|
||||
Label {
|
||||
id: informativeTextLabel
|
||||
objectName: "informativeTextLabel"
|
||||
text: control.informativeText
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
id: columnLayout
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
Button {
|
||||
id: detailedTextButton
|
||||
objectName: "detailedTextButton"
|
||||
text: control.showDetailedText ? qsTr("Hide Details...") : qsTr("Show Details...")
|
||||
|
||||
Layout.leftMargin: 12
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
objectName: "buttonBox"
|
||||
spacing: 6
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 12
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: detailedTextButton.visible ? 6 : 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: detailedTextArea
|
||||
objectName: "detailedText"
|
||||
text: control.detailedText
|
||||
visible: control.showDetailedText
|
||||
wrapMode: TextEdit.WordWrap
|
||||
readOnly: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: detailedTextArea.palette.base
|
||||
radius: 3
|
||||
border.color: detailedTextArea.activeFocus ? Fusion.highlightedOutline(detailedTextArea.palette) : Fusion.outline(detailedTextArea.palette)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Fusion.topShadow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.SideBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentWidth: (contentItem as ListView)?.contentWidth
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
x: 1
|
||||
y: 1
|
||||
width: parent.width - 2
|
||||
height: parent.height - 2
|
||||
radius: 2
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: listView
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: control.palette.light
|
||||
border.color: control.palette.mid
|
||||
z: -1
|
||||
}
|
||||
}
|
||||
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
flat: true
|
||||
highlighted: control.currentIndex === index
|
||||
width: listView.width
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: buttonDelegateRoot.icon
|
||||
text: buttonDelegateRoot.folderName
|
||||
font: buttonDelegateRoot.font
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
|
||||
Accessible.name: folderName
|
||||
}
|
||||
|
||||
separatorDelegate: Item {
|
||||
implicitWidth: control.width
|
||||
implicitHeight: 9
|
||||
Rectangle {
|
||||
id: separatorDelegate
|
||||
color: Qt.lighter(Fusion.darkShade, 1.06)
|
||||
anchors.centerIn: parent
|
||||
radius: 1
|
||||
height: 1
|
||||
width: parent.width - 10
|
||||
}
|
||||
}
|
||||
|
||||
addFavoriteDelegate: Button {
|
||||
id: addFavoriteDelegateRoot
|
||||
text: qsTr("Add Favorite")
|
||||
flat: true
|
||||
width: control.width
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: addFavoriteDelegateRoot.icon
|
||||
text: addFavoriteDelegateRoot.labelText
|
||||
font: addFavoriteDelegateRoot.font
|
||||
opacity: addFavoriteDelegateRoot.dragHovering ? 0.2 : 1.0
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property string labelText
|
||||
required property bool dragHovering
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
ColorDialogImpl {
|
||||
id: control
|
||||
|
||||
// Can't set implicitWidth of the NinePatchImage background, so we do it here.
|
||||
implicitWidth: Math.max(200,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(600,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
isHsl: true
|
||||
|
||||
ColorDialogImpl.eyeDropperButton: eyeDropperButton
|
||||
ColorDialogImpl.buttonBox: buttonBox
|
||||
ColorDialogImpl.colorPicker: colorPicker
|
||||
ColorDialogImpl.alphaSlider: alphaSlider
|
||||
ColorDialogImpl.colorInputs: inputs
|
||||
|
||||
background: NinePatchImage {
|
||||
source: Imagine.url + "dialog-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
header: RowLayout {
|
||||
Label {
|
||||
objectName: "titleLabel"
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
leftPadding: 16
|
||||
rightPadding: 16
|
||||
topPadding: 16
|
||||
bottomPadding: 16
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.preferredWidth: control.title.length > 0 ? implicitWidth : 0
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 15
|
||||
}
|
||||
|
||||
Button {
|
||||
id: eyeDropperButton
|
||||
objectName: "eyeDropperButton"
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/eye-dropper.png"
|
||||
flat: true
|
||||
topPadding: 16
|
||||
bottomPadding: 16
|
||||
visible: false
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: 16
|
||||
|
||||
Accessible.name: qsTr("Eye dropper")
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
SaturationLightnessPicker {
|
||||
id: colorPicker
|
||||
objectName: "colorPicker"
|
||||
color: control.color
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: hueSlider
|
||||
objectName: "hueSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.hue
|
||||
onMoved: function() { control.hue = value; }
|
||||
|
||||
Accessible.name: qsTr("Hue")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
handle: PickerHandle {
|
||||
x: hueSlider.leftPadding + (hueSlider.horizontal
|
||||
? hueSlider.visualPosition * (hueSlider.availableWidth - width)
|
||||
: (hueSlider.availableWidth - width) / 2)
|
||||
y: hueSlider.topPadding + (hueSlider.horizontal
|
||||
? (hueSlider.availableHeight - height) / 2
|
||||
: hueSlider.visualPosition * (hueSlider.availableHeight - height))
|
||||
picker: hueSlider
|
||||
}
|
||||
|
||||
implicitHeight: 20
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: hueSlider.handle.width / 2
|
||||
anchors.rightMargin: hueSlider.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: HueGradient {
|
||||
orientation: Gradient.Horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: alphaSlider
|
||||
objectName: "alphaSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.alpha
|
||||
implicitHeight: 20
|
||||
handle: PickerHandle {
|
||||
x: alphaSlider.leftPadding + (alphaSlider.horizontal
|
||||
? alphaSlider.visualPosition * (alphaSlider.availableWidth - width)
|
||||
: (alphaSlider.availableWidth - width) / 2)
|
||||
y: alphaSlider.topPadding + (alphaSlider.horizontal
|
||||
? (alphaSlider.availableHeight - height) / 2
|
||||
: alphaSlider.visualPosition * (alphaSlider.availableHeight - height))
|
||||
picker: alphaSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: parent.handle.width / 2
|
||||
anchors.rightMargin: parent.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: alphaSliderGradient
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: alphaSliderGradient
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: Qt.rgba(control.color.r,
|
||||
control.color.g,
|
||||
control.color.b,
|
||||
1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Alpha")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
}
|
||||
|
||||
ColorInputs {
|
||||
id: inputs
|
||||
color: control.color
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Color")
|
||||
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: control.color
|
||||
}
|
||||
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
|
||||
Item {
|
||||
// empty filler
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
|
||||
Layout.bottomMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
T.Overlay.modal: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": true}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modeless: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": false}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.ColorInputsImpl {
|
||||
id: control
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
padding: 1
|
||||
mode: colorSystemComboBox.currentIndex
|
||||
|
||||
delegate: TextField {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
ComboBox {
|
||||
id: colorSystemComboBox
|
||||
objectName: "colorSystemComboBox"
|
||||
editable: false
|
||||
flat: true
|
||||
background.implicitWidth: 0
|
||||
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
|
||||
implicitWidth: implicitContentWidth + leftPadding + rightPadding // Workaround QTBUG-106098
|
||||
currentIndex: DialogsQuickImpl.ColorInputsImpl.Hex
|
||||
model: [qsTr("Hex"), qsTr("RGB"), qsTr("HSV"), qsTr("HSL")]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FileDialogImpl {
|
||||
id: control
|
||||
|
||||
// Can't set implicitWidth of the NinePatchImage background, so we do it here.
|
||||
implicitWidth: Math.max(600,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(400,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Dialog {
|
||||
id: overwriteConfirmationDialog
|
||||
objectName: "confirmationDialog"
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
dim: true
|
||||
modal: true
|
||||
spacing: 12
|
||||
title: qsTr("Overwrite file?")
|
||||
width: control.width - control.leftPadding - control.rightPadding
|
||||
|
||||
contentItem: Label {
|
||||
text: qsTr("“%1” already exists.\nDo you want to replace it?").arg(control.fileName)
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
|
||||
}
|
||||
}
|
||||
|
||||
FileDialogImpl.buttonBox: buttonBox
|
||||
FileDialogImpl.nameFiltersComboBox: nameFiltersComboBox
|
||||
FileDialogImpl.fileDialogListView: fileDialogListView
|
||||
FileDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
FileDialogImpl.fileNameLabel: fileNameLabel
|
||||
FileDialogImpl.fileNameTextField: fileNameTextField
|
||||
FileDialogImpl.overwriteConfirmationDialog: overwriteConfirmationDialog
|
||||
FileDialogImpl.sideBar: sideBar
|
||||
|
||||
background: NinePatchImage {
|
||||
source: Imagine.url + "dialog-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.topMargin: 12
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
|
||||
background: NinePatchImage {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
source: Imagine.url + "dialog-title"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent !== Overlay.overlay ? 12 : 6
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 28
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: SplitView {
|
||||
id: contentLayout
|
||||
|
||||
contentHeight: sideBar.implicitHeight
|
||||
DialogsImpl.SideBar {
|
||||
id: sideBar
|
||||
dialog: control
|
||||
SplitView.minimumWidth: 50
|
||||
SplitView.maximumWidth: contentLayout.width / 2
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: fileDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
SplitView.fillWidth: true
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
nameFilters: control.selectedNameFilter.globs
|
||||
showDirsFirst: PlatformTheme.themeHint(PlatformTheme.ShowDirectoriesFirst)
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FileDialogDelegate {
|
||||
objectName: "fileDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
fileDetailRowWidth: nameFiltersComboBox.width
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: fileNameTextField.visible ? fileNameTextField : nameFiltersComboBox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: GridLayout {
|
||||
columnSpacing: 20
|
||||
columns: 3
|
||||
|
||||
Label {
|
||||
id: fileNameLabel
|
||||
text: qsTr("File name")
|
||||
visible: false
|
||||
|
||||
Layout.leftMargin: 16
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: fileNameTextField
|
||||
objectName: "fileNameTextField"
|
||||
visible: false
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Filter")
|
||||
|
||||
Layout.column: 0
|
||||
Layout.row: 1
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: nameFiltersComboBox
|
||||
model: control.nameFilters
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 2
|
||||
Layout.columnSpan: 1
|
||||
Layout.bottomMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": true}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modeless: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": false}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Controls.impl as ControlsImpl
|
||||
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)
|
||||
|
||||
spacing: 12
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
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/"
|
||||
+ (fileIsDir ? "folder" : "file") + "-icon-round.png"
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property double fileSize
|
||||
required property date fileModified
|
||||
required property bool fileIsDir
|
||||
|
||||
required property int fileDetailRowWidth
|
||||
|
||||
Accessible.name: fileName
|
||||
|
||||
contentItem: DialogsQuickImpl.FileDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.icon.color
|
||||
fileDetailRowWidth: control.fileDetailRowWidth
|
||||
}
|
||||
|
||||
background: NinePatchImage {
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/imagine/filedialogdelegate-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{ "disabled": !control.enabled },
|
||||
{ "pressed": control.down },
|
||||
{ "focused": control.visualFocus },
|
||||
{ "highlighted": control.highlighted },
|
||||
{ "mirrored": control.mirrored },
|
||||
{ "hovered": control.enabled && control.hovered }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.FolderBreadcrumbBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + (upButton ? upButton.implicitWidth + upButtonSpacing : 0)
|
||||
+ leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
upButtonSpacing: 20
|
||||
padding: 1
|
||||
|
||||
background: Rectangle {}
|
||||
contentItem: ListView {
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
orientation: ListView.Horizontal
|
||||
snapMode: ListView.SnapToItem
|
||||
highlightMoveDuration: 0
|
||||
interactive: false
|
||||
clip: true
|
||||
}
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
text: folderName
|
||||
flat: true
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
}
|
||||
separatorDelegate: IconImage {
|
||||
id: iconImage
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/crumb-separator-icon-round.png"
|
||||
sourceSize: Qt.size(8, 8)
|
||||
width: 8
|
||||
height: control.contentItem.height
|
||||
y: (control.height - height) / 2
|
||||
}
|
||||
upButton: ToolButton {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/up-icon-thick-square.png"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.name: qsTr("Up")
|
||||
}
|
||||
textField: TextField {
|
||||
text: (control.dialog as DialogsQuickImpl.FileDialogImpl)?.selectedFile
|
||||
?? (control.dialog as DialogsQuickImpl.FolderDialogImpl).currentFolder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FolderDialogImpl {
|
||||
id: control
|
||||
|
||||
// Can't set implicitWidth of the NinePatchImage background, so we do it here.
|
||||
implicitWidth: Math.max(600,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(400,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
FolderDialogImpl.folderDialogListView: folderDialogListView
|
||||
FolderDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
|
||||
background: NinePatchImage {
|
||||
source: Imagine.url + "dialog-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.topMargin: 12
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
|
||||
background: NinePatchImage {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
source: Imagine.url + "dialog-title"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent === Overlay.overlay ? 12 : 0
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 28
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: folderDialogListView
|
||||
objectName: "folderDialogListView"
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
showFiles: false
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FolderDialogDelegate {
|
||||
objectName: "folderDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
leftPadding: 16
|
||||
rightPadding: 16
|
||||
bottomPadding: 16
|
||||
}
|
||||
|
||||
T.Overlay.modal: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": true}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modeless: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": false}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Controls.impl as ControlsImpl
|
||||
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)
|
||||
|
||||
spacing: 12
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
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"
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property date fileModified
|
||||
|
||||
contentItem: DialogsQuickImpl.FolderDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: Qt.lighter(control.icon.color)
|
||||
}
|
||||
|
||||
background: NinePatchImage {
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/imagine/filedialogdelegate-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{ "disabled": !control.enabled },
|
||||
{ "pressed": control.down },
|
||||
{ "focused": control.visualFocus },
|
||||
{ "highlighted": control.highlighted },
|
||||
{ "mirrored": control.mirrored },
|
||||
{ "hovered": control.enabled && control.hovered }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
FontDialogImpl {
|
||||
id: control
|
||||
|
||||
// Can't set implicitWidth of the NinePatchImage background, so we do it here.
|
||||
implicitWidth: Math.max(600,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(400,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
FontDialogImpl.buttonBox: buttonBox
|
||||
FontDialogImpl.familyListView: content.familyListView
|
||||
FontDialogImpl.styleListView: content.styleListView
|
||||
FontDialogImpl.sizeListView: content.sizeListView
|
||||
FontDialogImpl.sampleEdit: content.sampleEdit
|
||||
FontDialogImpl.writingSystemComboBox: writingSystemComboBox
|
||||
FontDialogImpl.underlineCheckBox: content.underline
|
||||
FontDialogImpl.strikeoutCheckBox: content.strikeout
|
||||
FontDialogImpl.familyEdit: content.familyEdit
|
||||
FontDialogImpl.styleEdit: content.styleEdit
|
||||
FontDialogImpl.sizeEdit: content.sizeEdit
|
||||
|
||||
background: NinePatchImage {
|
||||
source: Imagine.url + "dialog-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": true}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modeless: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": false}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
|
||||
leftPadding: 16
|
||||
rightPadding: 16
|
||||
topPadding: 12
|
||||
visible: content.parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
|
||||
background: NinePatchImage {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
source: Imagine.url + "dialog-title"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: FontDialogContent {
|
||||
id: content
|
||||
rowSpacing: 16
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Writing System")
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
ComboBox{
|
||||
id: writingSystemComboBox
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.Imagine.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
MessageDialogImpl {
|
||||
id: control
|
||||
|
||||
// Can't set implicitWidth of the NinePatchImage background, so we do it here.
|
||||
implicitWidth: Math.max(320,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitHeaderWidth,
|
||||
rowLayout.implicitWidth)
|
||||
implicitHeight: Math.max(160,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
topPadding: background ? background.topPadding : 0
|
||||
leftPadding: background ? background.leftPadding : 0
|
||||
rightPadding: background ? background.rightPadding : 0
|
||||
bottomPadding: background ? background.bottomPadding : 0
|
||||
|
||||
topInset: background ? -background.topInset || 0 : 0
|
||||
leftInset: background ? -background.leftInset || 0 : 0
|
||||
rightInset: background ? -background.rightInset || 0 : 0
|
||||
bottomInset: background ? -background.bottomInset || 0 : 0
|
||||
|
||||
MessageDialogImpl.buttonBox: buttonBox
|
||||
MessageDialogImpl.detailedTextButton: detailedTextButton
|
||||
|
||||
background: NinePatchImage {
|
||||
source: Imagine.url + "dialog-background"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
|
||||
leftPadding: 16
|
||||
rightPadding: 16
|
||||
topPadding: 12
|
||||
visible: parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
|
||||
background: NinePatchImage {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
source: Imagine.url + "dialog-title"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": control.modal},
|
||||
{"dim": control.dim}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Column {
|
||||
padding: 8
|
||||
spacing: 16
|
||||
|
||||
Label {
|
||||
id: textLabel
|
||||
objectName: "textLabel"
|
||||
text: control.text
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
Label {
|
||||
id: informativeTextLabel
|
||||
objectName: "informativeTextLabel"
|
||||
text: control.informativeText
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
id: columnLayout
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 12
|
||||
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
|
||||
Button {
|
||||
id: detailedTextButton
|
||||
objectName: "detailedTextButton"
|
||||
text: control.showDetailedText ? qsTr("Hide Details...") : qsTr("Show Details...")
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
objectName: "buttonBox"
|
||||
spacing: 12
|
||||
padding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: detailedTextArea
|
||||
objectName: "detailedText"
|
||||
text: control.detailedText
|
||||
visible: control.showDetailedText
|
||||
wrapMode: TextEdit.WordWrap
|
||||
readOnly: true
|
||||
|
||||
padding: 12
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(1,1,1,1)
|
||||
radius: 3
|
||||
border.color: Qt.darker(control.palette.light)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": true}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modeless: NinePatchImage {
|
||||
source: Imagine.url + "dialog-overlay"
|
||||
NinePatchImageSelector on source {
|
||||
states: [
|
||||
{"modal": false}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Imagine
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.SideBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
background: Rectangle {}
|
||||
contentItem: ListView {
|
||||
id: listView
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
clip: true
|
||||
}
|
||||
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
flat: true
|
||||
highlighted: control.currentIndex === index
|
||||
width: listView.width
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: buttonDelegateRoot.icon
|
||||
text: buttonDelegateRoot.folderName
|
||||
font: buttonDelegateRoot.font
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
|
||||
Accessible.name: folderName
|
||||
}
|
||||
|
||||
separatorDelegate: Item {
|
||||
implicitWidth: control.width
|
||||
implicitHeight: 9
|
||||
Rectangle {
|
||||
id: separatorDelegate
|
||||
color: Qt.lighter(Imagine.darkShade, 1.06)
|
||||
anchors.centerIn: parent
|
||||
radius: 1
|
||||
height: 1
|
||||
width: parent.width - 10
|
||||
}
|
||||
}
|
||||
|
||||
addFavoriteDelegate: Button {
|
||||
id: addFavoriteDelegateRoot
|
||||
text: qsTr("Add Favorite")
|
||||
flat: true
|
||||
width: control.width
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: addFavoriteDelegateRoot.icon
|
||||
text: addFavoriteDelegateRoot.labelText
|
||||
font: addFavoriteDelegateRoot.font
|
||||
opacity: addFavoriteDelegateRoot.dragHovering ? 0.2 : 1.0
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property string labelText
|
||||
required property bool dragHovering
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
ColorDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
isHsl: true
|
||||
|
||||
ColorDialogImpl.eyeDropperButton: eyeDropperButton
|
||||
ColorDialogImpl.buttonBox: buttonBox
|
||||
ColorDialogImpl.colorPicker: colorPicker
|
||||
ColorDialogImpl.alphaSlider: alphaSlider
|
||||
ColorDialogImpl.colorInputs: inputs
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 560
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
header: RowLayout {
|
||||
Label {
|
||||
objectName: "titleLabel"
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 24
|
||||
bottomPadding: 24
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.preferredWidth: control.title.length > 0 ? implicitWidth : 0
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 15
|
||||
}
|
||||
|
||||
Button {
|
||||
id: eyeDropperButton
|
||||
objectName: "eyeDropperButton"
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/eye-dropper.png"
|
||||
flat: true
|
||||
topPadding: 24
|
||||
bottomPadding: 24
|
||||
visible: false
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: 24
|
||||
|
||||
Accessible.name: qsTr("Eye dropper")
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 12
|
||||
SaturationLightnessPicker {
|
||||
id: colorPicker
|
||||
objectName: "colorPicker"
|
||||
color: control.color
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: hueSlider
|
||||
objectName: "hueSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.hue
|
||||
implicitHeight: 20
|
||||
onMoved: function() { control.hue = value; }
|
||||
handle: PickerHandle {
|
||||
x: hueSlider.leftPadding + (hueSlider.horizontal
|
||||
? hueSlider.visualPosition * (hueSlider.availableWidth - width)
|
||||
: (hueSlider.availableWidth - width) / 2)
|
||||
y: hueSlider.topPadding + (hueSlider.horizontal
|
||||
? (hueSlider.availableHeight - height) / 2
|
||||
: hueSlider.visualPosition * (hueSlider.availableHeight - height))
|
||||
picker: hueSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: hueSlider.handle.width / 2
|
||||
anchors.rightMargin: hueSlider.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: HueGradient {
|
||||
orientation: Gradient.Horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Hue")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: alphaSlider
|
||||
objectName: "alphaSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.alpha
|
||||
implicitHeight: 20
|
||||
handle: PickerHandle {
|
||||
x: alphaSlider.leftPadding + (alphaSlider.horizontal
|
||||
? alphaSlider.visualPosition * (alphaSlider.availableWidth - width)
|
||||
: (alphaSlider.availableWidth - width) / 2)
|
||||
y: alphaSlider.topPadding + (alphaSlider.horizontal
|
||||
? (alphaSlider.availableHeight - height) / 2
|
||||
: alphaSlider.visualPosition * (alphaSlider.availableHeight - height))
|
||||
picker: alphaSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: parent.handle.width / 2
|
||||
anchors.rightMargin: parent.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: alphaSliderGradient
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: alphaSliderGradient
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: Qt.rgba(control.color.r,
|
||||
control.color.g,
|
||||
control.color.b,
|
||||
1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Alpha")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
ColorInputs {
|
||||
id: inputs
|
||||
color: control.color
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Color")
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: control.color
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
|
||||
Layout.rightMargin: 20
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2023 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.ColorInputsImpl {
|
||||
id: control
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
padding: 1
|
||||
mode: colorSystemComboBox.currentIndex
|
||||
|
||||
delegate: TextField {
|
||||
Layout.fillWidth: true
|
||||
Material.containerStyle: Material.Filled
|
||||
leftPadding: control.showAlpha && control.mode !== ColorInputs.Hex ? 1 : Material.textFieldHorizontalPadding / 2
|
||||
rightPadding: control.showAlpha && control.mode !== ColorInputs.Hex ? 1 : Material.textFieldHorizontalPadding / 2
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
ComboBox {
|
||||
id: colorSystemComboBox
|
||||
objectName: "colorSystemComboBox"
|
||||
editable: false
|
||||
flat: true
|
||||
background.implicitWidth: 0
|
||||
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
|
||||
currentIndex: DialogsQuickImpl.ColorInputsImpl.Hex
|
||||
model: [qsTr("Hex"), qsTr("RGB"), qsTr("HSV"), qsTr("HSL")]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FileDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
Dialog {
|
||||
id: overwriteConfirmationDialog
|
||||
objectName: "confirmationDialog"
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
dim: true
|
||||
modal: true
|
||||
title: qsTr("Overwrite file?")
|
||||
clip: true
|
||||
width: contentItem.implicitWidth + leftPadding + rightPadding
|
||||
|
||||
contentItem: Label {
|
||||
text: qsTr("“%1” already exists.\nDo you want to replace it?").arg(control.fileName)
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
alignment: Qt.AlignHCenter
|
||||
standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
|
||||
}
|
||||
}
|
||||
|
||||
FileDialogImpl.buttonBox: buttonBox
|
||||
FileDialogImpl.nameFiltersComboBox: nameFiltersComboBox
|
||||
FileDialogImpl.fileDialogListView: fileDialogListView
|
||||
FileDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
FileDialogImpl.fileNameLabel: fileNameLabel
|
||||
FileDialogImpl.fileNameTextField: fileNameTextField
|
||||
FileDialogImpl.overwriteConfirmationDialog: overwriteConfirmationDialog
|
||||
FileDialogImpl.sideBar: sideBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
visible: parent.parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.topMargin: 24
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent !== Overlay.overlay ? 12 : 0
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 48
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: SplitView {
|
||||
id: contentLayout
|
||||
|
||||
contentHeight: sideBar.implicitHeight
|
||||
DialogsImpl.SideBar {
|
||||
id: sideBar
|
||||
dialog: control
|
||||
SplitView.minimumWidth: 50
|
||||
SplitView.maximumWidth: contentLayout.width / 2
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: fileDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
SplitView.fillWidth: true
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
nameFilters: control.selectedNameFilter.globs
|
||||
showDirsFirst: PlatformTheme.themeHint(PlatformTheme.ShowDirectoriesFirst)
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FileDialogDelegate {
|
||||
objectName: "fileDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
fileDetailRowWidth: nameFiltersComboBox.width
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: fileNameTextField.visible ? fileNameTextField : nameFiltersComboBox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: GridLayout {
|
||||
columnSpacing: 20
|
||||
columns: 3
|
||||
|
||||
Label {
|
||||
id: fileNameLabel
|
||||
text: qsTr("File name")
|
||||
visible: false
|
||||
|
||||
Layout.topMargin: 12
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: fileNameTextField
|
||||
objectName: "fileNameTextField"
|
||||
visible: false
|
||||
|
||||
Layout.topMargin: 12
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Filter")
|
||||
|
||||
Layout.row: 1
|
||||
Layout.topMargin: fileNameTextField.visible ? 0 : 12
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: nameFiltersComboBox
|
||||
model: control.nameFilters
|
||||
flat: true
|
||||
|
||||
verticalPadding: 0
|
||||
topInset: 0
|
||||
bottomInset: 0
|
||||
Layout.topMargin: fileNameTextField.visible ? 0 : 12
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
padding: 0
|
||||
topInset: 0
|
||||
bottomInset: 0
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 2
|
||||
Layout.topMargin: fileNameTextField.visible ? 0 : 12
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.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: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/"
|
||||
+ (fileIsDir ? "folder" : "file") + "-icon-square.png"
|
||||
|
||||
file: fileUrl
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property double fileSize
|
||||
required property date fileModified
|
||||
required property bool fileIsDir
|
||||
|
||||
required property int fileDetailRowWidth
|
||||
|
||||
Accessible.name: fileName
|
||||
|
||||
contentItem: DialogsQuickImpl.FileDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.Material.hintTextColor
|
||||
fileDetailRowWidth: control.fileDetailRowWidth
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? Color.transparent(control.Material.accentColor, 0.08) : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.highlighted ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.FolderBreadcrumbBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + (upButton ? upButton.implicitWidth + upButtonSpacing : 0)
|
||||
+ leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
upButtonSpacing: 20
|
||||
padding: 1
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.backgroundColor
|
||||
}
|
||||
contentItem: ListView {
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
orientation: ListView.Horizontal
|
||||
snapMode: ListView.SnapToItem
|
||||
highlightMoveDuration: 0
|
||||
interactive: false
|
||||
clip: true
|
||||
}
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
text: folderName
|
||||
flat: true
|
||||
font.capitalization: Font.MixedCase
|
||||
|
||||
// The default of 100 is a bit too wide for short directory names.
|
||||
Binding {
|
||||
target: buttonDelegateRoot.background
|
||||
property: "implicitWidth"
|
||||
value: control.Material.buttonHeight
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
}
|
||||
separatorDelegate: IconImage {
|
||||
id: iconImage
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/crumb-separator-icon-square.png"
|
||||
sourceSize: Qt.size(8, 8)
|
||||
// The image is 8x8, and add 2 px padding on each side.
|
||||
width: 8 + 4
|
||||
height: control.contentItem.height
|
||||
color: control.Material.hintTextColor
|
||||
y: (control.height - height) / 2
|
||||
}
|
||||
upButton: ToolButton {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/up-icon-thick-square.png"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
width: height
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.name: qsTr("Up")
|
||||
}
|
||||
textField: TextField {
|
||||
text: (control.dialog as DialogsQuickImpl.FileDialogImpl)?.selectedFile
|
||||
?? (control.dialog as DialogsQuickImpl.FolderDialogImpl).currentFolder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FolderDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
FolderDialogImpl.folderDialogListView: folderDialogListView
|
||||
FolderDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
visible: parent.parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.topMargin: 24
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent !== Overlay.overlay ? 12 : 0
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 48
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: folderDialogListView
|
||||
objectName: "folderDialogListView"
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
showFiles: false
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FolderDialogDelegate {
|
||||
objectName: "folderDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
verticalPadding: 20
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.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: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/folder-icon-square.png"
|
||||
|
||||
file: fileUrl
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property date fileModified
|
||||
|
||||
contentItem: DialogsQuickImpl.FolderDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? Color.transparent(control.Material.accentColor, 0.08) : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.highlighted ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
FontDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
FontDialogImpl.buttonBox: buttonBox
|
||||
FontDialogImpl.familyListView: content.familyListView
|
||||
FontDialogImpl.styleListView: content.styleListView
|
||||
FontDialogImpl.sizeListView: content.sizeListView
|
||||
FontDialogImpl.sampleEdit: content.sampleEdit
|
||||
FontDialogImpl.writingSystemComboBox: writingSystemComboBox
|
||||
FontDialogImpl.underlineCheckBox: content.underline
|
||||
FontDialogImpl.strikeoutCheckBox: content.strikeout
|
||||
FontDialogImpl.familyEdit: content.familyEdit
|
||||
FontDialogImpl.styleEdit: content.styleEdit
|
||||
FontDialogImpl.sizeEdit: content.sizeEdit
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: content.parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 24
|
||||
bottomPadding: 24
|
||||
}
|
||||
|
||||
contentItem: FontDialogContent {
|
||||
id: content
|
||||
familyEdit.bottomPadding: 8
|
||||
styleEdit.bottomPadding: 8
|
||||
sizeEdit.bottomPadding: 8
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Writing System")
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
ComboBox{
|
||||
id: writingSystemComboBox
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 20
|
||||
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.Material.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
MessageDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
rowLayout.implicitWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
MessageDialogImpl.buttonBox: buttonBox
|
||||
MessageDialogImpl.detailedTextButton: detailedTextButton
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 320
|
||||
implicitHeight: 160
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 24
|
||||
bottomPadding: 24
|
||||
}
|
||||
|
||||
contentItem: Column {
|
||||
spacing: 24
|
||||
topPadding: control.parent !== Overlay.overlay ? 24 : 0
|
||||
|
||||
Label {
|
||||
id: textLabel
|
||||
objectName: "textLabel"
|
||||
text: control.text
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
|
||||
Label {
|
||||
id: informativeTextLabel
|
||||
objectName: "informativeTextLabel"
|
||||
text: control.informativeText
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
id: columnLayout
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
Button {
|
||||
id: detailedTextButton
|
||||
objectName: "detailedTextButton"
|
||||
text: control.showDetailedText ? qsTr("Hide Details...") : qsTr("Show Details...")
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
objectName: "buttonBox"
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 20
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: detailedTextButton.visible ? 12 : 20
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: detailedTextArea
|
||||
objectName: "detailedText"
|
||||
text: control.detailedText
|
||||
visible: control.showDetailedText
|
||||
wrapMode: TextEdit.WordWrap
|
||||
readOnly: true
|
||||
padding: 12
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 120
|
||||
implicitHeight: control.Material.textFieldHeight
|
||||
color: Qt.rgba(1,1,1,1)
|
||||
radius: 3
|
||||
border.color: Qt.darker(control.palette.light)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Material
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.SideBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentWidth: (contentItem as ListView)?.contentWidth
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.backgroundColor
|
||||
}
|
||||
contentItem: ListView {
|
||||
id: listView
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
}
|
||||
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
flat: true
|
||||
highlighted: control.currentIndex === index
|
||||
width: listView.width
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: buttonDelegateRoot.icon
|
||||
text: buttonDelegateRoot.folderName
|
||||
font: buttonDelegateRoot.font
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
|
||||
Accessible.name: folderName
|
||||
}
|
||||
|
||||
separatorDelegate: Item {
|
||||
implicitWidth: control.width
|
||||
implicitHeight: 9
|
||||
Rectangle {
|
||||
id: separatorDelegate
|
||||
color: Qt.lighter(Material.darkShade, 1.06)
|
||||
anchors.centerIn: parent
|
||||
radius: 1
|
||||
height: 1
|
||||
width: parent.width - 10
|
||||
}
|
||||
}
|
||||
|
||||
addFavoriteDelegate: Button {
|
||||
id: addFavoriteDelegateRoot
|
||||
text: qsTr("Add Favorite")
|
||||
flat: true
|
||||
width: control.width
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: addFavoriteDelegateRoot.icon
|
||||
text: addFavoriteDelegateRoot.labelText
|
||||
font: addFavoriteDelegateRoot.font
|
||||
opacity: addFavoriteDelegateRoot.dragHovering ? 0.2 : 1.0
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property string labelText
|
||||
required property bool dragHovering
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.Universal.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
ColorDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
verticalPadding: 18
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
isHsl: true
|
||||
|
||||
ColorDialogImpl.eyeDropperButton: eyeDropperButton
|
||||
ColorDialogImpl.buttonBox: buttonBox
|
||||
ColorDialogImpl.colorPicker: colorPicker
|
||||
ColorDialogImpl.alphaSlider: alphaSlider
|
||||
ColorDialogImpl.colorInputs: inputs
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 600
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
border.color: control.Universal.chromeHighColor
|
||||
border.width: 1 // FlyoutBorderThemeThickness
|
||||
}
|
||||
|
||||
header: RowLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
objectName: "titleLabel"
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.pixelSize: 20
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
background: Rectangle {
|
||||
x: 1; y: 1 // // FlyoutBorderThemeThickness
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
}
|
||||
|
||||
Layout.topMargin: 24
|
||||
Layout.bottomMargin: 24
|
||||
Layout.leftMargin: 18
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: control.title.length > 0 ? implicitHeight : 0
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 15
|
||||
}
|
||||
|
||||
Button {
|
||||
id: eyeDropperButton
|
||||
objectName: "eyeDropperButton"
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/eye-dropper.png"
|
||||
flat: true
|
||||
topPadding: 24
|
||||
bottomPadding: 24
|
||||
visible: false
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: 18
|
||||
|
||||
Accessible.name: qsTr("Eye dropper")
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 12
|
||||
SaturationLightnessPicker {
|
||||
id: colorPicker
|
||||
objectName: "colorPicker"
|
||||
color: control.color
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: hueSlider
|
||||
objectName: "hueSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.hue
|
||||
implicitHeight: 20
|
||||
onMoved: function() { control.hue = value; }
|
||||
handle: PickerHandle {
|
||||
x: hueSlider.leftPadding + (hueSlider.horizontal
|
||||
? hueSlider.visualPosition * (hueSlider.availableWidth - width)
|
||||
: (hueSlider.availableWidth - width) / 2)
|
||||
y: hueSlider.topPadding + (hueSlider.horizontal
|
||||
? (hueSlider.availableHeight - height) / 2
|
||||
: hueSlider.visualPosition * (hueSlider.availableHeight - height))
|
||||
picker: hueSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: hueSlider.handle.width / 2
|
||||
anchors.rightMargin: hueSlider.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: HueGradient {
|
||||
orientation: Gradient.Horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Hue")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: alphaSlider
|
||||
objectName: "alphaSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.alpha
|
||||
implicitHeight: 20
|
||||
handle: PickerHandle {
|
||||
x: alphaSlider.leftPadding + (alphaSlider.horizontal
|
||||
? alphaSlider.visualPosition * (alphaSlider.availableWidth - width)
|
||||
: (alphaSlider.availableWidth - width) / 2)
|
||||
y: alphaSlider.topPadding + (alphaSlider.horizontal
|
||||
? (alphaSlider.availableHeight - height) / 2
|
||||
: alphaSlider.visualPosition * (alphaSlider.availableHeight - height))
|
||||
picker: alphaSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: parent.handle.width / 2
|
||||
anchors.rightMargin: parent.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: alphaSliderGradient
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: alphaSliderGradient
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: Qt.rgba(control.color.r,
|
||||
control.color.g,
|
||||
control.color.b,
|
||||
1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Alpha")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
ColorInputs {
|
||||
id: inputs
|
||||
color: control.color
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
spacing: 24
|
||||
|
||||
Label {
|
||||
text: qsTr("Color")
|
||||
|
||||
Layout.topMargin: 6
|
||||
Layout.leftMargin: 24
|
||||
Layout.bottomMargin: 24
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
implicitWidth: 56
|
||||
implicitHeight: 36
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 6
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 6
|
||||
color: control.color
|
||||
}
|
||||
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 24
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
|
||||
Layout.rightMargin: 24
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.ColorInputsImpl {
|
||||
id: control
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
padding: 1
|
||||
mode: colorSystemComboBox.currentIndex
|
||||
|
||||
delegate: TextField {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
ComboBox {
|
||||
id: colorSystemComboBox
|
||||
objectName: "colorSystemComboBox"
|
||||
editable: false
|
||||
flat: true
|
||||
background.implicitWidth: 0
|
||||
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
|
||||
currentIndex: DialogsQuickImpl.ColorInputsImpl.Hex
|
||||
model: [qsTr("Hex"), qsTr("RGB"), qsTr("HSV"), qsTr("HSL")]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.Universal.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FileDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
verticalPadding: 18
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Dialog {
|
||||
id: overwriteConfirmationDialog
|
||||
objectName: "confirmationDialog"
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
dim: true
|
||||
modal: true
|
||||
title: qsTr("Overwrite file?")
|
||||
width: contentItem.implicitWidth + leftPadding + rightPadding
|
||||
|
||||
contentItem: Label {
|
||||
text: qsTr("“%1” already exists.\nDo you want to replace it?").arg(control.fileName)
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: overwriteConfirmationDialog.Universal.baseMediumColor
|
||||
}
|
||||
}
|
||||
|
||||
FileDialogImpl.buttonBox: buttonBox
|
||||
FileDialogImpl.nameFiltersComboBox: nameFiltersComboBox
|
||||
FileDialogImpl.fileDialogListView: fileDialogListView
|
||||
FileDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
FileDialogImpl.fileNameLabel: fileNameLabel
|
||||
FileDialogImpl.fileNameTextField: fileNameTextField
|
||||
FileDialogImpl.overwriteConfirmationDialog: overwriteConfirmationDialog
|
||||
FileDialogImpl.sideBar: sideBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
border.color: control.Universal.chromeHighColor
|
||||
border.width: 1 // FlyoutBorderThemeThickness
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.pixelSize: 20
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.topMargin: 18
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
|
||||
background: Rectangle {
|
||||
x: 1; y: 1 // // FlyoutBorderThemeThickness
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
}
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent !== Overlay.overlay ? 12 : 0
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 48
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: SplitView {
|
||||
id: contentLayout
|
||||
|
||||
contentHeight: sideBar.implicitHeight
|
||||
DialogsImpl.SideBar {
|
||||
id: sideBar
|
||||
dialog: control
|
||||
SplitView.minimumWidth: 50
|
||||
SplitView.maximumWidth: contentLayout.width / 2
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: fileDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
SplitView.fillWidth: true
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
nameFilters: control.selectedNameFilter.globs
|
||||
showDirsFirst: PlatformTheme.themeHint(PlatformTheme.ShowDirectoriesFirst)
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FileDialogDelegate {
|
||||
objectName: "fileDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
fileDetailRowWidth: nameFiltersComboBox.width
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: fileNameTextField.visible ? fileNameTextField : nameFiltersComboBox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: GridLayout {
|
||||
columnSpacing: 24
|
||||
columns: 3
|
||||
|
||||
Label {
|
||||
id: fileNameLabel
|
||||
text: qsTr("File name")
|
||||
visible: false
|
||||
|
||||
Layout.leftMargin: 24
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: fileNameTextField
|
||||
objectName: "fileNameTextField"
|
||||
visible: false
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Filter")
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 0
|
||||
Layout.leftMargin: 24
|
||||
Layout.bottomMargin: 24
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: nameFiltersComboBox
|
||||
model: control.nameFilters
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 24
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
|
||||
Layout.rightMargin: 24
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Universal
|
||||
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)
|
||||
|
||||
spacing: 12
|
||||
|
||||
padding: 12
|
||||
topPadding: padding - 1
|
||||
bottomPadding: padding + 1
|
||||
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
icon.color: Color.transparent(Universal.foreground, enabled ? 1.0 : 0.2)
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/"
|
||||
+ (fileIsDir ? "folder" : "file") + "-icon-square.png"
|
||||
|
||||
file: fileUrl
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property double fileSize
|
||||
required property date fileModified
|
||||
required property bool fileIsDir
|
||||
|
||||
required property int fileDetailRowWidth
|
||||
|
||||
Accessible.name: fileName
|
||||
|
||||
contentItem: DialogsQuickImpl.FileDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.icon.color
|
||||
fileDetailRowWidth: control.fileDetailRowWidth
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
visible: control.down || control.highlighted || control.visualFocus || control.hovered
|
||||
color: control.down ? control.Universal.listMediumColor :
|
||||
control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: control.visualFocus || control.highlighted
|
||||
color: control.Universal.accent
|
||||
opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.FolderBreadcrumbBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + (upButton ? upButton.implicitWidth + upButtonSpacing : 0)
|
||||
+ leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
upButtonSpacing: 20
|
||||
padding: 1
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Universal.background
|
||||
}
|
||||
contentItem: ListView {
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
orientation: ListView.Horizontal
|
||||
snapMode: ListView.SnapToItem
|
||||
highlightMoveDuration: 0
|
||||
interactive: false
|
||||
clip: true
|
||||
}
|
||||
buttonDelegate: ToolButton {
|
||||
id: buttonDelegateRoot
|
||||
text: folderName
|
||||
|
||||
// The default is a bit too wide for short directory names.
|
||||
Binding {
|
||||
target: buttonDelegateRoot.background
|
||||
property: "implicitWidth"
|
||||
value: 48
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
}
|
||||
separatorDelegate: IconImage {
|
||||
id: iconImage
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/crumb-separator-icon-square.png"
|
||||
sourceSize: Qt.size(8, 8)
|
||||
// The image is 8x8, and add 2 px padding on each side.
|
||||
width: 8 + 4
|
||||
height: control.contentItem.height
|
||||
color: Color.transparent(control.Universal.foreground, enabled ? 1.0 : 0.2)
|
||||
y: (control.height - height) / 2
|
||||
}
|
||||
upButton: ToolButton {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/up-icon-square.png"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
width: height
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.name: qsTr("Up")
|
||||
}
|
||||
textField: TextField {
|
||||
text: (control.dialog as DialogsQuickImpl.FileDialogImpl)?.selectedFile
|
||||
?? (control.dialog as DialogsQuickImpl.FolderDialogImpl).currentFolder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.Universal.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FolderDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
verticalPadding: 18
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
FolderDialogImpl.folderDialogListView: folderDialogListView
|
||||
FolderDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
border.color: control.Universal.chromeHighColor
|
||||
border.width: 1 // FlyoutBorderThemeThickness
|
||||
}
|
||||
|
||||
header: ColumnLayout {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.pixelSize: 20
|
||||
visible: parent.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.topMargin: 18
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 0
|
||||
|
||||
background: Rectangle {
|
||||
// FlyoutBorderThemeThickness
|
||||
x: 1
|
||||
y: 1
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
}
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
dialog: control
|
||||
|
||||
Layout.topMargin: parent.parent?.parent !== Overlay.overlay ? 12 : 0
|
||||
Layout.leftMargin: 24
|
||||
Layout.rightMargin: 24
|
||||
Layout.preferredWidth: 400
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: folderDialogListView
|
||||
objectName: "folderDialogListView"
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
showFiles: false
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FolderDialogDelegate {
|
||||
objectName: "folderDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 6
|
||||
bottomPadding: 24
|
||||
alignment: Qt.AlignRight
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Universal
|
||||
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)
|
||||
|
||||
spacing: 12
|
||||
|
||||
padding: 12
|
||||
topPadding: padding - 1
|
||||
bottomPadding: padding + 1
|
||||
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
icon.color: Color.transparent(Universal.foreground, enabled ? 1.0 : 0.2)
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/folder-icon-square.png"
|
||||
|
||||
file: fileUrl
|
||||
|
||||
required property int index
|
||||
required property string fileName
|
||||
required property url fileUrl
|
||||
required property date fileModified
|
||||
|
||||
contentItem: DialogsQuickImpl.FolderDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.Universal.baseMediumColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
visible: control.down || control.highlighted || control.visualFocus || control.hovered
|
||||
color: control.down ? control.Universal.listMediumColor :
|
||||
control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: control.visualFocus || control.highlighted
|
||||
color: control.Universal.accent
|
||||
opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.Universal.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
FontDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
verticalPadding: 18
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
FontDialogImpl.buttonBox: buttonBox
|
||||
FontDialogImpl.familyListView: content.familyListView
|
||||
FontDialogImpl.styleListView: content.styleListView
|
||||
FontDialogImpl.sizeListView: content.sizeListView
|
||||
FontDialogImpl.sampleEdit: content.sampleEdit
|
||||
FontDialogImpl.writingSystemComboBox: writingSystemComboBox
|
||||
FontDialogImpl.underlineCheckBox: content.underline
|
||||
FontDialogImpl.strikeoutCheckBox: content.strikeout
|
||||
FontDialogImpl.familyEdit: content.familyEdit
|
||||
FontDialogImpl.styleEdit: content.styleEdit
|
||||
FontDialogImpl.sizeEdit: content.sizeEdit
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
border.color: control.Universal.chromeHighColor
|
||||
border.width: 1 // FlyoutBorderThemeThickness
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.pixelSize: 20
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 18
|
||||
height: control.title.length > 0 ? implicitHeight : 0
|
||||
visible: content.parent?.parent === Overlay.overlay
|
||||
|
||||
background: Rectangle {
|
||||
x: 1; y: 1 // // FlyoutBorderThemeThickness
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: FontDialogContent {
|
||||
id: content
|
||||
rowSpacing: 12
|
||||
}
|
||||
|
||||
footer: RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 24
|
||||
|
||||
Label {
|
||||
text: qsTr("Writing System")
|
||||
|
||||
Layout.leftMargin: 24
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 24
|
||||
}
|
||||
ComboBox{
|
||||
id: writingSystemComboBox
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 6
|
||||
Layout.bottomMargin: 24
|
||||
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
|
||||
Layout.rightMargin: 24
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
MessageDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitHeaderWidth,
|
||||
rowLayout.implicitWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
verticalPadding: 18
|
||||
|
||||
MessageDialogImpl.buttonBox: buttonBox
|
||||
MessageDialogImpl.detailedTextButton: detailedTextButton
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 320
|
||||
implicitHeight: 160
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
border.color: control.Universal.chromeHighColor
|
||||
border.width: 1 // FlyoutBorderThemeThickness
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.pixelSize: 20
|
||||
visible: parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
|
||||
leftPadding: 24
|
||||
rightPadding: 24
|
||||
topPadding: 18
|
||||
|
||||
background: Rectangle {
|
||||
x: 1; y: 1 // // FlyoutBorderThemeThickness
|
||||
color: control.Universal.chromeMediumLowColor
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Column {
|
||||
spacing: 24
|
||||
|
||||
Label {
|
||||
id: textLabel
|
||||
objectName: "textLabel"
|
||||
text: control.text
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
Label {
|
||||
id: informativeTextLabel
|
||||
objectName: "informativeTextLabel"
|
||||
text: control.informativeText
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
id: columnLayout
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 12
|
||||
|
||||
Layout.margins: 20
|
||||
|
||||
Button {
|
||||
id: detailedTextButton
|
||||
objectName: "detailedTextButton"
|
||||
text: control.showDetailedText ? qsTr("Hide Details...") : qsTr("Show Details...")
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
objectName: "buttonBox"
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: detailedTextArea
|
||||
objectName: "detailedText"
|
||||
text: control.detailedText
|
||||
visible: control.showDetailedText
|
||||
wrapMode: TextEdit.WordWrap
|
||||
readOnly: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 60 // TextControlThemeMinWidth - 4 (border)
|
||||
implicitHeight: 28 // TextControlThemeMinHeight - 4 (border)
|
||||
color: Qt.rgba(1,1,1,1)
|
||||
radius: 3
|
||||
border.color: Qt.darker(control.palette.light)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: control.Universal.baseLowColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Universal
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.SideBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentWidth: (contentItem as ListView)?.contentWidth
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Universal.background
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: listView
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
}
|
||||
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
flat: true
|
||||
highlighted: control.currentIndex === index
|
||||
width: listView.width
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: buttonDelegateRoot.icon
|
||||
text: buttonDelegateRoot.folderName
|
||||
font: buttonDelegateRoot.font
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
|
||||
Accessible.name: folderName
|
||||
}
|
||||
|
||||
separatorDelegate: Item {
|
||||
implicitWidth: control.width
|
||||
implicitHeight: 9
|
||||
Rectangle {
|
||||
id: separatorDelegate
|
||||
color: Qt.lighter(Universal.darkShade, 1.06)
|
||||
anchors.centerIn: parent
|
||||
radius: 1
|
||||
height: 1
|
||||
width: parent.width - 10
|
||||
}
|
||||
}
|
||||
|
||||
addFavoriteDelegate: Button {
|
||||
id: addFavoriteDelegateRoot
|
||||
text: qsTr("Add Favorite")
|
||||
flat: true
|
||||
width: control.width
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: addFavoriteDelegateRoot.icon
|
||||
text: addFavoriteDelegateRoot.labelText
|
||||
font: addFavoriteDelegateRoot.font
|
||||
alignment: Qt.AlignLeft
|
||||
opacity: addFavoriteDelegateRoot.dragHovering ? 0.2 : 1.0
|
||||
}
|
||||
|
||||
required property string labelText
|
||||
required property bool dragHovering
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
ColorDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 6
|
||||
rightPadding: 6
|
||||
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
isHsl: true
|
||||
|
||||
ColorDialogImpl.eyeDropperButton: eyeDropperButton
|
||||
ColorDialogImpl.buttonBox: buttonBox
|
||||
ColorDialogImpl.colorPicker: colorPicker
|
||||
ColorDialogImpl.colorInputs: inputs
|
||||
ColorDialogImpl.alphaSlider: alphaSlider
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 600
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
header: Pane {
|
||||
palette.window: control.palette.light
|
||||
padding: 20
|
||||
|
||||
contentItem: RowLayout {
|
||||
Label {
|
||||
objectName: "titleLabel"
|
||||
text: control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
visible: parent.parent?.parent?.parent === Overlay.overlay
|
||||
|
||||
Layout.preferredWidth: control.title.length > 0 ? implicitWidth : 0
|
||||
Layout.preferredHeight: control.title.length > 0 ? implicitHeight : 15
|
||||
Layout.leftMargin: 12
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
Button {
|
||||
id: eyeDropperButton
|
||||
objectName: "eyeDropperButton"
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/eye-dropper.png"
|
||||
flat: true
|
||||
visible: false
|
||||
|
||||
Layout.preferredWidth: implicitHeight
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: 6
|
||||
|
||||
Accessible.name: qsTr("Eye dropper")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 12
|
||||
SaturationLightnessPicker {
|
||||
id: colorPicker
|
||||
objectName: "colorPicker"
|
||||
color: control.color
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: hueSlider
|
||||
objectName: "hueSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.hue
|
||||
implicitHeight: 20
|
||||
onMoved: function() { control.hue = value; }
|
||||
handle: PickerHandle {
|
||||
x: hueSlider.leftPadding + (hueSlider.horizontal
|
||||
? hueSlider.visualPosition * (hueSlider.availableWidth - width)
|
||||
: (hueSlider.availableWidth - width) / 2)
|
||||
y: hueSlider.topPadding + (hueSlider.horizontal
|
||||
? (hueSlider.availableHeight - height) / 2
|
||||
: hueSlider.visualPosition * (hueSlider.availableHeight - height))
|
||||
picker: hueSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: hueSlider.handle.width / 2
|
||||
anchors.rightMargin: hueSlider.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: HueGradient {
|
||||
orientation: Gradient.Horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Hue")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: alphaSlider
|
||||
objectName: "alphaSlider"
|
||||
orientation: Qt.Horizontal
|
||||
value: control.alpha
|
||||
implicitHeight: 20
|
||||
handle: PickerHandle {
|
||||
x: alphaSlider.leftPadding + (alphaSlider.horizontal
|
||||
? alphaSlider.visualPosition * (alphaSlider.availableWidth - width)
|
||||
: (alphaSlider.availableWidth - width) / 2)
|
||||
y: alphaSlider.topPadding + (alphaSlider.horizontal
|
||||
? (alphaSlider.availableHeight - height) / 2
|
||||
: alphaSlider.visualPosition * (alphaSlider.availableHeight - height))
|
||||
picker: alphaSlider
|
||||
}
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: parent.handle.width / 2
|
||||
anchors.rightMargin: parent.handle.width / 2
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
radius: 10
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: alphaSliderGradient
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: alphaSliderGradient
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: 10
|
||||
gradient: Gradient {
|
||||
orientation: Gradient.Horizontal
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: Qt.rgba(control.color.r,
|
||||
control.color.g,
|
||||
control.color.b,
|
||||
1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: qsTr("Alpha")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
}
|
||||
|
||||
ColorInputs {
|
||||
id: inputs
|
||||
color: control.color
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 12
|
||||
Layout.rightMargin: 12
|
||||
Layout.bottomMargin: 12
|
||||
}
|
||||
}
|
||||
|
||||
footer: Rectangle {
|
||||
color: control.palette.light
|
||||
implicitWidth: rowLayout.implicitWidth
|
||||
implicitHeight: rowLayout.implicitHeight
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Color")
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
border.width: 2
|
||||
border.color: control.palette.dark
|
||||
color: "transparent"
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/checkers.png"
|
||||
fillMode: Image.Tile
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
color: control.color
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
// empty space filler
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
palette.window: control.palette.light
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 20
|
||||
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.ColorInputsImpl {
|
||||
id: control
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
spacing: 1
|
||||
padding: 1
|
||||
|
||||
mode: colorSystemComboBox.currentIndex
|
||||
|
||||
delegate: TextField {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
ComboBox {
|
||||
id: colorSystemComboBox
|
||||
objectName: "colorSystemComboBox"
|
||||
editable: false
|
||||
flat: true
|
||||
background.implicitWidth: 0
|
||||
implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
|
||||
currentIndex: DialogsQuickImpl.ColorInputsImpl.Hex
|
||||
model: [qsTr("Hex"), qsTr("RGB"), qsTr("HSV"), qsTr("HSL")]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FileDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
Dialog {
|
||||
id: overwriteConfirmationDialog
|
||||
objectName: "confirmationDialog"
|
||||
anchors.centerIn: parent
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
dim: true
|
||||
modal: true
|
||||
title: qsTr("Overwrite file?")
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
width: overwriteConfirmationDialogLastTextLine.width
|
||||
Label {
|
||||
text: control.fileName + " already exists."
|
||||
}
|
||||
Label {
|
||||
id: overwriteConfirmationDialogLastTextLine
|
||||
text: "Do you want to replace it?"
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
alignment: Qt.AlignHCenter
|
||||
standardButtons: DialogButtonBox.Yes | DialogButtonBox.No
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
We use attached properties because we want to handle logic in C++, and:
|
||||
- We can't assume the footer only contains a DialogButtonBox (which would allow us
|
||||
to connect up to it in QQuickFileDialogImpl); it also needs to hold a ComboBox
|
||||
and therefore the root footer item will be e.g. a layout item instead.
|
||||
- We don't want to create our own "FileDialogButtonBox" (in order to be able to handle the logic
|
||||
in C++) because we'd need to copy (and hence duplicate code in) DialogButtonBox.qml.
|
||||
*/
|
||||
FileDialogImpl.buttonBox: buttonBox
|
||||
FileDialogImpl.nameFiltersComboBox: nameFiltersComboBox
|
||||
FileDialogImpl.fileDialogListView: fileDialogListView
|
||||
FileDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
FileDialogImpl.fileNameLabel: fileNameLabel
|
||||
FileDialogImpl.fileNameTextField: fileNameTextField
|
||||
FileDialogImpl.overwriteConfirmationDialog: overwriteConfirmationDialog
|
||||
FileDialogImpl.sideBar: sideBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
header: Pane {
|
||||
palette.window: control.palette.light
|
||||
padding: 20
|
||||
|
||||
contentItem: Column {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
objectName: "dialogTitleBarLabel"
|
||||
width: parent.width
|
||||
text: control.title
|
||||
visible: parent.parent.parent?.parent === Overlay.overlay && control.title.length > 0
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
width: parent.width
|
||||
dialog: control
|
||||
|
||||
KeyNavigation.tab: fileDialogListView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: SplitView {
|
||||
id: contentLayout
|
||||
|
||||
contentHeight: sideBar.implicitHeight
|
||||
DialogsImpl.SideBar {
|
||||
id: sideBar
|
||||
dialog: control
|
||||
SplitView.minimumWidth: 50
|
||||
SplitView.maximumWidth: contentLayout.width / 2
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: fileDialogListView
|
||||
objectName: "fileDialogListView"
|
||||
SplitView.fillWidth: true
|
||||
clip: true
|
||||
focus: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
nameFilters: control.selectedNameFilter.globs
|
||||
showDirsFirst: PlatformTheme.themeHint(PlatformTheme.ShowDirectoriesFirst)
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FileDialogDelegate {
|
||||
objectName: "fileDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
fileDetailRowWidth: nameFiltersComboBox.width
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: fileNameTextField.visible ? fileNameTextField : nameFiltersComboBox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer: Rectangle {
|
||||
color: control.palette.light
|
||||
implicitWidth: gridLayout.implicitWidth
|
||||
implicitHeight: gridLayout.implicitHeight + 12
|
||||
|
||||
GridLayout {
|
||||
// OK to use IDs here, since users shouldn't be overriding this stuff.
|
||||
id: gridLayout
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 6
|
||||
anchors.bottomMargin: 6
|
||||
columnSpacing: 20
|
||||
columns: 3
|
||||
|
||||
Label {
|
||||
id: fileNameLabel
|
||||
text: qsTr("File name")
|
||||
visible: false
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: fileNameTextField
|
||||
objectName: "fileNameTextField"
|
||||
visible: false
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Filter")
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 0
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: nameFiltersComboBox
|
||||
model: control.nameFilters
|
||||
verticalPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
palette.window: control.palette.light
|
||||
spacing: 12
|
||||
padding: 0
|
||||
|
||||
Layout.row: 1
|
||||
Layout.column: 2
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.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: 12
|
||||
spacing: 8
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
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/"
|
||||
+ (fileIsDir ? "folder" : "file") + "-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 double fileSize
|
||||
required property date fileModified
|
||||
required property bool fileIsDir
|
||||
|
||||
property int fileDetailRowWidth
|
||||
|
||||
Accessible.name: fileName
|
||||
|
||||
contentItem: DialogsQuickImpl.FileDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: control.icon.color
|
||||
fileDetailRowWidth: control.fileDetailRowWidth
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted || control.visualFocus
|
||||
color: Color.blend(control.down ? control.palette.midlight : control.palette.light,
|
||||
control.palette.highlight, control.highlighted ? 0.15 : 0.0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
/*
|
||||
Most of the elements in here are the same between styles, so we
|
||||
have a reusable component for it and provide some properties to enable style-specific tweaks.
|
||||
*/
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: column.implicitWidth
|
||||
implicitHeight: column.implicitHeight
|
||||
|
||||
required property DialogsQuickImpl.FileDialogDelegate delegate
|
||||
required property int fileDetailRowWidth
|
||||
|
||||
property color fileDetailRowTextColor
|
||||
|
||||
Column {
|
||||
id: column
|
||||
y: (parent.height - height) / 2
|
||||
|
||||
Row {
|
||||
spacing: root.delegate.spacing
|
||||
|
||||
IconImage {
|
||||
id: iconImage
|
||||
source: root.delegate.icon.source
|
||||
sourceSize: Qt.size(root.delegate.icon.width, root.delegate.icon.height)
|
||||
width: root.delegate.icon.width
|
||||
height: root.delegate.icon.height
|
||||
color: root.delegate.icon.color
|
||||
y: (parent.height - height) / 2
|
||||
}
|
||||
Label {
|
||||
text: root.delegate.fileName
|
||||
color: root.delegate.icon.color
|
||||
y: (parent.height - height) / 2
|
||||
|
||||
Accessible.ignored: true
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: fileDetailRow
|
||||
x: iconImage.width + root.delegate.spacing
|
||||
width: fileDetailRowWidth - x - root.delegate.leftPadding
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
Label {
|
||||
text: {
|
||||
const fileSize = root.delegate.fileSize;
|
||||
return fileSize > Number.MAX_SAFE_INTEGER
|
||||
? ('>' + locale.formattedDataSize(Number.MAX_SAFE_INTEGER))
|
||||
: locale.formattedDataSize(fileSize);
|
||||
}
|
||||
font.pixelSize: root.delegate.font.pixelSize * 0.75
|
||||
color: root.fileDetailRowTextColor
|
||||
|
||||
Accessible.ignored: true
|
||||
}
|
||||
Label {
|
||||
text: Qt.formatDateTime(root.delegate.fileModified)
|
||||
font.pixelSize: root.delegate.font.pixelSize * 0.75
|
||||
color: root.fileDetailRowTextColor
|
||||
x: parent.width - width
|
||||
|
||||
Accessible.ignored: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.FolderBreadcrumbBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + (upButton ? upButton.implicitWidth + upButtonSpacing : 0)
|
||||
+ leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
upButtonSpacing: 20
|
||||
padding: 1
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.button
|
||||
}
|
||||
contentItem: ListView {
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
orientation: ListView.Horizontal
|
||||
snapMode: ListView.SnapToItem
|
||||
highlightMoveDuration: 0
|
||||
interactive: false
|
||||
clip: true
|
||||
}
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
text: folderName
|
||||
flat: true
|
||||
|
||||
// The default of 100 is a bit too wide for short directory names.
|
||||
Binding {
|
||||
target: buttonDelegateRoot.background
|
||||
property: "implicitWidth"
|
||||
value: 40
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
}
|
||||
separatorDelegate: IconImage {
|
||||
id: iconImage
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/crumb-separator-icon-round.png"
|
||||
sourceSize: Qt.size(8, 8)
|
||||
width: 8
|
||||
height: control.contentItem.height
|
||||
color: control.palette.buttonText
|
||||
y: (control.height - height) / 2
|
||||
}
|
||||
upButton: ToolButton {
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
icon.source: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/images/up-icon-round.png"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
width: height
|
||||
focusPolicy: Qt.TabFocus
|
||||
Accessible.name: qsTr("Up")
|
||||
}
|
||||
textField: TextField {
|
||||
text: (control.dialog as DialogsQuickImpl.FileDialogImpl)?.selectedFile
|
||||
?? (control.dialog as DialogsQuickImpl.FolderDialogImpl).currentFolder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import Qt.labs.folderlistmodel
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
import "." as DialogsImpl
|
||||
|
||||
FolderDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
standardButtons: T.Dialog.Open | T.Dialog.Cancel
|
||||
|
||||
FolderDialogImpl.folderDialogListView: folderDialogListView
|
||||
FolderDialogImpl.breadcrumbBar: breadcrumbBar
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
header: Pane {
|
||||
palette.window: control.palette.light
|
||||
padding: 20
|
||||
|
||||
contentItem: Column {
|
||||
spacing: 12
|
||||
|
||||
Label {
|
||||
objectName: "dialogTitleBarLabel"
|
||||
width: parent.width
|
||||
text: control.title
|
||||
visible: control.parent === Overlay.overlay && control.title.length > 0
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
DialogsImpl.FolderBreadcrumbBar {
|
||||
id: breadcrumbBar
|
||||
width: parent.width
|
||||
dialog: control
|
||||
|
||||
KeyNavigation.tab: folderDialogListView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: folderDialogListView
|
||||
objectName: "folderDialogListView"
|
||||
clip: true
|
||||
focus: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
model: FolderListModel {
|
||||
folder: control.currentFolder
|
||||
showFiles: false
|
||||
sortCaseSensitive: false
|
||||
}
|
||||
delegate: DialogsImpl.FolderDialogDelegate {
|
||||
objectName: "folderDialogDelegate" + index
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
dialog: control
|
||||
|
||||
KeyNavigation.backtab: breadcrumbBar
|
||||
KeyNavigation.tab: control.footer
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
palette.window: control.palette.light
|
||||
spacing: 12
|
||||
alignment: Qt.AlignRight
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.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: 12
|
||||
spacing: 8
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
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: DialogsQuickImpl.FolderDialogDelegateLabel {
|
||||
delegate: control
|
||||
fileDetailRowTextColor: Qt.lighter(control.icon.color)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted || control.visualFocus
|
||||
color: Color.blend(control.down ? control.palette.midlight : control.palette.light,
|
||||
control.palette.highlight, control.highlighted ? 0.15 : 0.0)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
/*
|
||||
Most of the elements in here are the same between styles, so we
|
||||
have a reusable component for it and provide some properties to enable style-specific tweaks.
|
||||
*/
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: column.implicitWidth
|
||||
implicitHeight: column.implicitHeight
|
||||
|
||||
required property DialogsQuickImpl.FileDialogDelegate delegate
|
||||
|
||||
property color fileDetailRowTextColor
|
||||
|
||||
Column {
|
||||
id: column
|
||||
y: (parent.height - height) / 2
|
||||
|
||||
Row {
|
||||
spacing: root.delegate.spacing
|
||||
|
||||
IconImage {
|
||||
id: iconImage
|
||||
source: root.delegate.icon.source
|
||||
sourceSize: Qt.size(root.delegate.icon.width, root.delegate.icon.height)
|
||||
width: root.delegate.icon.width
|
||||
height: root.delegate.icon.height
|
||||
color: root.delegate.icon.color
|
||||
y: (parent.height - height) / 2
|
||||
}
|
||||
Label {
|
||||
text: root.delegate.fileName
|
||||
color: root.delegate.icon.color
|
||||
y: (parent.height - height) / 2
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
x: iconImage.width + root.delegate.spacing
|
||||
text: Qt.formatDateTime(root.delegate.fileModified)
|
||||
font.pixelSize: root.delegate.font.pixelSize * 0.75
|
||||
color: root.fileDetailRowTextColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Templates as T
|
||||
|
||||
FontDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(control.implicitBackgroundWidth + control.leftInset + control.rightInset,
|
||||
control.implicitContentWidth + control.leftPadding + control.rightPadding,
|
||||
control.implicitHeaderWidth,
|
||||
control.implicitFooterWidth)
|
||||
implicitHeight: Math.max(control.implicitBackgroundHeight + control.topInset + control.bottomInset,
|
||||
control.implicitContentHeight + control.topPadding + control.bottomPadding
|
||||
+ (control.implicitHeaderHeight > 0 ? control.implicitHeaderHeight + control.spacing : 0)
|
||||
+ (control.implicitFooterHeight > 0 ? control.implicitFooterHeight + control.spacing : 0))
|
||||
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
spacing: 12
|
||||
|
||||
standardButtons: T.Dialog.Ok | T.Dialog.Cancel
|
||||
|
||||
FontDialogImpl.buttonBox: buttonBox
|
||||
FontDialogImpl.familyListView: content.familyListView
|
||||
FontDialogImpl.styleListView: content.styleListView
|
||||
FontDialogImpl.sizeListView: content.sizeListView
|
||||
FontDialogImpl.sampleEdit: content.sampleEdit
|
||||
FontDialogImpl.writingSystemComboBox: writingSystemComboBox
|
||||
FontDialogImpl.underlineCheckBox: content.underline
|
||||
FontDialogImpl.strikeoutCheckBox: content.strikeout
|
||||
FontDialogImpl.familyEdit: content.familyEdit
|
||||
FontDialogImpl.styleEdit: content.styleEdit
|
||||
FontDialogImpl.sizeEdit: content.sizeEdit
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 400
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
|
||||
header: Pane {
|
||||
palette.window: control.palette.light
|
||||
padding: 20
|
||||
visible: content.parent?.parent === Overlay.overlay
|
||||
|
||||
contentItem: Label {
|
||||
width: parent.width
|
||||
text: control.title
|
||||
visible: control.title.length > 0
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: FontDialogContent {
|
||||
id: content
|
||||
}
|
||||
|
||||
footer: Rectangle {
|
||||
color: control.palette.light
|
||||
implicitWidth: rowLayout.implicitWidth
|
||||
implicitHeight: rowLayout.implicitHeight
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
spacing: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Writing System")
|
||||
|
||||
Layout.leftMargin: 20
|
||||
}
|
||||
ComboBox{
|
||||
id: writingSystemComboBox
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
standardButtons: control.standardButtons
|
||||
palette.window: control.palette.light
|
||||
spacing: 12
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 20
|
||||
|
||||
Layout.rightMargin: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
GridLayout {
|
||||
property alias familyListView: fontFamilyListView
|
||||
property alias styleListView: fontStyleListView
|
||||
property alias sizeListView: fontSizeListView
|
||||
property alias sampleEdit: fontSample
|
||||
property alias underline: fontUnderline
|
||||
property alias strikeout: fontStrikeout
|
||||
property alias familyEdit: fontFamilyEdit
|
||||
property alias styleEdit: fontStyleEdit
|
||||
property alias sizeEdit: fontSizeEdit
|
||||
|
||||
columns: 3
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Layout.preferredWidth: 50
|
||||
|
||||
Label {
|
||||
text: qsTr("Family")
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
TextField {
|
||||
id: fontFamilyEdit
|
||||
objectName: "familyEdit"
|
||||
readOnly: true
|
||||
Layout.fillWidth: true
|
||||
focus: true
|
||||
Accessible.name: qsTr("Font family")
|
||||
}
|
||||
Frame {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
background: Rectangle {
|
||||
color: palette.base
|
||||
}
|
||||
ListView {
|
||||
id: fontFamilyListView
|
||||
objectName: "familyListView"
|
||||
implicitHeight: 200
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AlwaysOn
|
||||
}
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
highlightMoveVelocity: -1
|
||||
highlightMoveDuration: 1
|
||||
highlightFollowsCurrentItem: true
|
||||
keyNavigationEnabled: true
|
||||
|
||||
delegate: ItemDelegate {
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
onClicked: () => fontFamilyListView.currentIndex = index
|
||||
text: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Layout.preferredWidth: 30
|
||||
|
||||
Label {
|
||||
text: qsTr("Style")
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
TextField {
|
||||
id: fontStyleEdit
|
||||
objectName: "styleEdit"
|
||||
readOnly: true
|
||||
Layout.fillWidth: true
|
||||
Accessible.name: qsTr("Font style")
|
||||
}
|
||||
Frame {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
background: Rectangle {
|
||||
color: palette.base
|
||||
}
|
||||
ListView {
|
||||
id: fontStyleListView
|
||||
objectName: "styleListView"
|
||||
implicitHeight: 200
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
highlightMoveVelocity: -1
|
||||
highlightMoveDuration: 1
|
||||
highlightFollowsCurrentItem: true
|
||||
keyNavigationEnabled: true
|
||||
|
||||
delegate: ItemDelegate {
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
onClicked: () => fontStyleListView.currentIndex = index
|
||||
text: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Layout.preferredWidth: 20
|
||||
|
||||
Label {
|
||||
text: qsTr("Size")
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
TextField {
|
||||
id: fontSizeEdit
|
||||
objectName: "sizeEdit"
|
||||
Layout.fillWidth: true
|
||||
validator: IntValidator {
|
||||
bottom: 1
|
||||
top: 512
|
||||
}
|
||||
Accessible.name: qsTr("Font point size")
|
||||
}
|
||||
Frame {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
background: Rectangle {
|
||||
color: palette.base
|
||||
}
|
||||
ListView {
|
||||
id: fontSizeListView
|
||||
objectName: "sizeListView"
|
||||
implicitHeight: 200
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AlwaysOn
|
||||
}
|
||||
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
highlightMoveVelocity: -1
|
||||
highlightMoveDuration: 1
|
||||
highlightFollowsCurrentItem: true
|
||||
keyNavigationEnabled: true
|
||||
|
||||
delegate: ItemDelegate {
|
||||
width: ListView.view.width
|
||||
highlighted: ListView.isCurrentItem
|
||||
onClicked: () => fontSizeListView.currentIndex = index
|
||||
text: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.preferredWidth: 80
|
||||
|
||||
GroupBox {
|
||||
id: effectsGroupBox
|
||||
title: qsTr("Effects")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
label: Label {
|
||||
anchors.left: effectsGroupBox.left
|
||||
text: parent.title
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
CheckBox {
|
||||
id: fontUnderline
|
||||
objectName: "underlineEffect"
|
||||
text: qsTr("Underline")
|
||||
}
|
||||
CheckBox{
|
||||
id: fontStrikeout
|
||||
objectName: "strikeoutEffect"
|
||||
text: qsTr("Strikeout")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
id: sample
|
||||
padding: label.implicitHeight
|
||||
title: qsTr("Sample")
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 80
|
||||
Layout.fillHeight: true
|
||||
Layout.columnSpan: 2
|
||||
clip: true
|
||||
|
||||
background: Rectangle {
|
||||
y: sample.topPadding - sample.bottomPadding
|
||||
width: sample.width - sample.leftPadding + sample.rightPadding
|
||||
height: sample.height - sample.topPadding + sample.bottomPadding
|
||||
radius: 3
|
||||
color: palette.base
|
||||
}
|
||||
|
||||
label: Label {
|
||||
anchors.left: sample.left
|
||||
text: sample.title
|
||||
}
|
||||
|
||||
TextEdit {
|
||||
id: fontSample
|
||||
objectName: "sampleEdit"
|
||||
anchors.centerIn: parent
|
||||
readOnly: true
|
||||
color: palette.text
|
||||
focusPolicy: Qt.NoFocus
|
||||
Accessible.ignored: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
|
||||
Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "#ff0000"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.166666
|
||||
color: "#ffff00"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.333333
|
||||
color: "#00ff00"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: "#00ffff"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.666666
|
||||
color: "#0000ff"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.833333
|
||||
color: "#ff00ff"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: "#ff0000"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
// 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
import QtQuick.Layouts
|
||||
|
||||
MessageDialogImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(control.implicitBackgroundWidth + control.leftInset + control.rightInset,
|
||||
control.implicitHeaderWidth,
|
||||
rowLayout.implicitWidth)
|
||||
implicitHeight: Math.max(control.implicitBackgroundHeight + control.topInset + control.bottomInset,
|
||||
control.implicitContentHeight + control.topPadding + control.bottomPadding
|
||||
+ (control.implicitHeaderHeight > 0 ? control.implicitHeaderHeight + control.spacing : 0)
|
||||
+ (control.implicitFooterHeight > 0 ? control.implicitFooterHeight + control.spacing : 0))
|
||||
leftPadding: 20
|
||||
rightPadding: 20
|
||||
|
||||
// Ensure that the background's border is visible.
|
||||
leftInset: -1
|
||||
rightInset: -1
|
||||
topInset: -1
|
||||
bottomInset: -1
|
||||
|
||||
spacing: 16
|
||||
|
||||
MessageDialogImpl.buttonBox: buttonBox
|
||||
MessageDialogImpl.detailedTextButton: detailedTextButton
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 320
|
||||
implicitHeight: 160
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
header: Pane {
|
||||
palette.window: control.palette.light
|
||||
visible: parent?.parent === Overlay.overlay
|
||||
padding: 20
|
||||
|
||||
contentItem: Label {
|
||||
width: parent.width
|
||||
text: control.title
|
||||
visible: control.title.length > 0
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Column {
|
||||
padding: 10
|
||||
spacing: 16
|
||||
|
||||
Label {
|
||||
id: textLabel
|
||||
objectName: "textLabel"
|
||||
text: control.text
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
id: informativeTextLabel
|
||||
objectName: "informativeTextLabel"
|
||||
text: control.informativeText
|
||||
visible: text.length > 0
|
||||
wrapMode: Text.Wrap
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
}
|
||||
}
|
||||
|
||||
footer: ColumnLayout {
|
||||
id: columnLayout
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
spacing: 12
|
||||
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
|
||||
Button {
|
||||
id: detailedTextButton
|
||||
objectName: "detailedTextButton"
|
||||
text: control.showDetailedText ? qsTr("Hide Details...") : qsTr("Show Details...")
|
||||
padding: 0
|
||||
}
|
||||
|
||||
DialogButtonBox {
|
||||
id: buttonBox
|
||||
objectName: "buttonBox"
|
||||
spacing: 12
|
||||
padding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
TextArea {
|
||||
id: detailedTextArea
|
||||
objectName: "detailedText"
|
||||
text: control.detailedText
|
||||
visible: control.showDetailedText
|
||||
wrapMode: TextEdit.WordWrap
|
||||
readOnly: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
Layout.bottomMargin: 20
|
||||
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(1,1,1,1)
|
||||
radius: 3
|
||||
border.color: Qt.darker(control.palette.light)
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
radius: 8
|
||||
color: "transparent"
|
||||
border.color: picker.visualFocus ? "#0066ff" : (picker.pressed ? "#36383a" : "#454647")
|
||||
border.width: 1
|
||||
|
||||
required property T.Control picker
|
||||
|
||||
property alias handleColor: circle.color
|
||||
|
||||
Rectangle {
|
||||
id: circle
|
||||
x: 1
|
||||
y: 1
|
||||
width: 14
|
||||
height: 14
|
||||
radius: 7
|
||||
color: "transparent"
|
||||
border.color: root.picker.visualFocus ? "#0066ff" : (root.picker.pressed ? "#86888a" : "#959697")
|
||||
border.width: 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2022 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Dialogs.quickimpl
|
||||
|
||||
SaturationLightnessPickerImpl {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth)
|
||||
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight)
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: control.visualFocus ? (control.pressed ? "#cce0ff" : "#f0f6ff") : (control.pressed ? "#d6d6d6" : "#f6f6f6")
|
||||
border.color: "#353637"
|
||||
}
|
||||
|
||||
contentItem: ShaderEffect {
|
||||
scale: contentItem.width / width
|
||||
layer.enabled: true
|
||||
layer.smooth: true
|
||||
anchors.fill: parent
|
||||
|
||||
property alias hue: control.hue
|
||||
|
||||
fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/shaders/SaturationLightness.frag.qsb"
|
||||
}
|
||||
|
||||
handle: PickerHandle {
|
||||
x: control.leftPadding + control.lightness * control.availableWidth - width / 2
|
||||
y: control.topPadding + (1.0 - control.saturation) * control.availableHeight - height / 2
|
||||
picker: control
|
||||
handleColor: control.color
|
||||
z: 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// Copyright (C) 2024 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
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Basic
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Dialogs.quickimpl as DialogsQuickImpl
|
||||
|
||||
DialogsQuickImpl.SideBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentWidth: (contentItem as ListView)?.contentWidth
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
id: listView
|
||||
currentIndex: control.currentIndex
|
||||
model: control.contentModel
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
}
|
||||
|
||||
buttonDelegate: Button {
|
||||
id: buttonDelegateRoot
|
||||
flat: true
|
||||
highlighted: control.currentIndex === index
|
||||
width: listView.width
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: buttonDelegateRoot.icon
|
||||
text: buttonDelegateRoot.folderName
|
||||
font: buttonDelegateRoot.font
|
||||
// same as the icon color
|
||||
color: buttonDelegateRoot.icon.color
|
||||
alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
required property int index
|
||||
required property string folderName
|
||||
|
||||
Accessible.name: folderName
|
||||
}
|
||||
|
||||
separatorDelegate: Item {
|
||||
implicitWidth: control.width
|
||||
implicitHeight: 9
|
||||
Rectangle {
|
||||
id: separatorDelegate
|
||||
color: Qt.lighter(control.palette.dark, 1.06)
|
||||
anchors.centerIn: parent
|
||||
radius: 1
|
||||
height: 1
|
||||
width: parent.width - 10
|
||||
}
|
||||
}
|
||||
|
||||
addFavoriteDelegate: Button {
|
||||
id: addFavoriteDelegateRoot
|
||||
flat: true
|
||||
width: control.width
|
||||
contentItem: IconLabel {
|
||||
spacing: 5
|
||||
leftPadding: 10
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
icon: addFavoriteDelegateRoot.icon
|
||||
text: addFavoriteDelegateRoot.labelText
|
||||
font: addFavoriteDelegateRoot.font
|
||||
// same as the icon color
|
||||
color: addFavoriteDelegateRoot.icon.color
|
||||
alignment: Qt.AlignLeft
|
||||
opacity: addFavoriteDelegateRoot.dragHovering ? 0.2 : 1.0
|
||||
}
|
||||
|
||||
required property string labelText
|
||||
required property bool dragHovering
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
module QtQuick.Dialogs.quickimpl
|
||||
linktarget Qt6::qtquickdialogs2quickimplplugin
|
||||
optional plugin qtquickdialogs2quickimplplugin
|
||||
classname QtQuickDialogs2QuickImplPlugin
|
||||
typeinfo plugins.qmltypes
|
||||
depends QtQuick auto
|
||||
depends QtQuick.Templates auto
|
||||
depends QtQuick.Layouts auto
|
||||
prefer :/qt-project.org/imports/QtQuick/Dialogs/quickimpl/
|
||||
ColorDialog 6.0 qml/ColorDialog.qml
|
||||
ColorInputs 6.0 qml/ColorInputs.qml
|
||||
FileDialog 6.0 qml/FileDialog.qml
|
||||
FileDialogDelegate 6.0 qml/FileDialogDelegate.qml
|
||||
FileDialogDelegateLabel 6.0 qml/FileDialogDelegateLabel.qml
|
||||
FolderBreadcrumbBar 6.0 qml/FolderBreadcrumbBar.qml
|
||||
FolderDialog 6.0 qml/FolderDialog.qml
|
||||
FolderDialogDelegate 6.0 qml/FolderDialogDelegate.qml
|
||||
FolderDialogDelegateLabel 6.0 qml/FolderDialogDelegateLabel.qml
|
||||
FontDialog 6.0 qml/FontDialog.qml
|
||||
FontDialogContent 6.0 qml/FontDialogContent.qml
|
||||
HueGradient 6.0 qml/HueGradient.qml
|
||||
MessageDialog 6.0 qml/MessageDialog.qml
|
||||
PickerHandle 6.0 qml/PickerHandle.qml
|
||||
SaturationLightnessPicker 6.0 qml/SaturationLightnessPicker.qml
|
||||
SideBar 6.0 qml/SideBar.qml
|
||||
ColorDialog 6.0 qml/+Fusion/ColorDialog.qml
|
||||
ColorInputs 6.0 qml/+Fusion/ColorInputs.qml
|
||||
FileDialog 6.0 qml/+Fusion/FileDialog.qml
|
||||
FileDialogDelegate 6.0 qml/+Fusion/FileDialogDelegate.qml
|
||||
FolderBreadcrumbBar 6.0 qml/+Fusion/FolderBreadcrumbBar.qml
|
||||
FolderDialog 6.0 qml/+Fusion/FolderDialog.qml
|
||||
FolderDialogDelegate 6.0 qml/+Fusion/FolderDialogDelegate.qml
|
||||
FontDialog 6.0 qml/+Fusion/FontDialog.qml
|
||||
MessageDialog 6.0 qml/+Fusion/MessageDialog.qml
|
||||
SideBar 6.0 qml/+Fusion/SideBar.qml
|
||||
ColorDialog 6.0 qml/+Imagine/ColorDialog.qml
|
||||
ColorInputs 6.0 qml/+Imagine/ColorInputs.qml
|
||||
FileDialog 6.0 qml/+Imagine/FileDialog.qml
|
||||
FileDialogDelegate 6.0 qml/+Imagine/FileDialogDelegate.qml
|
||||
FolderBreadcrumbBar 6.0 qml/+Imagine/FolderBreadcrumbBar.qml
|
||||
FolderDialog 6.0 qml/+Imagine/FolderDialog.qml
|
||||
FolderDialogDelegate 6.0 qml/+Imagine/FolderDialogDelegate.qml
|
||||
FontDialog 6.0 qml/+Imagine/FontDialog.qml
|
||||
MessageDialog 6.0 qml/+Imagine/MessageDialog.qml
|
||||
SideBar 6.0 qml/+Imagine/SideBar.qml
|
||||
ColorDialog 6.0 qml/+Material/ColorDialog.qml
|
||||
ColorInputs 6.0 qml/+Material/ColorInputs.qml
|
||||
FileDialog 6.0 qml/+Material/FileDialog.qml
|
||||
FileDialogDelegate 6.0 qml/+Material/FileDialogDelegate.qml
|
||||
FolderBreadcrumbBar 6.0 qml/+Material/FolderBreadcrumbBar.qml
|
||||
FolderDialog 6.0 qml/+Material/FolderDialog.qml
|
||||
FolderDialogDelegate 6.0 qml/+Material/FolderDialogDelegate.qml
|
||||
FontDialog 6.0 qml/+Material/FontDialog.qml
|
||||
MessageDialog 6.0 qml/+Material/MessageDialog.qml
|
||||
SideBar 6.0 qml/+Material/SideBar.qml
|
||||
ColorInputs 6.0 qml/+Universal/ColorInputs.qml
|
||||
ColorDialog 6.0 qml/+Universal/ColorDialog.qml
|
||||
FileDialog 6.0 qml/+Universal/FileDialog.qml
|
||||
FileDialogDelegate 6.0 qml/+Universal/FileDialogDelegate.qml
|
||||
FolderBreadcrumbBar 6.0 qml/+Universal/FolderBreadcrumbBar.qml
|
||||
FolderDialog 6.0 qml/+Universal/FolderDialog.qml
|
||||
FolderDialogDelegate 6.0 qml/+Universal/FolderDialogDelegate.qml
|
||||
FontDialog 6.0 qml/+Universal/FontDialog.qml
|
||||
MessageDialog 6.0 qml/+Universal/MessageDialog.qml
|
||||
SideBar 6.0 qml/+Universal/SideBar.qml
|
||||
depends QtQuick
|
||||
|
||||
Reference in New Issue
Block a user