Skip to content

Commit a322bf9

Browse files
committed
Add scrollbars to the open note widget
1 parent 5c7343b commit a322bf9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ff-brick/Main.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import Brick (
66
AttrMap,
77
AttrName,
8+
HScrollBarOrientation (OnBottom),
89
VScrollBarOrientation (OnRight),
910
ViewportType (Both),
1011
attrMap,
@@ -17,6 +18,7 @@ import Brick (
1718
str,
1819
viewport,
1920
withAttr,
21+
withHScrollBars,
2022
withVScrollBars,
2123
zoom,
2224
(<+>),
@@ -123,17 +125,17 @@ appDraw Model{notes, openNoteM} = [mainWidget <=> keysHelpLine]
123125

124126
agenda =
125127
borderWithLabel
126-
(str "Agenda")
128+
(str " Agenda ")
127129
(renderList renderListItem True notes & withVScrollBars OnRight)
128130

129131
openNoteWidget = do
130-
Entity{entityVal = note@Note{note_text}} <- openNoteM
131-
let title = noteTitle note
132-
text = fromRgaM note_text
132+
Entity{entityVal = Note{note_text}} <- openNoteM
133+
let text = fromRgaM note_text
133134
pure $
134-
borderWithLabel (str title) $
135-
viewport OpenNoteViewport Both $
136-
str text
135+
borderWithLabel (str " Note ") $
136+
viewport OpenNoteViewport Both (str text)
137+
& withVScrollBars OnRight
138+
& withHScrollBars OnBottom
137139

138140
keysHelpLine =
139141
withAttr highlightAttr (str "Esc")

0 commit comments

Comments
 (0)