Add .config/DankMaterialShell/plugin_settings.json Add .config/DankMaterialShell/plugins/calculator/CalculatorLauncher.qml Add .config/DankMaterialShell/plugins/calculator/CalculatorSettings.qml Add .config/DankMaterialShell/plugins/calculator/README.md Add .config/DankMaterialShell/plugins/calculator/calculator.js Add .config/DankMaterialShell/plugins/calculator/.git/HEAD Add .config/DankMaterialShell/plugins/calculator/.git/config Add .config/DankMaterialShell/plugins/calculator/.git/index Add .config/DankMaterialShell/plugins/calculator/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.idx Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.rev Add .config/DankMaterialShell/plugins/calculator/.git/objects/pack/pack-67f644835e660794f65c9273e46788b0c3da57cf.pack Add .config/DankMaterialShell/plugins/calculator/.git/refs/heads/main Add .config/DankMaterialShell/plugins/calculator/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/calculator/.git/refs/remotes/origin/qalc Add .config/DankMaterialShell/plugins/calculator/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/calculator/plugin.json Add .config/DankMaterialShell/plugins/calculator/screenshot.png Add .config/DankMaterialShell/plugins/calculator/test_precision.js Add .config/DankMaterialShell/plugins/calculator/test_single.js Add .config/DankMaterialShell/plugins/commandRunner/CommandRunner.qml Add .config/DankMaterialShell/plugins/commandRunner/CommandRunnerSettings.qml Add .config/DankMaterialShell/plugins/commandRunner/LICENSE Add .config/DankMaterialShell/plugins/commandRunner/README.md Add .config/DankMaterialShell/plugins/commandRunner/.git/HEAD Add .config/DankMaterialShell/plugins/commandRunner/.git/config Add .config/DankMaterialShell/plugins/commandRunner/.git/index Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.idx Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.rev Add .config/DankMaterialShell/plugins/commandRunner/.git/objects/pack/pack-5a720f795fd2994ef506cd867d86ca7df8a25a31.pack Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/heads/main Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/commandRunner/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/commandRunner/plugin.json Add .config/DankMaterialShell/plugins/commandRunner/screenshot.png Add .config/DankMaterialShell/plugins/dankActions.meta Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/DankActionsSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/DankActionsWidget.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankActions/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/DankBatteryAlerts.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/DankBatteryAlertsSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankBatteryAlerts/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/DankHooks.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/DankHooksSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/README.md Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankHooks/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/DankPomodoroSettings.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/DankPomodoroWidget.qml Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/DankPomodoroTimer/plugin.json Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/LICENSE Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/README.md Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/HEAD Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/config Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/index Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.idx Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.rev Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/objects/pack/pack-3221a15c022ef4a7bb6bf2c47e40068b66b3588b.pack Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/heads/master Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/remotes/origin/master Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/.repos/0026f1eba8dedaec/.gitignore Add .config/DankMaterialShell/plugins/emojiLauncher/EmojiLauncher.qml Add .config/DankMaterialShell/plugins/emojiLauncher/EmojiLauncherSettings.qml Add .config/DankMaterialShell/plugins/emojiLauncher/LICENSE Add .config/DankMaterialShell/plugins/emojiLauncher/README.md Add .config/DankMaterialShell/plugins/emojiLauncher/catalog.js Add .config/DankMaterialShell/plugins/emojiLauncher/data/emojis.txt Add .config/DankMaterialShell/plugins/emojiLauncher/data/math.txt Add .config/DankMaterialShell/plugins/emojiLauncher/data/nerdfont.txt Add .config/DankMaterialShell/plugins/emojiLauncher/.git/HEAD Add .config/DankMaterialShell/plugins/emojiLauncher/.git/config Add .config/DankMaterialShell/plugins/emojiLauncher/.git/index Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.idx Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.rev Add .config/DankMaterialShell/plugins/emojiLauncher/.git/objects/pack/pack-e04a5b1ea381dc3a792b8bf08cf70e735b195c0d.pack Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/heads/main Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/emojiLauncher/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/emojiLauncher/plugin.json Add .config/DankMaterialShell/plugins/emojiLauncher/screenshot.png Add .config/DankMaterialShell/plugins/emojiLauncher/scripts/generate_catalog.py Add .config/DankMaterialShell/plugins/dankActions Add .config/DankMaterialShell/plugins/webSearch/LICENSE Add .config/DankMaterialShell/plugins/webSearch/README.md Add .config/DankMaterialShell/plugins/webSearch/WebSearch.qml Add .config/DankMaterialShell/plugins/webSearch/WebSearchSettings.qml Add .config/DankMaterialShell/plugins/webSearch/.git/HEAD Add .config/DankMaterialShell/plugins/webSearch/.git/config Add .config/DankMaterialShell/plugins/webSearch/.git/index Add .config/DankMaterialShell/plugins/webSearch/.git/objects/info/.keep Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.idx Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.rev Add .config/DankMaterialShell/plugins/webSearch/.git/objects/pack/pack-6a60c736f418e5b4b1f0505f66c1e2a371d46fed.pack Add .config/DankMaterialShell/plugins/webSearch/.git/refs/heads/main Add .config/DankMaterialShell/plugins/webSearch/.git/refs/remotes/origin/main Add .config/DankMaterialShell/plugins/webSearch/.git/refs/tags/.keep Add .config/DankMaterialShell/plugins/webSearch/plugin.json Add .config/DankMaterialShell/plugins/webSearch/screenshot.png Add .config/DankMaterialShell/settings.json
275 lines
8 KiB
QML
275 lines
8 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import qs.Widgets
|
|
|
|
FocusScope {
|
|
id: root
|
|
|
|
property var pluginService: null
|
|
|
|
implicitHeight: settingsColumn.implicitHeight
|
|
height: implicitHeight
|
|
|
|
Column {
|
|
id: settingsColumn
|
|
anchors.fill: parent
|
|
anchors.margins: 16
|
|
spacing: 16
|
|
|
|
Text {
|
|
text: "Calculator Plugin Settings"
|
|
font.pixelSize: 18
|
|
font.weight: Font.Bold
|
|
color: "#FFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "This plugin evaluates mathematical expressions and copies the result to your clipboard."
|
|
font.pixelSize: 14
|
|
color: "#CCFFFFFF"
|
|
wrapMode: Text.WordWrap
|
|
width: parent.width - 32
|
|
}
|
|
|
|
Rectangle {
|
|
width: parent.width - 32
|
|
height: 1
|
|
color: "#30FFFFFF"
|
|
}
|
|
|
|
Column {
|
|
spacing: 12
|
|
width: parent.width - 32
|
|
|
|
Text {
|
|
text: "Trigger Configuration"
|
|
font.pixelSize: 16
|
|
font.weight: Font.Medium
|
|
color: "#FFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: noTriggerToggle.checked ? "Calculator is always active. Simply type a math expression like '3 + 3' in the launcher." : "Set a trigger prefix to activate the calculator. Type the trigger before your expression."
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
wrapMode: Text.WordWrap
|
|
width: parent.width
|
|
}
|
|
|
|
Row {
|
|
spacing: 12
|
|
|
|
CheckBox {
|
|
id: noTriggerToggle
|
|
text: "No trigger (always active)"
|
|
checked: loadSettings("noTrigger", false)
|
|
|
|
contentItem: Text {
|
|
text: noTriggerToggle.text
|
|
font.pixelSize: 14
|
|
color: "#FFFFFF"
|
|
leftPadding: noTriggerToggle.indicator.width + 8
|
|
verticalAlignment: Text.AlignVCenter
|
|
}
|
|
|
|
indicator: Rectangle {
|
|
implicitWidth: 20
|
|
implicitHeight: 20
|
|
radius: 4
|
|
border.color: noTriggerToggle.checked ? "#4CAF50" : "#60FFFFFF"
|
|
border.width: 2
|
|
color: noTriggerToggle.checked ? "#4CAF50" : "transparent"
|
|
|
|
Rectangle {
|
|
width: 12
|
|
height: 12
|
|
anchors.centerIn: parent
|
|
radius: 2
|
|
color: "#FFFFFF"
|
|
visible: noTriggerToggle.checked
|
|
}
|
|
}
|
|
|
|
onCheckedChanged: {
|
|
saveSettings("noTrigger", checked)
|
|
if (checked) {
|
|
saveSettings("trigger", "")
|
|
} else {
|
|
const currentTrigger = triggerField.text || "="
|
|
saveSettings("trigger", currentTrigger)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Row {
|
|
spacing: 12
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
visible: !noTriggerToggle.checked
|
|
|
|
Text {
|
|
text: "Trigger:"
|
|
font.pixelSize: 14
|
|
color: "#FFFFFF"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
|
|
DankTextField {
|
|
id: triggerField
|
|
width: 100
|
|
height: 40
|
|
text: loadSettings("trigger", "=")
|
|
placeholderText: "="
|
|
backgroundColor: "#30FFFFFF"
|
|
textColor: "#FFFFFF"
|
|
|
|
onTextEdited: {
|
|
const newTrigger = text.trim()
|
|
saveSettings("trigger", newTrigger || "=")
|
|
saveSettings("noTrigger", newTrigger === "")
|
|
}
|
|
}
|
|
|
|
Text {
|
|
text: "Examples: =, calc, c"
|
|
font.pixelSize: 12
|
|
color: "#AAFFFFFF"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
width: parent.width - 32
|
|
height: 1
|
|
color: "#30FFFFFF"
|
|
}
|
|
|
|
Column {
|
|
spacing: 8
|
|
width: parent.width - 32
|
|
|
|
Text {
|
|
text: "Supported Operations:"
|
|
font.pixelSize: 14
|
|
font.weight: Font.Medium
|
|
color: "#FFFFFF"
|
|
}
|
|
|
|
Column {
|
|
spacing: 4
|
|
leftPadding: 16
|
|
|
|
Text {
|
|
text: "• Addition: 3 + 3"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Subtraction: 10 - 5"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Multiplication: 4 * 7"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Division: 20 / 4"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Exponentiation: 2 ^ 8"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Modulo: 17 % 5"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Parentheses: (5 + 3) * 2"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "• Decimals: 3.14 * 2"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle {
|
|
width: parent.width - 32
|
|
height: 1
|
|
color: "#30FFFFFF"
|
|
}
|
|
|
|
Column {
|
|
spacing: 8
|
|
width: parent.width - 32
|
|
|
|
Text {
|
|
text: "Usage:"
|
|
font.pixelSize: 14
|
|
font.weight: Font.Medium
|
|
color: "#FFFFFF"
|
|
}
|
|
|
|
Column {
|
|
spacing: 4
|
|
leftPadding: 16
|
|
bottomPadding: 24
|
|
|
|
Text {
|
|
text: "1. Open Launcher (Ctrl+Space or click launcher button)"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: noTriggerToggle.checked ? "2. Type a mathematical expression (e.g., '3 + 3')" : "2. Type your trigger followed by the expression (e.g., '= 3 + 3')"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "3. The result will appear as a launcher item"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
|
|
Text {
|
|
text: "4. Press Enter to copy the result to clipboard"
|
|
font.pixelSize: 12
|
|
color: "#CCFFFFFF"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function saveSettings(key, value) {
|
|
if (pluginService) {
|
|
pluginService.savePluginData("calculator", key, value)
|
|
}
|
|
}
|
|
|
|
function loadSettings(key, defaultValue) {
|
|
if (pluginService) {
|
|
return pluginService.loadPluginData("calculator", key, defaultValue)
|
|
}
|
|
return defaultValue
|
|
}
|
|
}
|