Code below can be added in "zim/gui/__init__.py" just below the call "self.uimanager.ensure_update()" (around line 540) and will add a search entry in the toolbar. In my mind this removes the need for adding search to the side pane, but open to suggestions.
###
space = gtk.SeparatorToolItem()
space.set_draw(False)
space.set_expand(True)
self.mainwindow.toolbar.insert(space, -1)
def inline_search(entry, *a):
text = entry.get_text()
if text:
self.show_search(text)
from zim.gui.widgets import InputEntry
entry = InputEntry()
if gtk.gtk_version >= (2, 16):
entry.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_FIND)
entry.set_icon_activatable(gtk.ENTRY_ICON_SECONDARY, True)
entry.set_icon_tooltip_text(gtk.ENTRY_ICON_SECONDARY, _('Search Pages...'))
# FIXME would be nice to have function to set "Search" as grey background
#entry.set_icon_to_clear()
entry.connect('activate', inline_search)
entry.connect('icon-release', inline_search)
entry.show()
item = gtk.ToolItem()
item.add(entry)
self.mainwindow.toolbar.insert(item, -1)
###
Code below can be added in "zim/gui/ __init_ _.py" just below the call "self.uimanager .ensure_ update( )" (around line 540) and will add a search entry in the toolbar. In my mind this removes the need for adding search to the side pane, but open to suggestions.
### olItem( ) set_draw( False) set_expand( True) mainwindow. toolbar. insert( space, -1)
space = gtk.SeparatorTo
space.
space.
self.
def inline_ search( entry, *a): show_search( text)
text = entry.get_text()
if text:
self.
from zim.gui.widgets import InputEntry set_icon_ from_stock( gtk.ENTRY_ ICON_SECONDARY, gtk.STOCK_FIND) set_icon_ activatable( gtk.ENTRY_ ICON_SECONDARY, True) set_icon_ tooltip_ text(gtk. ENTRY_ICON_ SECONDARY, _('Search Pages...')) set_icon_ to_clear( ) connect( 'activate' , inline_search) connect( 'icon-release' , inline_search) mainwindow. toolbar. insert( item, -1)
entry = InputEntry()
if gtk.gtk_version >= (2, 16):
entry.
entry.
entry.
# FIXME would be nice to have function to set "Search" as grey background
#entry.
entry.
entry.
entry.show()
item = gtk.ToolItem()
item.add(entry)
self.
###