gnome-specimen r170 - in branches/import-from-bzr: . data specimen



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

Log:
* data/gnome-specimen.glade:
* specimen/specimenwindow.py:
  - Start "find mode" when the user starts typing when the
    fonts treeview is focused by disabling the builtin
    treeview search mode and handling key press events
    correctly (only for alphanumeric characters).


Modified:
   branches/import-from-bzr/   (props changed)
   branches/import-from-bzr/data/gnome-specimen.glade
   branches/import-from-bzr/specimen/specimenwindow.py

Modified: branches/import-from-bzr/data/gnome-specimen.glade
==============================================================================
--- branches/import-from-bzr/data/gnome-specimen.glade	(original)
+++ branches/import-from-bzr/data/gnome-specimen.glade	Tue Jun 17 18:55:00 2008
@@ -209,10 +209,11 @@
 		      <property name="headers_visible">False</property>
 		      <property name="rules_hint">True</property>
 		      <property name="reorderable">False</property>
-		      <property name="enable_search">True</property>
+		      <property name="enable_search">False</property>
 		      <property name="fixed_height_mode">False</property>
 		      <property name="hover_selection">False</property>
 		      <property name="hover_expand">False</property>
+		      <signal name="key_press_event" handler="on_fonts_treeview_key_press_event" last_modification_time="Fri, 08 Jun 2007 16:18:29 GMT"/>
 		    </widget>
 		  </child>
 		</widget>

Modified: branches/import-from-bzr/specimen/specimenwindow.py
==============================================================================
--- branches/import-from-bzr/specimen/specimenwindow.py	(original)
+++ branches/import-from-bzr/specimen/specimenwindow.py	Tue Jun 17 18:55:00 2008
@@ -313,6 +313,12 @@
             self.fonts_treeview.get_selection().select_path((0,))
             self.fonts_treeview.grab_focus()
 
+    def on_fonts_treeview_key_press_event(self, treeview, event):
+        if event.string.isalnum(): # only strings, no cursor keys
+            self.find_entry.set_text(event.string)
+            self.start_find()
+            self.find_entry.set_position(-1) # move cursor to end
+
 
     # previews
 



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