summaryrefslogtreecommitdiff
path: root/services/_SmartCalc.qml
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2026-07-26 18:16:25 +0800
committerlittleblack111 <littleblack11111@gmail.com>2026-07-26 18:16:25 +0800
commitc119b2cf8eb2fe2cb2b204e870deb7c6dfb189ee (patch)
tree82be34f895614eafd89f4b8cce3e5e1dd08439b3 /services/_SmartCalc.qml
parent7bc4e6df35894a18aec7695375bc7c47e78ba8cb (diff)
init: qml_plugin
new(plugin): date
Diffstat (limited to 'services/_SmartCalc.qml')
-rw-r--r--services/_SmartCalc.qml37
1 files changed, 37 insertions, 0 deletions
diff --git a/services/_SmartCalc.qml b/services/_SmartCalc.qml
new file mode 100644
index 0000000..fd9f134
--- /dev/null
+++ b/services/_SmartCalc.qml
@@ -0,0 +1,37 @@
+pragma Singleton
+// pragma ComponentBehavior: Bound
+
+import QtQuick
+import Quickshell
+import Quickshell.Io
+
+import qs.config
+
+import core
+
+Singleton {
+ id: root
+
+ property var result: Calc.result
+ property int result_type: Calc.result_type
+ readonly property var resultType: ({
+ "Math": Calc.Math,
+ "Unit": Calc.Unit,
+ "Currency": Calc.Currency,
+ "Crypto": Calc.Crypto,
+ "Time": Calc.Time,
+ "Date": Calc.Date,
+ "Unset": Calc.Unset
+ })
+
+ function query(input: string) {
+ console.log(input)
+ Calc.query(input);
+ }
+
+
+ // FIXME: we'll prolly need to reset() everytime here after it finish just so the next time another component using it won't be affected by the previous query
+ function reset() {
+ Calc.reset();
+ }
+}