dragging and window placement is still messed up
This commit is contained in:
parent
0b265d2b72
commit
3d104d5b4a
9
color.go
9
color.go
|
@ -99,6 +99,15 @@ var colorButton colorT = colorT{
|
|||
name: "normal button",
|
||||
}
|
||||
|
||||
var colorButtonDense colorT = colorT{
|
||||
frame: none,
|
||||
fg: none,
|
||||
bg: gocui.ColorGreen,
|
||||
selFg: none,
|
||||
selBg: gocui.ColorWhite,
|
||||
name: "normal button",
|
||||
}
|
||||
|
||||
var colorDropdown colorT = colorT{
|
||||
frame: gocui.ColorYellow,
|
||||
fg: none,
|
||||
|
|
|
@ -141,7 +141,10 @@ func tabCycleWindows(g *gocui.Gui, v *gocui.View) error {
|
|||
return nil
|
||||
}
|
||||
tk.makeWindowActive()
|
||||
tk.doWidgetClick(tk.gocuiSize.w0, tk.gocuiSize.h0)
|
||||
w, h := g.MousePosition()
|
||||
me.downW = w
|
||||
me.downH = h
|
||||
tk.doWindowClick()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
17
place.go
17
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 {
|
||||
|
|
Loading…
Reference in New Issue