resize event

This commit is contained in:
Dongdong Zhou 2018-02-12 11:10:26 +00:00
parent 5c32606517
commit 5c57781c30
1 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
xi "github.com/dzhou121/xi-go/xi-client"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
)
@ -112,6 +113,12 @@ func (e *Editor) initMainWindow() {
e.window.SetWindowTitle("Gonvim")
e.window.SetContentsMargins(0, 0, 0, 0)
e.window.SetMinimumSize2(e.width, e.height)
e.window.ConnectResizeEvent(func(event *gui.QResizeEvent) {
rect := e.window.Rect()
e.width = rect.Width()
e.height = rect.Height()
e.equalWins()
})
// NewView(e)