* src/PedView.py: Edit on doublecklick; only right click gives optionsmenu; Colors similar to tango icons

svn: r5766
This commit is contained in:
Martin Hawlisch 2006-01-16 21:53:56 +00:00
parent f924c6fbde
commit d8bfb75054
2 changed files with 39 additions and 35 deletions

View File

@ -1,3 +1,7 @@
2006-01-16 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/PedView.py: Edit on doublecklick; only right click gives
optionsmenu; Colors similar to tango icons
2006-01-16 Don Allingham <don@gramps-project.org> 2006-01-16 Don Allingham <don@gramps-project.org>
* src/gramps.glade: reposition add/delete buttons, remove separator * src/gramps.glade: reposition add/delete buttons, remove separator
between parents and relationship info between parents and relationship info

View File

@ -108,25 +108,25 @@ class PersonBoxWidget_cairo( gtk.DrawingArea):
self.text = self.fh.format_person(self.person,self.maxlines) self.text = self.fh.format_person(self.person,self.maxlines)
alive = Utils.probably_alive(self.person,self.fh.db) alive = Utils.probably_alive(self.person,self.fh.db)
if alive and self.person.get_gender() == RelLib.Person.MALE: if alive and self.person.get_gender() == RelLib.Person.MALE:
self.bgcolor = (0.9,0.9,1) self.bgcolor = (185/256.0, 207/256.0, 231/256.0)
self.bordercolor = (0.5,0.5,0.8) self.bordercolor = (32/256.0, 74/256.0, 135/256.0)
elif alive and self.person.get_gender() == RelLib.Person.FEMALE: elif alive and self.person.get_gender() == RelLib.Person.FEMALE:
self.bgcolor = (1,0.9,0.9) self.bgcolor = (255/256.0, 205/256.0, 241/256.0)
self.bordercolor = (0.8,0.5,0.5) self.bordercolor = (135/256.0, 32/256.0, 106/256.0)
elif alive: elif alive:
self.bgcolor = (1,0.9,1) self.bgcolor = (244/256.0, 220/256.0, 183/256.0)
self.bordercolor = (0.8,0.5,0.8) self.bordercolor = (143/256.0, 89/256.0, 2/256.0)
elif self.person.get_gender() == RelLib.Person.MALE: elif self.person.get_gender() == RelLib.Person.MALE:
self.bgcolor = (0.8,0.8,1) self.bgcolor = (185/256.0, 207/256.0, 231/256.0)
self.bordercolor = (0,0,0) self.bordercolor = (0,0,0)
elif self.person.get_gender() == RelLib.Person.FEMALE: elif self.person.get_gender() == RelLib.Person.FEMALE:
self.bgcolor = (1,0.8,0.8) self.bgcolor = (255/256.0, 205/256.0, 241/256.0)
self.bordercolor = (0,0,0) self.bordercolor = (0,0,0)
else: else:
self.bgcolor = (1,0.8,1) self.bgcolor = (244/256.0, 220/256.0, 183/256.0)
self.bordercolor = (0,0,0) self.bordercolor = (0,0,0)
else: else:
self.bgcolor = (0.9,0.9,0.9) self.bgcolor = (211/256.0, 215/256.0, 207/256.0)
self.bordercolor = (0,0,0) self.bordercolor = (0,0,0)
self.image = image self.image = image
try: try:
@ -138,6 +138,7 @@ class PersonBoxWidget_cairo( gtk.DrawingArea):
self.set_size_request(120,25) self.set_size_request(120,25)
def on_enter_cb(self,widget,event): def on_enter_cb(self,widget,event):
if self.person:
self.hightlight = True self.hightlight = True
self.queue_draw() self.queue_draw()
@ -278,22 +279,22 @@ class PersonBoxWidget( gtk.DrawingArea):
if self.person: if self.person:
alive = Utils.probably_alive(self.person,self.fh.db) alive = Utils.probably_alive(self.person,self.fh.db)
if alive and self.person.get_gender() == RelLib.Person.MALE: if alive and self.person.get_gender() == RelLib.Person.MALE:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#F5FFFF")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#b9cfe7"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#009999")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#204a87"))
elif self.person.get_gender() == RelLib.Person.MALE: elif self.person.get_gender() == RelLib.Person.MALE:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#F5FFFF")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#b9cfe7"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000"))
elif alive and self.person.get_gender() == RelLib.Person.FEMALE: elif alive and self.person.get_gender() == RelLib.Person.FEMALE:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#FFF5FF")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#ffcdf1"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#990099")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#87206a"))
elif self.person.get_gender() == RelLib.Person.FEMALE: elif self.person.get_gender() == RelLib.Person.FEMALE:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#FFF5FF")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#ffcdf1"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000"))
elif alive: elif alive:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#FFFFF5")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#f4dcb7"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#999900")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#8f5902"))
else: else:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#FFFFF5")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#f4dcb7"))
self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000")) self.border_gc.set_foreground( self.get_colormap().alloc_color("#000000"))
else: else:
self.bg_gc.set_foreground( self.get_colormap().alloc_color("#eeeeee")) self.bg_gc.set_foreground( self.get_colormap().alloc_color("#eeeeee"))
@ -431,25 +432,21 @@ class PedView(PageView.PersonNavView):
self.tooltips.enable() self.tooltips.enable()
self.notebook = gtk.Notebook() self.notebook = gtk.Notebook()
self.notebook.connect("button-press-event", self.on_show_option_menu_cb) self.notebook.connect("button-press-event", self.bg_button_press_cb)
self.bootstrap_handler = self.notebook.connect("expose-event", self.init_parent_signals_cb) self.bootstrap_handler = self.notebook.connect("expose-event", self.init_parent_signals_cb)
self.notebook.set_show_border(False) self.notebook.set_show_border(False)
self.notebook.set_show_tabs(False) self.notebook.set_show_tabs(False)
self.table_2 = gtk.Table(1,1,False) self.table_2 = gtk.Table(1,1,False)
self.table_2.connect("button-press-event", self.on_show_option_menu_cb)
self.add_table_to_notebook( self.table_2) self.add_table_to_notebook( self.table_2)
self.table_3 = gtk.Table(1,1,False) self.table_3 = gtk.Table(1,1,False)
self.table_3.connect("button-press-event", self.on_show_option_menu_cb)
self.add_table_to_notebook( self.table_3) self.add_table_to_notebook( self.table_3)
self.table_4 = gtk.Table(1,1,False) self.table_4 = gtk.Table(1,1,False)
self.table_4.connect("button-press-event", self.on_show_option_menu_cb)
self.add_table_to_notebook( self.table_4) self.add_table_to_notebook( self.table_4)
self.table_5 = gtk.Table(1,1,False) self.table_5 = gtk.Table(1,1,False)
self.table_5.connect("button-press-event", self.on_show_option_menu_cb)
self.add_table_to_notebook( self.table_5) self.add_table_to_notebook( self.table_5)
self.rebuild_trees(None) self.rebuild_trees(None)
@ -908,8 +905,7 @@ class PedView(PageView.PersonNavView):
if defperson: if defperson:
self.dbstate.change_active_person(defperson) self.dbstate.change_active_person(defperson)
def edit_person_cb(self,obj): def edit_person_cb(self,obj,person_handle):
person_handle = obj.get_data(_PERSON)
person = self.db.get_person_from_handle(person_handle) person = self.db.get_person_from_handle(person_handle)
if person: if person:
EditPerson.EditPerson(self.dbstate, self.uistate, [], person, self.person_edited_cb) EditPerson.EditPerson(self.dbstate, self.uistate, [], person, self.person_edited_cb)
@ -923,14 +919,18 @@ class PedView(PageView.PersonNavView):
myMenu.popup(None,None,None,0,0) myMenu.popup(None,None,None,0,0)
return(True); return(True);
def bg_button_press_cb(self,obj,event):
if event.button != 1:
self.on_show_option_menu_cb(obj)
return True
return False
def person_button_press_cb(self,obj,event,person_handle): def person_button_press_cb(self,obj,event,person_handle):
if event.button==1: if event.button==1 and event.type == gtk.gdk._2BUTTON_PRESS:
defperson = self.dbstate.active person = self.db.get_person_from_handle(person_handle)
if defperson and defperson.get_handle() != person_handle: if person:
self.dbstate.change_active_handle(person_handle) EditPerson.EditPerson(self.dbstate, self.uistate, [], person, self.person_edited_cb)
else: elif event.button!=1:
self.build_full_nav_menu_cb(obj,event,person_handle)
else:
self.build_full_nav_menu_cb(obj,event,person_handle) self.build_full_nav_menu_cb(obj,event,person_handle)
return True return True