Switching over to pressed icons and matching the view of the home icon with other...
authorEd Page <eopage@byu.net>
Fri, 14 May 2010 01:11:43 +0000 (20:11 -0500)
committerEd Page <eopage@byu.net>
Fri, 14 May 2010 01:46:30 +0000 (20:46 -0500)
17 files changed:
data/home.png
data/pausepressed.png
data/pausepressedsmall.png [deleted file]
data/pausesmall.png [deleted file]
data/playpressed.png
data/playpressedsmall.png [deleted file]
data/playsmall.png [deleted file]
data/small_home.png
data/small_pausepressed.png [new file with mode: 0644]
data/small_playpressed.png [new file with mode: 0644]
data/small_stoppressed.png [new file with mode: 0644]
data/stoppressed.png
src/imagestore.py
src/mormonchannel_gtk.py
src/playcontrol.py
src/presenter.py
src/windows.py

index e66f47b..57dc225 100644 (file)
Binary files a/data/home.png and b/data/home.png differ
index 85505e3..34d1775 100644 (file)
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 (file)
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 (file)
index 5b343f0..0000000
Binary files a/data/pausesmall.png and /dev/null differ
index 323301e..c3bd807 100644 (file)
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 (file)
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 (file)
index e4a85bf..0000000
Binary files a/data/playsmall.png and /dev/null differ
index 81c2468..54e61f7 100644 (file)
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 (file)
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 (file)
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 (file)
index 0000000..a712592
Binary files /dev/null and b/data/small_stoppressed.png differ
index c12eee7..6f895d2 100644 (file)
Binary files a/data/stoppressed.png and b/data/stoppressed.png differ
index 9ca9964..bf228f5 100644 (file)
@@ -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",
 
index d86f226..74f89ed 100755 (executable)
@@ -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
index 7cdab35..dc70a12 100644 (file)
@@ -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)
index fd57533..9b8e07a 100644 (file)
@@ -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)
index 38008a3..6b53df4 100644 (file)
@@ -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":