handle ratios change at runtime
This commit is contained in:
parent
ee9d4c9ec4
commit
2085b6d797
2
eval.go
2
eval.go
@ -108,7 +108,7 @@ func (e *setExpr) eval(app *app, args []string) {
|
|||||||
rats = append(rats, i)
|
rats = append(rats, i)
|
||||||
}
|
}
|
||||||
gOpts.ratios = rats
|
gOpts.ratios = rats
|
||||||
app.ui = newUI()
|
app.ui.wins = getWins()
|
||||||
app.ui.loadFile(app.nav)
|
app.ui.loadFile(app.nav)
|
||||||
default:
|
default:
|
||||||
msg := fmt.Sprintf("unknown option: %s", e.opt)
|
msg := fmt.Sprintf("unknown option: %s", e.opt)
|
||||||
|
10
ui.go
10
ui.go
@ -361,7 +361,7 @@ func getWidths(wtot int) []int {
|
|||||||
return widths
|
return widths
|
||||||
}
|
}
|
||||||
|
|
||||||
func newUI() *ui {
|
func getWins() []*win {
|
||||||
wtot, htot := termbox.Size()
|
wtot, htot := termbox.Size()
|
||||||
|
|
||||||
var wins []*win
|
var wins []*win
|
||||||
@ -375,6 +375,12 @@ func newUI() *ui {
|
|||||||
wacc += widths[i]
|
wacc += widths[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return wins
|
||||||
|
}
|
||||||
|
|
||||||
|
func newUI() *ui {
|
||||||
|
wtot, htot := termbox.Size()
|
||||||
|
|
||||||
key := make(chan string, 1000)
|
key := make(chan string, 1000)
|
||||||
evs := make(chan termbox.Event)
|
evs := make(chan termbox.Event)
|
||||||
|
|
||||||
@ -385,7 +391,7 @@ func newUI() *ui {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
return &ui{
|
return &ui{
|
||||||
wins: wins,
|
wins: getWins(),
|
||||||
pwdwin: newWin(wtot, 1, 0, 0),
|
pwdwin: newWin(wtot, 1, 0, 0),
|
||||||
msgwin: newWin(wtot, 1, 0, htot-1),
|
msgwin: newWin(wtot, 1, 0, htot-1),
|
||||||
menuwin: newWin(wtot, 1, 0, htot-2),
|
menuwin: newWin(wtot, 1, 0, htot-2),
|
||||||
|
Loading…
Reference in New Issue
Block a user