1. 6848: citationtreeview corrupts when search bar open and edit occurs
2. avoid critical gdk error by processing events only when window visible :
Gdk-CRITICAL **: gdk_error_trap_pop_internal: assertion `trap != NULL' failed
3. In case of errors with fg_color, enormous amount of error messages. This patch
grabs wrong fg_color, and skips action, avoiding the error messages. Error goes to debug.
svn: r22610
So that they're together with the other resources instead of in
site-package/gramps. Aside from a better source and installation
layout, this makes it easier to bundle them.
svn: r22576
Use math.degrees() / math.radians() where able
Follow-up to CR by Benny:
Removed redundant forced conversion to float, the
from future import division
handles that already. See PEP-238 for details.
draw_text:
Remove manual layout wrapping, use pango Layout logic.
Refactored wrap_truncate_layout from draw_arc_text,
and it's now reused in draw_text, here with CHAR
wrapping mode as opposed to WORD in draw_arc_text.
This replaces the (Unicode-wrong) implementation of
manual char-by-char code with text truncation.
svn: r22569
gramps/gui/utilscairo.py:
new file, currently holds just the warpPath() function,
taken from /usr/share/doc/python-cairo/examples/warpedtext.py,
with explanatory docs added.
gramps/gui/widgets/fanchart.py, class FanChartBaseWidget:
draw_text() method:
previous logic using cairo toy text API didn't support CTL text.
It has been removed, and replaced with a call to a new
method, draw_arc_text().
Flagged a subtle Unicode issue in the remaining old code,
for radial-oriented text, with a FIXME, I'll probably fix it
later as a separate issue.
create_map_rect_to_sector() static method:
create a transform to use with gui.utilscairo.warpPath(),
currently used in draw_arc_text().
Following Benny's code review I have annotated the algorithm
and made it hopefully clear, but I guess it could be reworked
into a better form if re-expressed with stacked transforms /
complex numbers / matrices for easier later maintenance.
Meanwhile I have used the same approach as the older code
in the file, good enough for a patch under this feature request.
The only issue remaining from the code review is whether
the create_map_rect_to_sector() function should be moved
to gui.utilscairo; see the bug thread.
svn: r22548