Gtk3 conversion fixes for editors

svn: r20225
This commit is contained in:
Nick Hall 2012-08-16 20:20:52 +00:00
parent b7ab76bcf6
commit 5c754506e0
7 changed files with 15 additions and 13 deletions

View File

@ -150,7 +150,7 @@ class EditAddress(EditSecondary):
self._setup_notebook_tabs( notebook) self._setup_notebook_tabs( notebook)
notebook.show_all() notebook.show_all()
self.top.get_object('vbox').pack_start(notebook,True) self.top.get_object('vbox').pack_start(notebook, True, True, 0)
def build_menu_names(self, obj): def build_menu_names(self, obj):
return (_('Address'),_('Address Editor')) return (_('Address'),_('Address Editor'))

View File

@ -123,7 +123,7 @@ class EditAttribute(EditSecondary):
self._setup_notebook_tabs( notebook) self._setup_notebook_tabs( notebook)
notebook.show_all() notebook.show_all()
self.top.get_object('vbox').pack_start(notebook,True) self.top.get_object('vbox').pack_start(notebook, True, True, 0)
def build_menu_names(self, attrib): def build_menu_names(self, attrib):
if not attrib: if not attrib:

View File

@ -254,7 +254,7 @@ class EditLdsOrd(EditSecondary):
self._setup_notebook_tabs( notebook) self._setup_notebook_tabs( notebook)
notebook.show_all() notebook.show_all()
self.top.get_object('vbox').pack_start(notebook,True) self.top.get_object('vbox').pack_start(notebook, True, True, 0)
def select_parents_clicked(self, obj): def select_parents_clicked(self, obj):
SelectFamily = SelectorFactory('Family') SelectFamily = SelectorFactory('Family')
@ -419,7 +419,7 @@ class EditFamilyLdsOrd(EditSecondary):
self.track_ref_for_deletion("note_tab") self.track_ref_for_deletion("note_tab")
notebook.show_all() notebook.show_all()
self.top.get_object('vbox').pack_start(notebook,True) self.top.get_object('vbox').pack_start(notebook, True, True, 0)
def build_menu_names(self, attrib): def build_menu_names(self, attrib):
label = _("LDS Ordinance") label = _("LDS Ordinance")

View File

@ -36,6 +36,7 @@ from gen.ggettext import gettext as _
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gdk
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -124,7 +124,8 @@ class EditName(EditSecondary):
hbox_surn.set_size_request(-1, hbox_surn.set_size_request(-1,
int(config.get('interface.surname-box-height'))) int(config.get('interface.surname-box-height')))
hbox_surn.pack_start(SurnameTab(self.dbstate, self.uistate, self.track, hbox_surn.pack_start(SurnameTab(self.dbstate, self.uistate, self.track,
self.obj, top_label=None)) self.obj, top_label=None),
True, True, 0)
#recreate start page as GrampsTab #recreate start page as GrampsTab
notebook.remove_page(0) notebook.remove_page(0)
self.gennam = GeneralNameTab(self.dbstate, self.uistate, self.track, self.gennam = GeneralNameTab(self.dbstate, self.uistate, self.track,

View File

@ -156,7 +156,7 @@ class EditPersonRef(EditSecondary):
self._setup_notebook_tabs(notebook) self._setup_notebook_tabs(notebook)
notebook.show_all() notebook.show_all()
self.top.get_object('vbox').pack_start(notebook, True) self.top.get_object('vbox').pack_start(notebook, True, True, 0)
def build_menu_names(self, obj): def build_menu_names(self, obj):
return (_('Person Reference'),_('Person Reference Editor')) return (_('Person Reference'),_('Person Reference Editor'))

View File

@ -636,22 +636,22 @@ class StyledTextEditor(Gtk.TextView):
current_value = self.textbuffer.get_style_at_cursor(style) current_value = self.textbuffer.get_style_at_cursor(style)
if style == StyledTextTagType.FONTCOLOR: if style == StyledTextTagType.FONTCOLOR:
color_selection = Gtk.ColorSelectionDialog(_("Select font color")) color_dialog = Gtk.ColorSelectionDialog(_("Select font color"))
elif style == StyledTextTagType.HIGHLIGHT: elif style == StyledTextTagType.HIGHLIGHT:
color_selection = Gtk.ColorSelectionDialog(_("Select " color_dialog = Gtk.ColorSelectionDialog(_("Select "
"background color")) "background color"))
else: else:
_LOG.debug("unknown style: '%d'" % style) _LOG.debug("unknown style: '%d'" % style)
return return
color_selection = color_dialog.get_color_selection()
if current_value: if current_value:
color_selection.colorsel.set_current_color( color_selection.set_current_color(hex_to_color(current_value))
hex_to_color(current_value))
response = color_selection.run() response = color_dialog.run()
color = color_selection.colorsel.get_current_color() color = color_selection.get_current_color()
value = color_to_hex(color) value = color_to_hex(color)
color_selection.destroy() color_dialog.destroy()
if response == Gtk.ResponseType.OK: if response == Gtk.ResponseType.OK:
_LOG.debug("applying style '%d' with value '%s'" % _LOG.debug("applying style '%d' with value '%s'" %