gnome-specimen r30 - trunk-from-bzr



Author: wbolster
Date: Tue Jun 17 18:41:43 2008
New Revision: 30
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=30&view=rev

Log:
* specimenwindow.py:
  - Work around a gtk 2.9 bug/quirk
  - Don't store the preview_text in the model, it's
    dynamically set anyway
  - Tiny fixup for keyboard navigation in the preview list.
    It's not perfect but it basically works like it should
    (skipping over the preview label rows).


Modified:
   trunk-from-bzr/   (props changed)
   trunk-from-bzr/specimenwindow.py

Modified: trunk-from-bzr/specimenwindow.py
==============================================================================
--- trunk-from-bzr/specimenwindow.py	(original)
+++ trunk-from-bzr/specimenwindow.py	Tue Jun 17 18:41:43 2008
@@ -151,7 +151,11 @@
         else:
             # this is a preview row
             (name, face) = model.get(iter, 0, 2)
-            self._set_cell_attributes_for_preview_cell(cell, face)
+            # Sometimes 'face' is None with GTK+ 2.9. Not sure why, bug #322471
+            # and bug #309221 might be related. Checking for None here seems to
+            # workaround the problem.
+            if face is not None:
+                self._set_cell_attributes_for_preview_cell(cell, face)
 
     def _set_preview_row_selection(self, path):
         'Callback for the row selection signal'
@@ -213,7 +217,7 @@
         self.previews_store.append(
                 [name, family, face])
         self.previews_store.append(
-                [self.preview_text, family, face])
+                [name, family, face])
 
     def schedule_update_previews(self):
         'Schedules an update of the previews'
@@ -303,7 +307,10 @@
         (path, column) = treeview.get_cursor()
         if path is not None and path[0] % 2 == 0:
             if count == 1: new_path = (path[0] + 1,) # forward
-            else: new_path = (path[0] -1,) # backward
+            else: new_path = (path[0] - 1,) # backward
+
+            # fix the navigation for the first row
+            if new_path[0] == -1: new_path = (0,)
 
             treeview.set_cursor(new_path)
             return True



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]