summaryrefslogtreecommitdiff
path: root/place.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-06 21:25:51 -0600
committerJeff Carr <[email protected]>2025-02-06 21:25:51 -0600
commit3d104d5b4a61ca4d32956c771f8882a215574515 (patch)
tree0fa28ea373868a3ae7eb15a5c468ca6911d0920b /place.go
parent0b265d2b72a474c11512982ce937d7323ff8b41c (diff)
dragging and window placement is still messed up
Diffstat (limited to 'place.go')
-rw-r--r--place.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/place.go b/place.go
index 20d7759..4d6aad5 100644
--- a/place.go
+++ b/place.go
@@ -142,6 +142,13 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
newH = newH - startH
// tk.dumpWidget(fmt.Sprintf("PlaceGroup(%d,%d)", maxW, newH))
return maxW, newH
+ case widget.Button:
+ if tk.isWindowDense() && tk.isInGrid() {
+ tk.frame = false
+ tk.color = &colorButtonDense
+ }
+ tk.gocuiSetWH(startW, startH)
+ return tk.gocuiSize.Width(), tk.gocuiSize.Height()
default:
tk.gocuiSetWH(startW, startH)
return tk.gocuiSize.Width(), tk.gocuiSize.Height()
@@ -159,6 +166,16 @@ func (tk *guiWidget) isWindowDense() bool {
return tk.parent.isWindowDense()
}
+func (tk *guiWidget) isInGrid() bool {
+ if tk.node.WidgetType == widget.Grid {
+ return true
+ }
+ if tk.parent == nil {
+ return true
+ }
+ return tk.parent.isInGrid()
+}
+
func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
// w.showWidgetPlacement("grid0:")
if w.node.WidgetType != widget.Grid {