pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
228 stars 47 forks source link

Clicking calculator icon in Launcher adds "0" to input #46

Closed titojankowski closed 2 years ago

titojankowski commented 2 years ago

Distribution (run cat /etc/os-release): 21.04

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

Issue/Bug Description: Clicking on the Launcher calculator icon adds a "0" to the input box

Steps to reproduce (if you know): Start the Launcher (press Super key) Type "=" to take the first step into calculator mode Click anywhere in the dark grey area (i.e. calculator icon, "Ctrl+1" text") or hit return key Input text is changed to "= 0"

Expected behavior: Input text is not changed

Other Notes: Would prefer not to have to enter the "=" at all.

jacobgkau commented 2 years ago

Steps to reproduce (if you know): Start the Launcher (press Super key) Type "=" to take the first step into calculator mode Click anywhere in the dark grey area (i.e. calculator icon, "Ctrl+1" text") or hit return key Input text is changed to "= 0"

The calculator plugin has an intentional feature where selecting the calculation result puts the result into the input (so you can perform follow-up calculations.) The default result is 0 if nothing has been entered yet. In that sense, this is expected behavior, although maybe not very useful in this case.

Other Notes: Would prefer not to have to enter the "=" at all.

The Launcher either needs a way to know that you're trying to perform a calculation, or it would have to mix the calculation in with other results. Perhaps results with numbers aren't very common (I seem to have less than 8 results for every single-digit number at the moment), so it could just put the calculation at the top of the results any time the query starts with a number, similar to the web plugin.

mmstick commented 2 years ago

Attempting to perform a calculation if a query contains numbers is a good idea.

mmstick commented 2 years ago

47 will make it possible to perform math expressions without a prefix, but filling the search entry with the value is expected, so I'm closing this issue.

titojankowski commented 2 years ago

The calculator plugin has an intentional feature where selecting the calculation result puts the result into the input (so you can perform follow-up calculations.) The default result is 0 if nothing has been entered yet. In that sense, this is expected behavior, although maybe not very useful in this case.

OK! I use the calculator a lot, found myself hitting return mistakenly once and then needing to go back to hit delete to remove the zero. Also didn't realize that hitting return also puts the result into the input.

Glad to hear about #47!!