ui: Several UI changes
authorSimón Pena <spenap@gmail.com>
Tue, 25 May 2010 22:00:22 +0000 (00:00 +0200)
committerSimón Pena <spenap@gmail.com>
Tue, 25 May 2010 22:03:54 +0000 (00:03 +0200)
* Changed MainWindow buttons
* Replaced movie placeholder image with a maemo stock one
* Reduced timeout so tests are quicker

ui/maeviesui/maeviesui/gui.py
ui/maeviesui/util/constants.py

index 270c8c2..dd53b06 100644 (file)
@@ -24,7 +24,6 @@ import hildon
 import pygtk
 import pango
 import gobject
-from random import randint
 import random
 pygtk.require("2.0")
 import gtk
@@ -47,19 +46,16 @@ class Maevies(hildon.StackableWindow):
 
         self.show_all()
 
-    def _create_box(self, title, action):
+    def _create_button(self, title, subtitle, action):
         box = gtk.VBox()
         box.set_border_width(20)
 
-        button = gtk.Button()
+        button = hildon.Button(gtk.HILDON_SIZE_THUMB_HEIGHT,
+                               hildon.BUTTON_ARRANGEMENT_VERTICAL, title, subtitle)
         button.connect("clicked", self._button_clicked, action)
-        foot_label = gtk.Label()
-        foot_label.set_text(title)
 
         box.pack_start(button,
-                             expand = True, fill = True)
-        box.pack_start(foot_label,
-                             expand = False, fill = False)
+                             expand = True, fill = False)
 
         return box
 
@@ -67,14 +63,14 @@ class Maevies(hildon.StackableWindow):
         contents = gtk.HBox()
         contents.set_border_width(60)
         contents.set_homogeneous(True)
-        contents.pack_start(self._create_box(title = "On Theaters",
-                                             action = self.ACTION_THEATERS),
+        contents.pack_start(self._create_button("On Theaters", "Movies playing",
+                                             self.ACTION_THEATERS),
                             expand = True, fill = True)
-        contents.pack_start(self._create_box(title = "Favorites",
-                                             action = self.ACTION_FAVORITES),
+        contents.pack_start(self._create_button("Favorites", "Your saved searches",
+                                             self.ACTION_FAVORITES),
                             expand = True, fill = True)
-        contents.pack_start(self._create_box(title = "Search",
-                                             action = self.ACTION_SEARCH),
+        contents.pack_start(self._create_button("Search", "Enter a new search",
+                                             self.ACTION_SEARCH),
                             expand = True, fill = True)
 
         return contents;
@@ -246,10 +242,6 @@ class MoviesListStore(gtk.ListStore):
                   }
             self.append(row.values())
 
-if __name__ == "__main__":
-    maevies = Maevies()
-    maevies.run()
-
 class AboutDialog(gtk.Dialog):
 
     def __init__(self, parent):
@@ -283,7 +275,9 @@ class MovieDecorator:
         return self._get_placeholder_pixbuf()
 
     def _get_placeholder_pixbuf(self):
-        pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(constants.PLACEHOLDER_IMAGE,
-                                                    constants.IMAGE_WIDTH,
-                                                    constants.IMAGE_HEIGHT)
+        pixbuf = gtk.IconTheme().load_icon('general_video_file', 48, 0)
         return pixbuf
+
+if __name__ == "__main__":
+    maevies = Maevies()
+    maevies.run()
index 0c09a6c..d46df6f 100644 (file)
@@ -25,11 +25,4 @@ LOCAL_DATA_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                               os.pardir,
                                               os.pardir,
                                               'data'))
-
-PLACEHOLDER_IMAGE = os.path.join(LOCAL_DATA_DIR, 'placeholderimage.png')
-
-IMAGE_WIDTH = 100
-
-IMAGE_HEIGHT = 60
-
-TIMEOUT_TIME_MILLIS = 2000
+TIMEOUT_TIME_MILLIS = 500