mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-1031 Rename WtfApp.app to WtfApp.tviewApp
Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -18,19 +18,19 @@ type Widget struct {
|
||||
view.MultiSourceWidget
|
||||
view.TextWidget
|
||||
|
||||
app *tview.Application
|
||||
Data []*MercurialRepo
|
||||
pages *tview.Pages
|
||||
settings *Settings
|
||||
tviewApp *tview.Application
|
||||
}
|
||||
|
||||
// NewWidget creates a new instance of a widget
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||
func NewWidget(tviewApp *tview.Application, pages *tview.Pages, settings *Settings) *Widget {
|
||||
widget := Widget{
|
||||
MultiSourceWidget: view.NewMultiSourceWidget(settings.Common, "repository", "repositories"),
|
||||
TextWidget: view.NewTextWidget(app, pages, settings.Common),
|
||||
TextWidget: view.NewTextWidget(tviewApp, pages, settings.Common),
|
||||
|
||||
app: app,
|
||||
tviewApp: tviewApp,
|
||||
pages: pages,
|
||||
settings: settings,
|
||||
}
|
||||
@@ -52,7 +52,7 @@ func (widget *Widget) Checkout() {
|
||||
repoToCheckout := widget.Data[widget.Idx]
|
||||
repoToCheckout.checkout(text)
|
||||
widget.pages.RemovePage("modal")
|
||||
widget.app.SetFocus(widget.View)
|
||||
widget.tviewApp.SetFocus(widget.View)
|
||||
|
||||
widget.display()
|
||||
|
||||
@@ -91,7 +91,7 @@ func (widget *Widget) addButtons(form *tview.Form, checkoutFctn func()) {
|
||||
func (widget *Widget) addCancelButton(form *tview.Form) {
|
||||
cancelFn := func() {
|
||||
widget.pages.RemovePage("modal")
|
||||
widget.app.SetFocus(widget.View)
|
||||
widget.tviewApp.SetFocus(widget.View)
|
||||
widget.display()
|
||||
}
|
||||
|
||||
@@ -100,10 +100,10 @@ func (widget *Widget) addCancelButton(form *tview.Form) {
|
||||
}
|
||||
|
||||
func (widget *Widget) modalFocus(form *tview.Form) {
|
||||
widget.app.QueueUpdateDraw(func() {
|
||||
widget.tviewApp.QueueUpdateDraw(func() {
|
||||
frame := widget.modalFrame(form)
|
||||
widget.pages.AddPage("modal", frame, false, true)
|
||||
widget.app.SetFocus(frame)
|
||||
widget.tviewApp.SetFocus(frame)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user