Closed diniamo closed 3 weeks ago
The gui version (at least the qt one) has something like that, but the problem is that it's a popup window that disappears after some time, instead of being a part of the gui.
This is not true for the GTK UI, and the tooltip variant in the QT UI can be made more persistent by removing the delay (using expression context menu or in preferences).
Ah you're right, I didn't consider the gtk one, because it looks way uglier with the huge buttons. And it still gets removed in the qt one if the window loses focus.
Either way, I think this would still be a useful feature in the cli.
At the moment I do not know how to implement a "live preview" in the CLI, but if I'm able to find a feasible solution I will add it as an option.
Ah you're right, I didn't consider the gtk one, because it looks way uglier with the huge buttons.
The buttons, as well as all other non-essential GUI elements (see https://qalculate.github.io/images/qalculate-main-window.png), can be hidden.
Done.
It is disabled by default (for now) and can be activated using set autocalc
or set calculate as you type
(the option name is not finalized and I'm open to suggestions).
Note also that the "live preview" in the Qt UI has been updated and is now shown in the result list by default.
Whoa, thanks a lot. I'll close the issue as soon as I've tested the commit, or you can do so before, if you see fit. Gonna need to figure out how to set persistent options for that, since I haven't done it before.
I like autocalc
FWIW.
Works well. There is a small delay, but I assume that can't easily be fixed(?)
@hanna-kn it looks like there are bugs. For example, if I quickly update the expression, and press enter before the preview updates, it gets messed up:
I'm not noticing any obvious delay. It is difficult for me to be able to press enter before the preview is updated, but the latest commit should fix the the bug.
Bugs are expected at this stage.
Looking at the code, it seems like you flush at the end of the clear_autocalc
function, which isn't ideal, since that will cause the space to be empty until the next flush with the final result happens (visually, this results in a flash). Wouldn't it be possible to simply remove the first flush, or to avoid it some other way?
Looks like I missed something. The flash still happens, even if I remove the flush call.
It is difficult for me to be able to press enter before the preview is updated
Copy (including newline character) and paste should produce this issue (maybe?)
Just tested the latest commit, seems to work perfectly now. Closing.
The only feature I'm missing from qalculate is a proper live preview. The gui version (at least the qt one) has something like that, but the problem is that it's a popup window that disappears after some time, instead of being a part of the gui. I like using the terminal interface more anyway, so I'd like something like what fend has.
I have one question for the unlikely scenario in which I try to implement this myself: should it be enabled by default?
Showcase of fend:
https://github.com/Qalculate/libqalculate/assets/55629891/57fa3c50-5fe2-4fe8-a96b-5f0767f0105f