Sfoglia il codice sorgente

More work on tabs and layout

Johan Rong 1 mese fa
parent
commit
00692bd37b
3 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 1 1
      internal/editor/draw.go
  2. 1 1
      internal/layout/layout.go
  3. 4 4
      internal/layout/rect.go

+ 1 - 1
internal/editor/draw.go

@@ -79,7 +79,7 @@ func (m *Model) DrawContainer(c *layout.Container, rect layout.Rect) {
 	length := util.NonNilLen(c.Children[:])
 	rect = layout.Rect{
 		X: rect.X,
-		Y: rect.Y + 1,
+		Y: rect.Y,
 		Width: rect.Width,
 		Height: rect.Height,
 	}

+ 1 - 1
internal/layout/layout.go

@@ -58,7 +58,7 @@ func NewContainerEmpty() Container {
 				ActiveIdx: 0,
 			},
 		},
-		Split:	  	    SplitVertical,
+		Split:	  	    SplitHorizontal,
 		ActiveChildIdx: 0,
 	}
 }

+ 4 - 4
internal/layout/rect.go

@@ -33,15 +33,15 @@ func RectDisplace(rect Rect, split SplitType, idx int) Rect {
 	switch split {
 	case SplitHorizontal: return Rect{
 		X: rect.X + (rect.Width * idx),
-		Y: rect.Y,
+		Y: rect.Y + 1,
 		Width: rect.Width,
-		Height: rect.Height,
+		Height: rect.Height - 1,
 	}
 	case SplitVertical: return Rect{
 		X: rect.X,
-		Y: rect.Y + (rect.Height * idx),
+		Y: rect.Y + (rect.Height * idx) + 1,
 		Width: rect.Width,
-		Height: rect.Height,
+		Height: rect.Height - 1,
 	}
 	default: panic("[moose-error] impossible split type")
 	}