@@ -170,7 +170,7 @@ type ModalMaker = Int -> (Int, [ByteString])
170170
171171------------------------------------------------------------------------
172172
173- -- | The three lines of the play-mode widget.
173+ -- | The three lines of the play info widget.
174174playScreen :: DrawData -> [StringA ]
175175playScreen dd = [pPlaying dd, progressBar dd, pTimes dd]
176176
@@ -306,27 +306,19 @@ pVersion = P.pack versinfo
306306pTime :: DrawData -> ByteString
307307pTime = uptime . drawState
308308
309- -- | Play mode
310- pMode :: DrawData -> String
311- pMode dd = case status (drawState dd) of
309+ -- | Play state
310+ pState :: DrawData -> String
311+ pState dd = case status (drawState dd) of
312312 Stopped -> " ◼"
313313 Paused -> " ⏸"
314314 Playing -> " ▶"
315315
316- -- | Loop, normal, or random
317- pMode2 :: DrawData -> String
318- pMode2 dd = case mode (drawState dd) of
319- Random -> " rand"
320- Loop -> " loop"
321- Once -> " once"
322- Single -> " sing"
316+ -- | Play mode
317+ pMode :: DrawData -> String
318+ pMode dd = take 4 $ map toLower $ show $ mode $ drawState dd
323319
324320------------------------------------------------------------------------
325321
326- -- | The two play-mode glyphs (e.g. "▶ rand") rendered together.
327- playModes :: DrawData -> String
328- playModes dd = pMode dd ++ ' ' : pMode2 dd
329-
330322-- | "x/n dir(s) y/m file(s)" cursor position read-out.
331323playInfo :: DrawData -> ByteString
332324playInfo dd = mconcat
@@ -348,32 +340,31 @@ playInfo dd = mconcat
348340 curd = tobs $ 1 + mydir
349341 numd = tobs $ 1 + snd (bounds $ folders st)
350342
351- -- | The top title bar: cursor position + play modes + uptime + version.
343+ -- | The top title bar: cursor position + play indicator + uptime + version.
352344playTitle :: DrawData -> StringA
353345playTitle dd =
354346 FancyS $ map (, hl)
355347 if gap >= 2
356- then [mconcat [" " , inf, spaces gapl], modesBS ,
348+ then [mconcat [" " , inf, spaces gapl], indic ,
357349 mconcat [spaces gapr, time, " " , ver, " " ]]
358- else let gap' = x - modlen ; gapl' = gap' `div` 2
350+ else let gap' = x - indicl ; gapl' = gap' `div` 2
359351 in if gap' >= 2
360- then [spaces gapl', modesBS , spaces $ gap' - gapl']
361- else [" " , u $ take (x- 2 ) modes , " " ]
352+ then [spaces gapl', indic , spaces $ gap' - gapl']
353+ else [" " , P. take (x- 2 ) indic , " " ]
362354 where
363355 inf = playInfo dd
364356 time = pTime dd
365- modes = playModes dd
357+ indic = u $ pState dd ++ ' ' : pMode dd
366358 ver = pVersion
367- modesBS = u modes
368359
369360 x = sizeW $ drawSize dd
370361 lsize = 1 + P. length inf
371362 rsize = 2 + P. length time + P. length ver
372- side = (x - modlen ) `div` 2
373- gap = x - modlen - lsize - rsize
363+ side = (x - indicl ) `div` 2
364+ gap = x - indicl - lsize - rsize
374365 gapl = 1 `max` ((side - lsize) `min` (gap - 1 ))
375366 gapr = gap - gapl
376- modlen = 6 -- length modes
367+ indicl = 6 -- length indic
377368 hl = titlebar . config $ drawState dd
378369
379370-- | The scrolling playlist (title + visible tracks + minibuffer).
0 commit comments