move and resize commands working

This commit is contained in:
2026-03-03 13:54:21 +00:00
parent 28ea467f0a
commit de59665c78
8 changed files with 248 additions and 69 deletions
+26
View File
@@ -2,7 +2,9 @@ package services
import (
"esdi/cdashdisplay"
helper "esdi/helpers"
"esdi/peripheral"
"esdi/tui/internal/models"
"log/slog"
)
@@ -64,3 +66,27 @@ func (cds *CDashService) UpdateWindow(idx int16, win *cdashdisplay.UIWindow) err
func (cds *CDashService) DeleteWindow(idx int16) error {
return cds.CDash.DestroyWindow(idx)
}
func (cds *CDashService) ResizeWindow(win *models.UIWindow, vec *helper.Vector) error {
err := cds.CDash.ResizeWindow(win.IDX, vec)
if err != nil {
return err
}
// Update the UI window data
win.Window = *cds.CDash.State.Layout.Windows[win.IDX]
return nil
}
func (cds *CDashService) MoveWindow(win *models.UIWindow, vec *helper.Vector) error {
err := cds.CDash.MoveWindow(win.IDX, vec)
if err != nil {
return err
}
// Update the UI window data
win.Window = *cds.CDash.State.Layout.Windows[win.IDX]
return nil
}