add comments
This commit is contained in:
2
main.go
2
main.go
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user