MCPcopy Create free account
hub / github.com/B33pBeeps/redthread / View

Method View

internal/app/model.go:1170–1204  ·  view source on GitHub ↗

--- View -------------------------------------------------------------

()

Source from the content-addressed store, hash-verified

1168// --- View -------------------------------------------------------------
1169
1170func (m model) View() string {
1171 if m.w == 0 || m.h == 0 {
1172 return ""
1173 }
1174
1175 if m.mode == ModeEdit && m.transition == nil {
1176 if n := m.findNote(m.editor.NoteID); n != nil {
1177 bg, _ := m.workspace.BgColor()
1178 base := m.editor.View(m.w, m.h, n, m.effectiveStars(), m.board.TextMode, m.board, bg)
1179 if m.fontMenu != nil {
1180 return m.overlayFontMenuOnString(base)
1181 }
1182 return base
1183 }
1184 }
1185
1186 c := m.newCanvas(m.w, m.h)
1187 if m.transition != nil {
1188 m.drawTransitionView(c)
1189 } else {
1190 m.drawBoardView(c)
1191 }
1192 m.drawTabBar(c)
1193 m.drawFooterView(c)
1194 if m.helpAnim > 0.001 {
1195 drawHelpPanel(c, m.helpAnim)
1196 }
1197 if m.fontMenu != nil {
1198 drawFontMenu(c, m.fontMenu)
1199 }
1200 if m.bgMenu != nil {
1201 drawBackgroundMenu(c, m.bgMenu)
1202 }
1203 return c.Serialize()
1204}
1205
1206func (m model) overlayFontMenuOnString(base string) string {
1207 rect := FontMenuRect(m.w, m.h-1)

Callers 1

Calls 13

findNoteMethod · 0.95
effectiveStarsMethod · 0.95
newCanvasMethod · 0.95
drawTransitionViewMethod · 0.95
drawBoardViewMethod · 0.95
drawTabBarMethod · 0.95
drawFooterViewMethod · 0.95
drawHelpPanelFunction · 0.85
drawFontMenuFunction · 0.85
drawBackgroundMenuFunction · 0.85
BgColorMethod · 0.80

Tested by 1