STORE_LOOKUP = {
"next": "next.png",
"prev": "prev.png",
+ "home": "home.png",
"pause": "pause.png",
"play": "play.png",
"stop": "stop.png",
- "home": "home.png",
+ "pause_pressed": "pausepressed.png",
+ "play_pressed": "playpressed.png",
+ "stop_pressed": "stoppressed.png",
"small_next": "small_next.png",
"small_prev": "small_prev.png",
+ "small_home": "small_home.png",
"small_pause": "small_pause.png",
"small_play": "small_play.png",
"small_stop": "small_stop.png",
- "small_home": "small_home.png",
+ "small_pause_pressed": "small_pausepressed.png",
+ "small_play_pressed": "small_playpressed.png",
+ "small_stop_pressed": "small_stoppressed.png",
"loading": "loading.gif",
"""
@todo Restructure so there is a windows/ folder with a file per source
@todo Add additional sources
-@todo Switch home icon color
-@todo Switch from swappping icons on press to the pressed version of icons
@bug Fix presenter display
@todo Track recent
@todo Favorites
def _on_navigating(self, widget, navState):
if navState == "down":
imageName = "small_home"
- elif navState == "clicking" or not self._player.can_navigate:
+ elif navState == "clicking":
if widget is self._controlBox:
- if self._player.state == "play":
- imageName = "small_play"
+ if self._player.state == self._player.STATE_PLAY:
+ imageName = "small_pause_pressed"
else:
- imageName = "small_pause"
- elif widget is self._displayBox:
+ imageName = "small_play_pressed"
+ else:
if self._player.state == self._player.STATE_PLAY:
imageName = "small_pause"
else:
imageName = "small_play"
+ elif self._player.can_navigate:
+ if navState == "up":
+ imageName = "small_play"
+ elif navState == "left":
+ imageName = "small_next"
+ elif navState == "right":
+ imageName = "small_prev"
+ else:
+ if self._player.state == self._player.STATE_PLAY:
+ imageName = "small_pause"
else:
- raise NotImplementedError()
- elif navState == "up":
- imageName = "small_play"
- elif navState == "left":
- imageName = "small_next"
- elif navState == "right":
- imageName = "small_prev"
+ imageName = "small_play"
imagePath = self._store.STORE_LOOKUP[imageName]
self._store.set_image_from_store(self._controlButton, imagePath)
),
}
- MINIMUM_MOVEMENT = 20
+ MINIMUM_MOVEMENT = 32
_NO_POSITION = -1, -1
self._title = ""
self._subtitle = ""
self._buttonImage = None
+ self._imageName = ""
@property
def toplevel(self):
self._draw_presenter(cairoContext)
def set_state(self, stateImage):
+ if stateImage == self._imageName:
+ return
+ self._imageName = stateImage
self._buttonImage = self._store.get_surface_from_store(stateImage)
cairoContext = self._image.window.cairo_create()
if not self._isPortrait:
cairoContext.transform(cairo.Matrix(0, 1, 1, 0, 0, 0))
- self._draw_state(cairoContext)
+ self._draw_presenter(cairoContext)
def set_context(self, backgroundImage, title, subtitle):
self._backgroundImage = self._store.get_surface_from_store(backgroundImage)
if navState == "clicking":
if self._player.state == self._player.STATE_PLAY:
if self._active:
- imageName = "pause"
+ imageName = "pause_pressed"
else:
- imageName = "play"
+ imageName = "play_pressed"
elif self._player.state == self._player.STATE_PAUSE:
- imageName = "play"
+ imageName = "play_pressed"
elif self._player.state == self._player.STATE_STOP:
- imageName = "play"
+ imageName = "play_pressed"
else:
- imageName = "play"
+ imageName = "play_pressed"
_moduleLogger.info("Unhandled player state %s" % self._player.state)
elif navState == "down":
imageName = "home"
if navState == "clicking":
if self._player.state == self._player.STATE_PLAY:
if self._active:
- imageName = "pause"
+ imageName = "pause_pressed"
else:
- imageName = "play"
+ imageName = "play_pressed"
elif self._player.state == self._player.STATE_PAUSE:
- imageName = "play"
+ imageName = "play_pressed"
elif self._player.state == self._player.STATE_STOP:
- imageName = "play"
+ imageName = "play_pressed"
else:
_moduleLogger.info("Unhandled player state %s" % self._player.state)
elif navState == "down":