From c119b2cf8eb2fe2cb2b204e870deb7c6dfb189ee Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 26 Jul 2026 18:16:25 +0800 Subject: init: qml_plugin new(plugin): date --- services/_SmartCalc.qml | 37 +++++++++++++++++++++++++++++++++++++ services/todo.md | 3 +++ 2 files changed, 40 insertions(+) create mode 100644 services/_SmartCalc.qml create mode 100644 services/todo.md (limited to 'services') 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(); + } +} diff --git a/services/todo.md b/services/todo.md new file mode 100644 index 0000000..63a2195 --- /dev/null +++ b/services/todo.md @@ -0,0 +1,3 @@ +# TODO + +- config for Loading... for service like smartcalc when its doing the job or implicit -- cgit v1.2.3