From c74ba841255404e265be74390cb8dce87bdbb44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9la=20Bajza?= Date: Thu, 2 Sep 2021 08:50:18 +0200 Subject: [PATCH 1/2] Added translation using Weblate (Hungarian) --- translations/hu_HU.ts | 74 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 translations/hu_HU.ts diff --git a/translations/hu_HU.ts b/translations/hu_HU.ts new file mode 100644 index 0000000..b7ce4df --- /dev/null +++ b/translations/hu_HU.ts @@ -0,0 +1,74 @@ + + + + + ExitPromptDialog + + + Process is running, are you sure you want to quit? + + + + + OK + + + + + Cancel + + + + + SettingsDialog + + + Font + + + + + Font Size + + + + + Transparency + + + + + Window Blur + + + + + Terminal + + + Copy + + + + + + Paste + + + + + Select All + + + + + Open File Manager + + + + + Settings + + + + From 9bff91ea9663e3ac7eb52db221625942e915d519 Mon Sep 17 00:00:00 2001 From: reionwong Date: Fri, 3 Sep 2021 00:20:32 +0800 Subject: [PATCH 2/2] Improve settings dialog --- src/qml/SettingsDialog.qml | 205 ++++++++++++------------------------- translations/en_US.ts | 13 ++- translations/zh_CN.ts | 13 ++- 3 files changed, 82 insertions(+), 149 deletions(-) diff --git a/src/qml/SettingsDialog.qml b/src/qml/SettingsDialog.qml index bb9c92e..100df2e 100644 --- a/src/qml/SettingsDialog.qml +++ b/src/qml/SettingsDialog.qml @@ -4,185 +4,108 @@ import QtQuick.Window 2.12 import QtQuick.Controls 2.12 import FishUI 1.0 as FishUI -FishUI.Window { +Window { id: control + title: qsTr("Settings") + width: 400 - height: 400 + height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 4 - maximumHeight: 400 + maximumHeight: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 4 maximumWidth: 400 minimumWidth: 400 - minimumHeight: 400 + minimumHeight: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 4 + + flags: Qt.Dialog + modality: Qt.WindowModal visible: false - ColumnLayout { - id: _mainLayout + Rectangle { anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing - anchors.rightMargin: FishUI.Units.largeSpacing - spacing: FishUI.Units.largeSpacing - - Item { - Layout.fillWidth: true - Layout.preferredHeight: 45 - - Rectangle { - anchors.fill: parent - color: FishUI.Theme.secondBackgroundColor - radius: FishUI.Theme.smallRadius - } - - RowLayout { - anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing - anchors.rightMargin: FishUI.Units.largeSpacing - - Label { - text: qsTr("Font") - } - - Item { - width: FishUI.Units.largeSpacing - } - - ComboBox { - id: fontsCombobox - model: Fonts.families - Layout.fillHeight: true - Layout.fillWidth: true + color: FishUI.Theme.secondBackgroundColor + } - onCurrentTextChanged: { - settings.fontName = currentText - } + GridLayout { + id: _mainLayout + anchors.fill: parent + anchors.margins: FishUI.Units.largeSpacing + columns: 2 + columnSpacing: FishUI.Units.largeSpacing * 2 + rowSpacing: FishUI.Units.largeSpacing * 2 - Component.onCompleted: { - for (var i = 0; i <= fontsCombobox.model.length; ++i) { - if (fontsCombobox.model[i] === settings.fontName) { - fontsCombobox.currentIndex = i - break - } - } - } - } - } + Label { + text: qsTr("Font") } - // Font size - Item { + ComboBox { + id: fontsCombobox + model: Fonts.families + // Layout.fillHeight: true Layout.fillWidth: true - Layout.preferredHeight: 45 - Rectangle { - anchors.fill: parent - color: FishUI.Theme.secondBackgroundColor - radius: FishUI.Theme.smallRadius + onCurrentTextChanged: { + settings.fontName = currentText } - RowLayout { - anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing - anchors.rightMargin: FishUI.Units.largeSpacing - - Label { - text: qsTr("Font Size") - } - - Item { - width: FishUI.Units.largeSpacing - } - - Slider { - id: fontSizeSlider - Layout.fillHeight: true - Layout.fillWidth: true - from: 5 - to: 30 - stepSize: 1 - - Component.onCompleted: { - fontSizeSlider.value = settings.fontPointSize + Component.onCompleted: { + for (var i = 0; i <= fontsCombobox.model.length; ++i) { + if (fontsCombobox.model[i] === settings.fontName) { + fontsCombobox.currentIndex = i + break } - - onValueChanged: settings.fontPointSize = fontSizeSlider.value } } } - Item { + Label { + text: qsTr("Font Size") + } + + Slider { + id: fontSizeSlider + Layout.fillHeight: true Layout.fillWidth: true - Layout.preferredHeight: 45 + from: 5 + to: 30 + stepSize: 1 - Rectangle { - anchors.fill: parent - color: FishUI.Theme.secondBackgroundColor - radius: FishUI.Theme.smallRadius + Component.onCompleted: { + fontSizeSlider.value = settings.fontPointSize } - RowLayout { - anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing - anchors.rightMargin: FishUI.Units.largeSpacing - - Label { - text: qsTr("Transparency") - } - - Item { - width: FishUI.Units.largeSpacing - } - - Slider { - id: transparencySlider - Layout.fillHeight: true - Layout.fillWidth: true - from: 0.1 - to: 1.0 - stepSize: 0.05 - - Component.onCompleted: { - transparencySlider.value = settings.opacity - } + onValueChanged: settings.fontPointSize = fontSizeSlider.value + } - onValueChanged: settings.opacity = transparencySlider.value - } - } + Label { + text: qsTr("Transparency") } - Item { + Slider { + id: transparencySlider + Layout.fillHeight: true Layout.fillWidth: true - Layout.preferredHeight: 45 + from: 0.1 + to: 1.0 + stepSize: 0.05 - Rectangle { - anchors.fill: parent - color: FishUI.Theme.secondBackgroundColor - radius: FishUI.Theme.smallRadius + Component.onCompleted: { + transparencySlider.value = settings.opacity } - RowLayout { - anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing - anchors.rightMargin: FishUI.Units.smallSpacing - - Label { - text: qsTr("Window Blur") - } - - Item { - Layout.fillWidth: true - } + onValueChanged: settings.opacity = transparencySlider.value + } - Switch { - Layout.fillHeight: true - checked: settings.blur - onCheckedChanged: settings.blur = checked - } - } + Label { + text: qsTr("Window Blur") } - Item { + Switch { + Layout.alignment: Qt.AlignRight Layout.fillHeight: true + checked: settings.blur + onCheckedChanged: settings.blur = checked } } } diff --git a/translations/en_US.ts b/translations/en_US.ts index 97ec77e..2c88838 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -22,22 +22,27 @@ SettingsDialog - + + Settings + + + + Font - + Font Size - + Transparency - + Window Blur diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 781577f..0c958dc 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -22,22 +22,27 @@ SettingsDialog - + + Settings + 设置 + + + Font 字体 - + Font Size 字体大小 - + Transparency 透明度 - + Window Blur 窗口模糊