Fix focusSearchEntry - select_region is completely broken, even with ctypes -
for a fix, just override the default 'select-all' by positioning the cursor at the end of any existing text, which is most likely what we want anyhow
This commit is contained in:
parent
1681b718ee
commit
5f029342ed
@ -577,12 +577,11 @@ class pluginclass( object ):
|
|||||||
self.buildButtonList()
|
self.buildButtonList()
|
||||||
|
|
||||||
def focusSearchEntry( self ):
|
def focusSearchEntry( self ):
|
||||||
# grab_focus() does select all text, as this is an unwanted behaviour we restore the old selection
|
# grab_focus() does select all text,
|
||||||
sel = self.searchEntry.get_selection_bounds()
|
# restoring the original selection is somehow broken, so just select the end
|
||||||
if len(sel) == 0: # no selection
|
# of the existing text, that's the most likely candidate anyhow
|
||||||
sel = ( self.searchEntry.get_position(), self.searchEntry.get_position() )
|
|
||||||
self.searchEntry.grab_focus()
|
self.searchEntry.grab_focus()
|
||||||
self.searchEntry.select_region( sel[0], sel[1] )
|
gtk.gtk_editable_set_position(hash(self.searchEntry), -1)
|
||||||
|
|
||||||
def buildButtonList( self ):
|
def buildButtonList( self ):
|
||||||
if self.buildingButtonList:
|
if self.buildingButtonList:
|
||||||
|
Loading…
Reference in New Issue
Block a user