diff --git a/qml/SettingsDialog.qml b/qml/SettingsDialog.qml index 7b9d7753..eaab2c64 100644 --- a/qml/SettingsDialog.qml +++ b/qml/SettingsDialog.qml @@ -67,28 +67,27 @@ The prompt below is a question to answer, a task to complete, or a conversation property string modelPath: settingsDialog.defaultModelPath } - function restoreGenerationDefaults() { - settings.temperature = defaultTemperature; - settings.topP = defaultTopP; - settings.topK = defaultTopK; - settings.maxLength = defaultMaxLength; - settings.promptBatchSize = defaultPromptBatchSize; - settings.promptTemplate = defaultPromptTemplate; + settings.temperature = defaultTemperature + settings.topP = defaultTopP + settings.topK = defaultTopK + settings.maxLength = defaultMaxLength + settings.promptBatchSize = defaultPromptBatchSize + settings.promptTemplate = defaultPromptTemplate settings.sync() } function restoreApplicationDefaults() { - settings.modelPath = settingsDialog.defaultModelPath; + settings.modelPath = settingsDialog.defaultModelPath settings.threadCount = defaultThreadCount - Download.downloadLocalModelsPath = settings.modelPath; - LLM.threadCount = settings.threadCount; + Download.downloadLocalModelsPath = settings.modelPath + LLM.threadCount = settings.threadCount settings.sync() } Component.onCompleted: { - LLM.threadCount = settings.threadCount; - Download.downloadLocalModelsPath = settings.modelPath; + LLM.threadCount = settings.threadCount + Download.downloadLocalModelsPath = settings.modelPath } Component.onDestruction: { @@ -102,16 +101,41 @@ The prompt below is a question to answer, a task to complete, or a conversation } TabBar { id: settingsTabBar - width: parent.width + width: parent.width / 1.5 + TabButton { - text: qsTr("Generation") + id: genSettingsButton + contentItem: IconLabel { + color: theme.textColor + font.bold: genSettingsButton.checked + font.pixelSize: genSettingsButton.checked ? theme.fontSizeLarger : theme.fontSizeLarge + text: qsTr("Generation") + } + background: Rectangle { + color: genSettingsButton.checked ? theme.backgroundDarkest : theme.backgroundLight + radius: 5 + border.color: "#fff" + border.width: 1 ? genSettingsButton.checked : 0 + } Accessible.role: Accessible.Button Accessible.name: qsTr("Generation settings") Accessible.description: qsTr("Settings related to how the model generates text") } TabButton { - text: qsTr("Application") + id: appSettingsButton + contentItem: IconLabel { + color: theme.textColor + font.bold: appSettingsButton.checked + font.pixelSize: appSettingsButton.checked ? theme.fontSizeLarger : theme.fontSizeLarge + text: qsTr("Application") + } + background: Rectangle { + color: appSettingsButton.checked ? theme.backgroundDarkest : theme.backgroundLight + radius: 2 + border.color: "#fff" + border.width: 1 ? appSettingsButton.checked : 0 + } Accessible.role: Accessible.Button Accessible.name: qsTr("Application settings") Accessible.description: qsTr("Settings related to general behavior of the application") @@ -120,443 +144,504 @@ The prompt below is a question to answer, a task to complete, or a conversation StackLayout { anchors.top: settingsTabBar.bottom - anchors.bottom: parent.bottom width: parent.width + height: availableHeight currentIndex: settingsTabBar.currentIndex + Item { id: generationSettingsTab - GridLayout { - columns: 2 - rowSpacing: 2 - columnSpacing: 10 - anchors.fill: parent - - Label { - id: tempLabel - text: qsTr("Temperature:") - color: theme.textColor - Layout.row: 0 - Layout.column: 0 + ScrollView { + background: Rectangle { + color: 'transparent' + border.color: theme.tabBorder + border.width: 1 + radius: 2 } - TextField { - text: settings.temperature.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 + width: parent.width + height: parent.height - 30 + contentWidth: availableWidth - 20 + contentHeight: generationSettingsTabInner.implicitHeight + 40 + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + GridLayout { + id: generationSettingsTabInner + anchors.margins: 10 + columns: 2 + rowSpacing: 10 + columnSpacing: 10 + anchors.fill: parent + + Label { + id: tempLabel + text: qsTr("Temperature:") + color: theme.textColor + Layout.row: 0 + Layout.column: 0 } - padding: 10 - ToolTip.text: qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs") - ToolTip.visible: hovered - Layout.row: 0 - Layout.column: 1 - validator: DoubleValidator { } - onEditingFinished: { - var val = parseFloat(text) - if (!isNaN(val)) { - settings.temperature = val - settings.sync() - focus = false - } else { - text = settings.temperature.toString() + TextField { + text: settings.temperature.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 } - } - Accessible.role: Accessible.EditableText - Accessible.name: tempLabel.text - Accessible.description: ToolTip.text - } - Label { - id: topPLabel - text: qsTr("Top P:") - color: theme.textColor - Layout.row: 1 - Layout.column: 0 - } - TextField { - text: settings.topP.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Only the most likely tokens up to a total probability of top_p can be chosen, prevents choosing highly unlikely tokens, aka Nucleus Sampling") - ToolTip.visible: hovered - Layout.row: 1 - Layout.column: 1 - validator: DoubleValidator {} - onEditingFinished: { - var val = parseFloat(text) - if (!isNaN(val)) { - settings.topP = val - settings.sync() - focus = false - } else { - text = settings.topP.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: topPLabel.text - Accessible.description: ToolTip.text - } - Label { - id: topKLabel - text: qsTr("Top K:") - color: theme.textColor - Layout.row: 2 - Layout.column: 0 - } - TextField { - text: settings.topK.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Only the top K most likely tokens will be chosen from") - ToolTip.visible: hovered - Layout.row: 2 - Layout.column: 1 - validator: IntValidator { bottom: 1 } - onEditingFinished: { - var val = parseInt(text) - if (!isNaN(val)) { - settings.topK = val - settings.sync() - focus = false - } else { - text = settings.topK.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: topKLabel.text - Accessible.description: ToolTip.text - } - Label { - id: maxLengthLabel - text: qsTr("Max Length:") - color: theme.textColor - Layout.row: 3 - Layout.column: 0 - } - TextField { - text: settings.maxLength.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Maximum length of response in tokens") - ToolTip.visible: hovered - Layout.row: 3 - Layout.column: 1 - validator: IntValidator { bottom: 1 } - onEditingFinished: { - var val = parseInt(text) - if (!isNaN(val)) { - settings.maxLength = val - settings.sync() - focus = false - } else { - text = settings.maxLength.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: maxLengthLabel.text - Accessible.description: ToolTip.text - } - - Label { - id: batchSizeLabel - text: qsTr("Prompt Batch Size:") - color: theme.textColor - Layout.row: 4 - Layout.column: 0 - } - TextField { - text: settings.promptBatchSize.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Amount of prompt tokens to process at once, higher values can speed up reading prompts but will use more RAM") - ToolTip.visible: hovered - Layout.row: 4 - Layout.column: 1 - validator: IntValidator { bottom: 1 } - onEditingFinished: { - var val = parseInt(text) - if (!isNaN(val)) { - settings.promptBatchSize = val - settings.sync() - focus = false - } else { - text = settings.promptBatchSize.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: batchSizeLabel.text - Accessible.description: ToolTip.text - } - Label { - id: repeatPenaltyLabel - text: qsTr("Repeat Penalty:") - color: theme.textColor - Layout.row: 5 - Layout.column: 0 - } - TextField { - text: settings.repeatPenalty.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Amount to penalize reptetitiveness of the output") - ToolTip.visible: hovered - Layout.row: 5 - Layout.column: 1 - validator: DoubleValidator {} - onEditingFinished: { - var val = parseFloat(text) - if (!isNaN(val)) { - settings.repeatPenalty = val - settings.sync() - focus = false - } else { - text = settings.repeatPenalty.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: repeatPenaltyLabel.text - Accessible.description: ToolTip.text - } - Label { - id: repeatPenaltyTokensLabel - text: qsTr("Repeat Penalty Tokens:") - color: theme.textColor - Layout.row: 6 - Layout.column: 0 - } - TextField { - text: settings.repeatPenaltyTokens.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("How far back in output to apply repeat penalty") - ToolTip.visible: hovered - Layout.row: 6 - Layout.column: 1 - validator: IntValidator { bottom: 1 } - onEditingFinished: { - var val = parseInt(text) - if (!isNaN(val)) { - settings.repeatPenaltyTokens = val - settings.sync() - focus = false - } else { - text = settings.repeatPenaltyTokens.toString() - } - } - Accessible.role: Accessible.EditableText - Accessible.name: repeatPenaltyTokensLabel.text - Accessible.description: ToolTip.text - } - - Label { - id: promptTemplateLabel - text: qsTr("Prompt Template:") - color: theme.textColor - Layout.row: 7 - Layout.column: 0 - } - Rectangle { - Layout.row: 7 - Layout.column: 1 - Layout.fillWidth: true - height: 200 - color: "transparent" - clip: true - Label { - id: promptTemplateLabelHelp - visible: settings.promptTemplate.indexOf("%1") === -1 - font.bold: true - color: theme.textErrorColor - text: qsTr("Prompt template must contain %1 to be replaced with the user's input.") - anchors.fill: templateScrollView - z: 200 padding: 10 - wrapMode: TextArea.Wrap + ToolTip.text: qsTr("Temperature increases the chances of choosing less likely tokens - higher temperature gives more creative but less predictable outputs") + ToolTip.visible: hovered + Layout.row: 0 + Layout.column: 1 + validator: DoubleValidator {} + onEditingFinished: { + var val = parseFloat(text) + if (!isNaN(val)) { + settings.temperature = val + settings.sync() + focus = false + } else { + text = settings.temperature.toString() + } + } Accessible.role: Accessible.EditableText - Accessible.name: text - } - ScrollView { - id: templateScrollView - anchors.fill: parent - TextArea { - text: settings.promptTemplate - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - wrapMode: TextArea.Wrap - onTextChanged: { - settings.promptTemplate = text - settings.sync() - } - bottomPadding: 10 - Accessible.role: Accessible.EditableText - Accessible.name: promptTemplateLabel.text - Accessible.description: promptTemplateLabelHelp.text - } - } - } - Button { - Layout.row: 8 - Layout.column: 1 - Layout.fillWidth: true - padding: 15 - contentItem: Text { - text: qsTr("Restore Defaults") - horizontalAlignment: Text.AlignHCenter - color: theme.textColor - Accessible.role: Accessible.Button - Accessible.name: text - Accessible.description: qsTr("Restores the settings dialog to a default state") - } + Accessible.name: tempLabel.text + Accessible.description: ToolTip.text + } + Label { + id: topPLabel + text: qsTr("Top P:") + color: theme.textColor + Layout.row: 1 + Layout.column: 0 + } + TextField { + text: settings.topP.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Only the most likely tokens up to a total probability of top_p can be chosen, prevents choosing highly unlikely tokens, aka Nucleus Sampling") + ToolTip.visible: hovered + Layout.row: 1 + Layout.column: 1 + validator: DoubleValidator {} + onEditingFinished: { + var val = parseFloat(text) + if (!isNaN(val)) { + settings.topP = val + settings.sync() + focus = false + } else { + text = settings.topP.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: topPLabel.text + Accessible.description: ToolTip.text + } + Label { + id: topKLabel + text: qsTr("Top K:") + color: theme.textColor + Layout.row: 2 + Layout.column: 0 + } + TextField { + text: settings.topK.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Only the top K most likely tokens will be chosen from") + ToolTip.visible: hovered + Layout.row: 2 + Layout.column: 1 + validator: IntValidator { + bottom: 1 + } + onEditingFinished: { + var val = parseInt(text) + if (!isNaN(val)) { + settings.topK = val + settings.sync() + focus = false + } else { + text = settings.topK.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: topKLabel.text + Accessible.description: ToolTip.text + } + Label { + id: maxLengthLabel + text: qsTr("Max Length:") + color: theme.textColor + Layout.row: 3 + Layout.column: 0 + } + TextField { + text: settings.maxLength.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Maximum length of response in tokens") + ToolTip.visible: hovered + Layout.row: 3 + Layout.column: 1 + validator: IntValidator { + bottom: 1 + } + onEditingFinished: { + var val = parseInt(text) + if (!isNaN(val)) { + settings.maxLength = val + settings.sync() + focus = false + } else { + text = settings.maxLength.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: maxLengthLabel.text + Accessible.description: ToolTip.text + } - background: Rectangle { - opacity: .5 - border.color: theme.backgroundLightest - border.width: 1 - radius: 10 - color: theme.backgroundLight - } - onClicked: { - settingsDialog.restoreGenerationDefaults() - } - } + Label { + id: batchSizeLabel + text: qsTr("Prompt Batch Size:") + color: theme.textColor + Layout.row: 4 + Layout.column: 0 + } + TextField { + text: settings.promptBatchSize.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Amount of prompt tokens to process at once, higher values can speed up reading prompts but will use more RAM") + ToolTip.visible: hovered + Layout.row: 4 + Layout.column: 1 + validator: IntValidator { + bottom: 1 + } + onEditingFinished: { + var val = parseInt(text) + if (!isNaN(val)) { + settings.promptBatchSize = val + settings.sync() + focus = false + } else { + text = settings.promptBatchSize.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: batchSizeLabel.text + Accessible.description: ToolTip.text + } + Label { + id: repeatPenaltyLabel + text: qsTr("Repeat Penalty:") + color: theme.textColor + Layout.row: 5 + Layout.column: 0 + } + TextField { + text: settings.repeatPenalty.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Amount to penalize reptetitiveness of the output") + ToolTip.visible: hovered + Layout.row: 5 + Layout.column: 1 + validator: DoubleValidator {} + onEditingFinished: { + var val = parseFloat(text) + if (!isNaN(val)) { + settings.repeatPenalty = val + settings.sync() + focus = false + } else { + text = settings.repeatPenalty.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: repeatPenaltyLabel.text + Accessible.description: ToolTip.text + } + Label { + id: repeatPenaltyTokensLabel + text: qsTr("Repeat Penalty Tokens:") + color: theme.textColor + Layout.row: 6 + Layout.column: 0 + } + TextField { + text: settings.repeatPenaltyTokens.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("How far back in output to apply repeat penalty") + ToolTip.visible: hovered + Layout.row: 6 + Layout.column: 1 + validator: IntValidator { + bottom: 1 + } + onEditingFinished: { + var val = parseInt(text) + if (!isNaN(val)) { + settings.repeatPenaltyTokens = val + settings.sync() + focus = false + } else { + text = settings.repeatPenaltyTokens.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: repeatPenaltyTokensLabel.text + Accessible.description: ToolTip.text + } + + Label { + id: promptTemplateLabel + text: qsTr("Prompt Template:") + color: theme.textColor + Layout.row: 7 + Layout.column: 0 + } + Rectangle { + Layout.row: 7 + Layout.column: 1 + Layout.fillWidth: true + height: 200 + color: "transparent" + clip: true + Label { + id: promptTemplateLabelHelp + visible: settings.promptTemplate.indexOf( + "%1") === -1 + font.bold: true + color: theme.textErrorColor + text: qsTr("Prompt template must contain %1 to be replaced with the user's input.") + anchors.fill: templateScrollView + z: 200 + padding: 10 + wrapMode: TextArea.Wrap + Accessible.role: Accessible.EditableText + Accessible.name: text + } + ScrollView { + id: templateScrollView + anchors.fill: parent + TextArea { + text: settings.promptTemplate + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + wrapMode: TextArea.Wrap + onTextChanged: { + settings.promptTemplate = text + settings.sync() + } + bottomPadding: 10 + Accessible.role: Accessible.EditableText + Accessible.name: promptTemplateLabel.text + Accessible.description: promptTemplateLabelHelp.text + } + } + } + Button { + Layout.row: 8 + Layout.column: 1 + Layout.fillWidth: true + padding: 15 + contentItem: Text { + text: qsTr("Restore Defaults") + horizontalAlignment: Text.AlignHCenter + color: theme.textColor + Accessible.role: Accessible.Button + Accessible.name: text + Accessible.description: qsTr("Restores the settings dialog to a default state") + } + + background: Rectangle { + opacity: .5 + border.color: theme.backgroundLightest + border.width: 1 + radius: 10 + color: theme.backgroundLight + } + onClicked: { + settingsDialog.restoreGenerationDefaults() + } + } + } } } Item { - id: systemSettingsTab - GridLayout { - columns: 3 - rowSpacing: 2 - columnSpacing: 10 + id: applicationSettingsTab + ScrollView { + background: Rectangle { + color: 'transparent' + border.color: theme.tabBorder + border.width: 1 + radius: 2 + } width: parent.width - anchors.top: parent.top - FolderDialog { - id: modelPathDialog - title: "Please choose a directory" - onAccepted: { - Download.downloadLocalModelsPath = selectedFolder - settings.modelPath = Download.downloadLocalModelsPath - settings.sync() - } - } - Label { - id: modelPathLabel - text: qsTr("Model file path:") - color: theme.textColor - Layout.row: 1 - Layout.column: 0 - } - TextField { - id: modelPathDisplayLabel - text: settings.modelPath - color: theme.textColor - readOnly: true - Layout.row: 1 - Layout.column: 1 - } - Button { - Layout.row: 1 - Layout.column: 2 - text: qsTr("Browse") - onClicked: modelPathDialog.open() - } - Label { - id: nThreadsLabel - text: qsTr("CPU Threads:") - color: theme.textColor - Layout.row: 2 - Layout.column: 0 - } - TextField { - text: settingsDialog.threadCount.toString() - color: theme.textColor - background: Rectangle { - implicitWidth: 150 - color: theme.backgroundLighter - radius: 10 - } - padding: 10 - ToolTip.text: qsTr("Amount of processing threads to use, a setting of 0 will use the lesser of 4 or your number of CPU threads") - ToolTip.visible: hovered - Layout.row: 2 - Layout.column: 1 - validator: IntValidator { bottom: 1 } - onEditingFinished: { - var val = parseInt(text) - if (!isNaN(val)) { - settingsDialog.threadCount = val - LLM.threadCount = val + height: parent.height - 30 + contentWidth: availableWidth - 20 + ScrollBar.vertical.policy: ScrollBar.AlwaysOn + + GridLayout { + anchors.margins: 10 + columns: 3 + rowSpacing: 10 + columnSpacing: 10 + anchors.fill: parent + FolderDialog { + id: modelPathDialog + title: "Please choose a directory" + onAccepted: { + Download.downloadLocalModelsPath = selectedFolder + settings.modelPath = Download.downloadLocalModelsPath settings.sync() - focus = false - } else { - text = settingsDialog.threadCount.toString() } } - Accessible.role: Accessible.EditableText - Accessible.name: nThreadsLabel.text - Accessible.description: ToolTip.text - } - Button { - Layout.row: 3 - Layout.column: 1 - Layout.fillWidth: true - padding: 15 - contentItem: Text { - text: qsTr("Restore Defaults") - horizontalAlignment: Text.AlignHCenter + Label { + id: modelPathLabel + text: qsTr("Model file path:") color: theme.textColor - Accessible.role: Accessible.Button - Accessible.name: text - Accessible.description: qsTr("Restores the settings dialog to a default state") + Layout.row: 1 + Layout.column: 0 } + TextField { + id: modelPathDisplayLabel + text: settings.modelPath + readOnly: true + color: theme.textColor + implicitWidth: 300 + Layout.row: 1 + Layout.column: 1 + ToolTip.text: qsTr("Path where model files will be downloaded to") + ToolTip.visible: hovered + Accessible.role: Accessible.ToolTip + Accessible.name: topKLabel.text + Accessible.description: ToolTip.text + } + Button { + Layout.row: 1 + Layout.column: 2 + text: qsTr("Browse") + contentItem: Text { + text: qsTr("Browse") + horizontalAlignment: Text.AlignHCenter + color: theme.textColor + Accessible.role: Accessible.Button + Accessible.name: text + Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files") + } + background: Rectangle { + opacity: .5 + border.color: theme.backgroundLightest + border.width: 1 + radius: 10 + color: theme.backgroundLight + } + onClicked: modelPathDialog.open() + } + Label { + id: nThreadsLabel + text: qsTr("CPU Threads:") + color: theme.textColor + Layout.row: 2 + Layout.column: 0 + } + TextField { + text: settingsDialog.threadCount.toString() + color: theme.textColor + background: Rectangle { + implicitWidth: 150 + color: theme.backgroundLighter + radius: 10 + } + padding: 10 + ToolTip.text: qsTr("Amount of processing threads to use, a setting of 0 will use the lesser of 4 or your number of CPU threads") + ToolTip.visible: hovered + Layout.row: 2 + Layout.column: 1 + validator: IntValidator { + bottom: 1 + } + onEditingFinished: { + var val = parseInt(text) + if (!isNaN(val)) { + settingsDialog.threadCount = val + LLM.threadCount = val + settings.sync() + focus = false + } else { + text = settingsDialog.threadCount.toString() + } + } + Accessible.role: Accessible.EditableText + Accessible.name: nThreadsLabel.text + Accessible.description: ToolTip.text + } + Button { + Layout.row: 3 + Layout.column: 1 + Layout.fillWidth: true + padding: 15 + contentItem: Text { + text: qsTr("Restore Defaults") + horizontalAlignment: Text.AlignHCenter + color: theme.textColor + Accessible.role: Accessible.Button + Accessible.name: text + Accessible.description: qsTr("Restores the settings dialog to a default state") + } - background: Rectangle { - opacity: .5 - border.color: theme.backgroundLightest - border.width: 1 - radius: 10 - color: theme.backgroundLight - } - onClicked: { - settingsDialog.restoreApplicationDefaults() + background: Rectangle { + opacity: .5 + border.color: theme.backgroundLightest + border.width: 1 + radius: 10 + color: theme.backgroundLight + } + onClicked: { + settingsDialog.restoreApplicationDefaults() + } } } } } } - } diff --git a/qml/Theme.qml b/qml/Theme.qml index 23a7ef9c..1da6adbc 100644 --- a/qml/Theme.qml +++ b/qml/Theme.qml @@ -14,5 +14,7 @@ QtObject { property color userColor: "#ec86bf" property color assistantColor: "#10a37f" property color linkColor: "white" + property color tabBorder: "#ddd" property real fontSizeLarge: Qt.application.font.pixelSize + property real fontSizeLarger: Qt.application.font.pixelSize + 2 }