From: Ed Page Date: Fri, 14 May 2010 01:11:43 +0000 (-0500) Subject: Switching over to pressed icons and matching the view of the home icon with other... X-Git-Url: http://git.maemo.org/git/?p=watersofshiloah;a=commitdiff_plain;h=e4b9d028aa9583735e8252eeebe255b4a438d30c Switching over to pressed icons and matching the view of the home icon with other navigation icons --- diff --git a/data/home.png b/data/home.png index e66f47b..57dc225 100644 Binary files a/data/home.png and b/data/home.png differ diff --git a/data/pausepressed.png b/data/pausepressed.png index 85505e3..34d1775 100644 Binary files a/data/pausepressed.png and b/data/pausepressed.png differ diff --git a/data/pausepressedsmall.png b/data/pausepressedsmall.png deleted file mode 100644 index add8efe..0000000 Binary files a/data/pausepressedsmall.png and /dev/null differ diff --git a/data/pausesmall.png b/data/pausesmall.png deleted file mode 100644 index 5b343f0..0000000 Binary files a/data/pausesmall.png and /dev/null differ diff --git a/data/playpressed.png b/data/playpressed.png index 323301e..c3bd807 100644 Binary files a/data/playpressed.png and b/data/playpressed.png differ diff --git a/data/playpressedsmall.png b/data/playpressedsmall.png deleted file mode 100644 index 7c41174..0000000 Binary files a/data/playpressedsmall.png and /dev/null differ diff --git a/data/playsmall.png b/data/playsmall.png deleted file mode 100644 index e4a85bf..0000000 Binary files a/data/playsmall.png and /dev/null differ diff --git a/data/small_home.png b/data/small_home.png index 81c2468..54e61f7 100644 Binary files a/data/small_home.png and b/data/small_home.png differ diff --git a/data/small_pausepressed.png b/data/small_pausepressed.png new file mode 100644 index 0000000..f523d16 Binary files /dev/null and b/data/small_pausepressed.png differ diff --git a/data/small_playpressed.png b/data/small_playpressed.png new file mode 100644 index 0000000..c11e995 Binary files /dev/null and b/data/small_playpressed.png differ diff --git a/data/small_stoppressed.png b/data/small_stoppressed.png new file mode 100644 index 0000000..a712592 Binary files /dev/null and b/data/small_stoppressed.png differ diff --git a/data/stoppressed.png b/data/stoppressed.png index c12eee7..6f895d2 100644 Binary files a/data/stoppressed.png and b/data/stoppressed.png differ diff --git a/src/imagestore.py b/src/imagestore.py index 9ca9964..bf228f5 100644 --- a/src/imagestore.py +++ b/src/imagestore.py @@ -9,17 +9,23 @@ class ImageStore(object): 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", diff --git a/src/mormonchannel_gtk.py b/src/mormonchannel_gtk.py index d86f226..74f89ed 100755 --- a/src/mormonchannel_gtk.py +++ b/src/mormonchannel_gtk.py @@ -4,8 +4,6 @@ """ @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 diff --git a/src/playcontrol.py b/src/playcontrol.py index 7cdab35..dc70a12 100644 --- a/src/playcontrol.py +++ b/src/playcontrol.py @@ -102,25 +102,29 @@ class NavControl(gobject.GObject, go_utils.AutoSignal): 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) diff --git a/src/presenter.py b/src/presenter.py index fd57533..9b8e07a 100644 --- a/src/presenter.py +++ b/src/presenter.py @@ -26,7 +26,7 @@ class NavigationBox(gobject.GObject): ), } - MINIMUM_MOVEMENT = 20 + MINIMUM_MOVEMENT = 32 _NO_POSITION = -1, -1 @@ -130,6 +130,7 @@ class StreamPresenter(object): self._title = "" self._subtitle = "" self._buttonImage = None + self._imageName = "" @property def toplevel(self): @@ -149,12 +150,15 @@ class StreamPresenter(object): 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) diff --git a/src/windows.py b/src/windows.py index 38008a3..6b53df4 100644 --- a/src/windows.py +++ b/src/windows.py @@ -427,15 +427,15 @@ class RadioWindow(BasicWindow): 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" @@ -939,13 +939,13 @@ class ConferenceTalkWindow(BasicWindow): 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":