Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
khogeland committed Oct 23, 2017
1 parent 5741e2a commit 12d712b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ui/listpane.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import
type MpdListPane* = ref object of Pane
songMode*: bool
values*: seq[MpdEither]
songValues*: seq[ptr mpd_song]
albumValues*: seq[mpd_album]
wrap*: bool # TODO actually implement
songValues: seq[ptr mpd_song]
albumValues: seq[mpd_album]
wrap: bool # TODO actually implement
currentViewLocation: int
currentView*: seq[string]
cursor*: int
Expand Down Expand Up @@ -62,17 +62,15 @@ proc moveViewDown(this: MpdListPane) =
this.updateView()

proc up*(this: MpdListPane) =
let hitTop = this.cursor == 0
if hitTop:
if this.cursor == 0:
this.moveViewUp()
else:
this.cursor -= 1

proc down*(this: MpdListPane) =
if this.cursor == len(this.values)-1:
return
let hitBottom = this.cursor == this.height-1
if hitBottom:
if this.cursor == this.height-1:
this.moveViewDown()
else:
this.cursor += 1
Expand All @@ -92,6 +90,3 @@ proc drawTo*(state: ListState, nb: Nimbox, x, y: int) =
else:
styNone
nb.print(x, y + i, t, clrDefault, clrDefault, style)
#nb.print(this.x+100, this.y, $this.cursor)
#nb.print(this.x+110, this.y, $this.currentViewLocation)
#nb.print(this.x+100, this.y+1, $this.getCurrentValue())

0 comments on commit 12d712b

Please sign in to comment.