add comments

This commit is contained in:
piotr
2024-10-03 00:33:54 +02:00
parent 7aac5a4f52
commit 484c6ccb29
2 changed files with 3 additions and 0 deletions

View File

@@ -503,6 +503,8 @@ func main() {
} else if key.KeyVal() == gdk.KEY_Return {
s, _ := searchEntry.GetText()
if s != "" {
// Check if the search box content is an arithmetic expression. If so, display the result
// and copy to the clipboard with wl-copy.
result, err := expr.Eval(s, nil)
if err == nil {
log.Debugf("Setting up mathemathical operation result window. Operation: %s, result: %v", s, result)

View File

@@ -599,6 +599,7 @@ func setUpOperationResultWindow(operation string, result string) {
layershell.SetKeyboardMode(win, layershell.LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE)
}
// any key to close the window
win.Connect("key-release-event", func(_ *gtk.Window, event *gdk.Event) bool {
win.Destroy()
return true