Skip to content

Commit

Permalink
fixed title setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Feb 24, 2024
1 parent 695ea9e commit 330618c
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions code/codev/codeview.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ func (ge *CodeView) SetWindowNameTitle() {
return
}
pnm := ge.Name()
winm := "Cogent Code " + pnm
winm := "Cogent Code " + pnm
win.SetName(winm)
win.SetTitle(winm + ": " + string(ge.Settings.ProjRoot))
win.SetTitle(winm)
ge.Scene.Body.Title = winm
}

// OpenPath creates a new project by opening given path, which can either be a
Expand Down Expand Up @@ -512,8 +513,7 @@ func CodeInScene(sc *gi.Scene) *CodeView {

// NewCodeWindow is common code for Open CodeWindow from Proj or Path
func NewCodeWindow(path, projnm, root string, doPath bool) *CodeView {
winm := "Cogent Code: " + projnm
wintitle := winm + ": " + path
winm := "Cogent Code • " + projnm

if win, found := gi.AllRenderWins.FindName(winm); found {
sc := win.MainScene()
Expand All @@ -524,33 +524,13 @@ func NewCodeWindow(path, projnm, root string, doPath bool) *CodeView {
}
}

b := gi.NewBody("Cogent Code").SetTitle(wintitle)
b := gi.NewBody("Cogent Code").SetTitle(winm)
b.Scene.Nm = winm

ge := NewCodeView(b)
gi.TheApp.AppBarConfig = ge.AppBarConfig
b.AddAppBar(ge.ConfigToolbar)

/* todo: window doesn't exist yet -- need a delayed soln
inClosePrompt := false
win := ge.Sc.RenderWin()
win.GoosiWin.SetCloseReqFunc(func(w goosi.Window) {
if !inClosePrompt {
inClosePrompt = true
if ge.CloseWindowReq() {
win.Close()
} else {
inClosePrompt = false
}
}
})
win.GoosiWin.SetCloseCleanFunc(func(w goosi.Window) {
if gi.MainRenderWins.Len() <= 1 {
go goosi.TheApp.Quit() // once main window is closed, quit
}
})
*/

b.NewWindow().Run()

if doPath {
Expand Down

0 comments on commit 330618c

Please sign in to comment.