summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
committerNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
commit3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch)
treec5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml
parent56616f693b4f263cbf0d47da43b67424efa6022d (diff)
downloadRaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz
RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml')
-rw-r--r--raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml74
1 files changed, 74 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml b/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml
new file mode 100644
index 0000000..6360c7f
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/dms/Modals/FileBrowser/FileBrowserSaveRow.qml
@@ -0,0 +1,74 @@
+import QtQuick
+import qs.Common
+import qs.Widgets
+
+Row {
+ id: saveRow
+
+ property bool saveMode: false
+ property string defaultFileName: ""
+ property string currentPath: ""
+
+ signal saveRequested(string filePath)
+
+ height: saveMode ? 40 : 0
+ visible: saveMode
+ spacing: Theme.spacingM
+
+ DankTextField {
+ id: fileNameInput
+
+ width: parent.width - saveButton.width - Theme.spacingM
+ height: 40
+ text: defaultFileName
+ placeholderText: I18n.tr("Enter filename...")
+ ignoreLeftRightKeys: false
+ focus: saveMode
+ topPadding: Theme.spacingS
+ bottomPadding: Theme.spacingS
+ Component.onCompleted: {
+ if (saveMode)
+ Qt.callLater(() => {
+ forceActiveFocus()
+ })
+ }
+ onAccepted: {
+ if (text.trim() !== "") {
+ var basePath = currentPath.replace(/^file:\/\//, '')
+ var fullPath = basePath + "/" + text.trim()
+ fullPath = fullPath.replace(/\/+/g, '/')
+ saveRequested(fullPath)
+ }
+ }
+ }
+
+ StyledRect {
+ id: saveButton
+
+ width: 80
+ height: 40
+ color: fileNameInput.text.trim() !== "" ? Theme.primary : Theme.surfaceVariant
+ radius: Theme.cornerRadius
+
+ StyledText {
+ anchors.centerIn: parent
+ text: I18n.tr("Save")
+ color: fileNameInput.text.trim() !== "" ? Theme.primaryText : Theme.surfaceVariantText
+ font.pixelSize: Theme.fontSizeMedium
+ }
+
+ StateLayer {
+ stateColor: Theme.primary
+ cornerRadius: Theme.cornerRadius
+ enabled: fileNameInput.text.trim() !== ""
+ onClicked: {
+ if (fileNameInput.text.trim() !== "") {
+ var basePath = currentPath.replace(/^file:\/\//, '')
+ var fullPath = basePath + "/" + fileNameInput.text.trim()
+ fullPath = fullPath.replace(/\/+/g, '/')
+ saveRequested(fullPath)
+ }
+ }
+ }
+ }
+}