fanchart: configure option to set the duplicate color
svn: r20414
This commit is contained in:
parent
59bfeb3e70
commit
7dc043f4a1
@ -100,12 +100,12 @@ class FanChartDescWidget(FanChartBaseWidget):
|
|||||||
See main() of FanChartGramplet for example of model format.
|
See main() of FanChartGramplet for example of model format.
|
||||||
"""
|
"""
|
||||||
self.set_values(None, 9, BACKGROUND_GRAD_GEN, 'Sans', '#0000FF',
|
self.set_values(None, 9, BACKGROUND_GRAD_GEN, 'Sans', '#0000FF',
|
||||||
'#FF0000', None, 0.5, FORM_CIRCLE, ANGLE_WEIGHT)
|
'#FF0000', None, 0.5, FORM_CIRCLE, ANGLE_WEIGHT, '#888a85')
|
||||||
FanChartBaseWidget.__init__(self, dbstate, uistate, callback_popup)
|
FanChartBaseWidget.__init__(self, dbstate, uistate, callback_popup)
|
||||||
|
|
||||||
def set_values(self, root_person_handle, maxgen, background,
|
def set_values(self, root_person_handle, maxgen, background,
|
||||||
fontdescr, grad_start, grad_end,
|
fontdescr, grad_start, grad_end,
|
||||||
filter, alpha_filter, form, angle_algo):
|
filter, alpha_filter, form, angle_algo, dupcolor):
|
||||||
"""
|
"""
|
||||||
Reset the values to be used:
|
Reset the values to be used:
|
||||||
root_person_handle = person to show
|
root_person_handle = person to show
|
||||||
@ -114,8 +114,10 @@ class FanChartDescWidget(FanChartBaseWidget):
|
|||||||
fontdescr = string describing the font to use
|
fontdescr = string describing the font to use
|
||||||
grad_start, grad_end: colors to use for background procedure
|
grad_start, grad_end: colors to use for background procedure
|
||||||
filter = the person filter to apply to the people in the chart
|
filter = the person filter to apply to the people in the chart
|
||||||
alpha = the alpha transparency value (0-1) to apply to filtered out data
|
alpha_filter = the alpha transparency value (0-1) to apply to filtered out data
|
||||||
form = the FORM_ constant for the fanchart
|
form = the FORM_ constant for the fanchart
|
||||||
|
angle_algo = alorithm to use to calculate the sizes of the boxes
|
||||||
|
dupcolor = color to use for people or families that occur a second or more time
|
||||||
"""
|
"""
|
||||||
self.rootpersonh = root_person_handle
|
self.rootpersonh = root_person_handle
|
||||||
self.generations = maxgen
|
self.generations = maxgen
|
||||||
@ -127,6 +129,7 @@ class FanChartDescWidget(FanChartBaseWidget):
|
|||||||
self.alpha_filter = alpha_filter
|
self.alpha_filter = alpha_filter
|
||||||
self.form = form
|
self.form = form
|
||||||
self.anglealgo = angle_algo
|
self.anglealgo = angle_algo
|
||||||
|
self.dupcolor = gui.utils.hex_to_rgb(dupcolor)
|
||||||
|
|
||||||
def gen_pixels(self):
|
def gen_pixels(self):
|
||||||
"""
|
"""
|
||||||
@ -518,7 +521,7 @@ class FanChartDescWidget(FanChartBaseWidget):
|
|||||||
else:
|
else:
|
||||||
#duplicate color
|
#duplicate color
|
||||||
a = 1
|
a = 1
|
||||||
r, g, b = (136, 138, 133)
|
r, g, b = self.dupcolor #(136, 138, 133)
|
||||||
# If max generation, and they have children:
|
# If max generation, and they have children:
|
||||||
if (not family and generation == self.generations - 1
|
if (not family and generation == self.generations - 1
|
||||||
and self._have_children(person)):
|
and self._have_children(person)):
|
||||||
@ -707,6 +710,6 @@ class FanChartDescGrampsGUI(FanChartGrampsGUI):
|
|||||||
self.fan.set_values(root_person_handle, self.maxgen, self.background,
|
self.fan.set_values(root_person_handle, self.maxgen, self.background,
|
||||||
self.fonttype, self.grad_start, self.grad_end,
|
self.fonttype, self.grad_start, self.grad_end,
|
||||||
self.generic_filter, self.alpha_filter, self.form,
|
self.generic_filter, self.alpha_filter, self.form,
|
||||||
self.angle_algo)
|
self.angle_algo, self.dupcolor)
|
||||||
self.fan.reset()
|
self.fan.reset()
|
||||||
self.fan.queue_draw()
|
self.fan.queue_draw()
|
||||||
|
@ -65,6 +65,7 @@ class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
|
|||||||
self.fonttype = 'Sans'
|
self.fonttype = 'Sans'
|
||||||
self.grad_start = '#0000FF'
|
self.grad_start = '#0000FF'
|
||||||
self.grad_end = '#FF0000'
|
self.grad_end = '#FF0000'
|
||||||
|
self.dupcolor = '#888A85' #light grey
|
||||||
self.generic_filter = None
|
self.generic_filter = None
|
||||||
self.alpha_filter = 0.2
|
self.alpha_filter = 0.2
|
||||||
self.form = FORM_HALFCIRCLE
|
self.form = FORM_HALFCIRCLE
|
||||||
|
@ -65,6 +65,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
('interface.color-start-grad', '#ef2929'),
|
('interface.color-start-grad', '#ef2929'),
|
||||||
('interface.color-end-grad', '#3d37e9'),
|
('interface.color-end-grad', '#3d37e9'),
|
||||||
('interface.angle-algorithm', fanchartdesc.ANGLE_WEIGHT),
|
('interface.angle-algorithm', fanchartdesc.ANGLE_WEIGHT),
|
||||||
|
('interface.duplicate-color', '#888a85')
|
||||||
)
|
)
|
||||||
def __init__(self, pdata, dbstate, uistate, nav_group=0):
|
def __init__(self, pdata, dbstate, uistate, nav_group=0):
|
||||||
self.dbstate = dbstate
|
self.dbstate = dbstate
|
||||||
@ -85,6 +86,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
self.grad_end = self._config.get('interface.color-end-grad')
|
self.grad_end = self._config.get('interface.color-end-grad')
|
||||||
self.form = self._config.get('interface.fanview-form')
|
self.form = self._config.get('interface.fanview-form')
|
||||||
self.angle_algo = self._config.get('interface.angle-algorithm')
|
self.angle_algo = self._config.get('interface.angle-algorithm')
|
||||||
|
self.dupcolor = self._config.get('interface.duplicate-color')
|
||||||
self.generic_filter = None
|
self.generic_filter = None
|
||||||
self.alpha_filter = 0.2
|
self.alpha_filter = 0.2
|
||||||
|
|
||||||
@ -266,7 +268,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
"""
|
"""
|
||||||
Function that builds the widget in the configuration dialog
|
Function that builds the widget in the configuration dialog
|
||||||
"""
|
"""
|
||||||
nrentry = 7
|
nrentry = 8
|
||||||
table = Gtk.Table(6, 3)
|
table = Gtk.Table(6, 3)
|
||||||
table.set_border_width(12)
|
table.set_border_width(12)
|
||||||
table.set_col_spacings(6)
|
table.set_col_spacings(6)
|
||||||
@ -308,15 +310,17 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
'interface.color-start-grad', col=1)
|
'interface.color-start-grad', col=1)
|
||||||
configdialog.add_color(table, _('End gradient/2nd color'), 4,
|
configdialog.add_color(table, _('End gradient/2nd color'), 4,
|
||||||
'interface.color-end-grad', col=1)
|
'interface.color-end-grad', col=1)
|
||||||
|
configdialog.add_color(table, _('Color for duplicates'), 5,
|
||||||
|
'interface.duplicate-color', col=1)
|
||||||
# form of the fan
|
# form of the fan
|
||||||
configdialog.add_combo(table, _('Fan chart type'), 5,
|
configdialog.add_combo(table, _('Fan chart type'), 6,
|
||||||
'interface.fanview-form',
|
'interface.fanview-form',
|
||||||
((fanchart.FORM_CIRCLE, _('Full Circle')),
|
((fanchart.FORM_CIRCLE, _('Full Circle')),
|
||||||
(fanchart.FORM_HALFCIRCLE, _('Half Circle')),
|
(fanchart.FORM_HALFCIRCLE, _('Half Circle')),
|
||||||
(fanchart.FORM_QUADRANT, _('Quadrant'))),
|
(fanchart.FORM_QUADRANT, _('Quadrant'))),
|
||||||
callback=self.cb_update_form)
|
callback=self.cb_update_form)
|
||||||
# algo for the fan angle distribution
|
# algo for the fan angle distribution
|
||||||
configdialog.add_combo(table, _('Fan chart distribution'), 6,
|
configdialog.add_combo(table, _('Fan chart distribution'), 7,
|
||||||
'interface.angle-algorithm',
|
'interface.angle-algorithm',
|
||||||
((fanchartdesc.ANGLE_CHEQUI,
|
((fanchartdesc.ANGLE_CHEQUI,
|
||||||
_('Homogeneous children distribution')),
|
_('Homogeneous children distribution')),
|
||||||
@ -337,6 +341,8 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
self.cb_update_color)
|
self.cb_update_color)
|
||||||
self._config.connect('interface.color-end-grad',
|
self._config.connect('interface.color-end-grad',
|
||||||
self.cb_update_color)
|
self.cb_update_color)
|
||||||
|
self._config.connect('interface.duplicate-color',
|
||||||
|
self.cb_update_color)
|
||||||
|
|
||||||
def cb_update_maxgen(self, spinbtn, constant):
|
def cb_update_maxgen(self, spinbtn, constant):
|
||||||
self.maxgen = spinbtn.get_value_as_int()
|
self.maxgen = spinbtn.get_value_as_int()
|
||||||
@ -370,6 +376,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
|
|||||||
"""
|
"""
|
||||||
self.grad_start = self._config.get('interface.color-start-grad')
|
self.grad_start = self._config.get('interface.color-start-grad')
|
||||||
self.grad_end = self._config.get('interface.color-end-grad')
|
self.grad_end = self._config.get('interface.color-end-grad')
|
||||||
|
self.dupcolor = self._config.get('interface.duplicate-color')
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def cb_update_font(self, obj, constant):
|
def cb_update_font(self, obj, constant):
|
||||||
|
Loading…
Reference in New Issue
Block a user