func changeHost(g *gocui.Gui, v *gocui.View) error { if err := g.DeleteView("summary"); err != nil { return err } if err := g.DeleteView("detail"); err != nil { return err } _, cy := v.Cursor() l, err := v.Line(cy) if err != nil { return err } serverName := strings.TrimSpace(l) for _, r := range scanHistory.ScanResults { if serverName == strings.TrimSpace(r.ServerInfoTui()) { currentScanResult = r break } } if err := setSummaryLayout(g); err != nil { return err } if err := setDetailLayout(g); err != nil { return err } return nil }
func delView(g *gocui.Gui, s string) error { if err := g.DeleteView(s); err != nil { return err } return nil }
func delMsg(g *gocui.Gui, v *gocui.View) error { if err := g.DeleteView("msg"); err != nil { return err } if _, err := g.SetCurrentView("side"); err != nil { return err } return nil }
func hideMatched(g *gocui.Gui, v *gocui.View) error { if err := g.DeleteView("matched"); err != nil { return err } if err := g.SetCurrentView("background"); err != nil { return err } return nil }
func redrawDetail(g *gocui.Gui) error { if err := g.DeleteView("detail"); err != nil { return err } if err := setDetailLayout(g); err != nil { return err } return nil }
func delMsg(g *gocui.Gui, v *gocui.View) error { if err := g.DeleteView(vMessage); err != nil { return err } top(g, "Select target platform, source transcript and destination.") if err := g.SetCurrentView(vPlatforms); err != nil { return err } return nil }
func delView(g *gocui.Gui) error { if len(views) <= 1 { return nil } if err := g.DeleteView(views[curView]); err != nil { return err } views = append(views[:curView], views[curView+1:]...) return nextView(g, false) }
func delMsg(g *gocui.Gui, v *gocui.View) error { if err := g.DeleteView("msg"); err != nil { return err } return nil }
func (c *commentView) DeleteCommentView(g *gocui.Gui) error { return g.DeleteView(fmt.Sprintf("comment-%d", *c.ic.issue.Number)) }
func layout(g *gocui.Gui) error { maxX, maxY := g.Size() max := float32(maxX) playlistSize := max * 0.15 trackSize := max * 0.60 if v, err := g.SetView(VIEW_PLAYLISTS, -1, -1, int(playlistSize), maxY-2); err != nil { if err != gocui.ErrUnknownView { return err } gui.playlistsView = v gui.playlistsView.Highlight = true gui.updatePlaylistsView() if err := g.SetCurrentView(VIEW_PLAYLISTS); err != nil { return err } } if v, err := g.SetView(VIEW_TRACKS, int(playlistSize), -1, int(playlistSize+trackSize), maxY-2); err != nil { if err != gocui.ErrUnknownView { return err } gui.tracksView = v gui.updateTracksView() } if v, err := g.SetView(VIEW_QUEUE, int(playlistSize+trackSize), -1, maxX, maxY-2); err != nil { if err != gocui.ErrUnknownView { return err } gui.queueView = v } if v, err := g.SetView(VIEW_STATUS, -1, maxY-2, maxX, maxY); err != nil { if err != gocui.ErrUnknownView { return err } gui.statusView = v } if gui.showInfo { if subView, err := g.SetView(VIEW_ARTIST_INFO, 10, 1, 10+40, 1+2); err != nil { fmt.Fprintf(subView, "%v\n", gui.infoTrack.Artist.Name) gui.infoArtistView = subView } if subView, err := g.SetView(VIEW_TOP_TRACKS_INFO, 10, 1+2, 10+40, 1+2+12); err != nil { gui.infoTopTracksView = subView } if err := g.SetCurrentView(VIEW_TOP_TRACKS_INFO); err != nil { return err } gui.tracksView.Highlight = false gui.infoTopTracksView.Highlight = true } else if gui.infoArtistView != nil { g.DeleteView(VIEW_ARTIST_INFO) g.DeleteView(VIEW_TOP_TRACKS_INFO) gui.infoArtistView = nil gui.infoTopTracksView = nil if err := g.SetCurrentView(VIEW_TRACKS); err != nil { return err } gui.tracksView.Highlight = true } if !gui.initialised && loadStateWheInit { loadInitialState() } gui.initialised = true return nil }