app: [API] add Window.Perform, replacing Close, Raise, Centered

This new method performs user related actions on the Window, supporting custom window decorations.
It supersedes the Close and Raise methods as well as the Centered window option.

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2022-01-31 18:31:00 +01:00
committed by Elias Naur
parent 668d0e7d79
commit 74acc90789
3 changed files with 40 additions and 35 deletions
-8
View File
@@ -1024,14 +1024,6 @@ func (w *window) setTitle(prev, cnf Config) {
func (w *window) Perform(actions system.Action) {
walkActions(actions, func(action system.Action) {
switch action {
case system.ActionMinimize:
w.Configure([]Option{Minimized.Option()})
case system.ActionMaximize:
w.Configure([]Option{Maximized.Option()})
case system.ActionUnmaximize:
w.Configure([]Option{Windowed.Option()})
case system.ActionClose:
w.Close()
case system.ActionMove:
w.move()
default: