Il 18/11/2012 14:02, Cristian Onet, ha scritto:

În ziua de Sîm 17 Noi 2012, la 14:30:06, Alessandro Russo a scris:

I'll fix it properly as soon as possible.

I think that this solution [1] is acceptable. If we now have rich text drawing we can improve the ledger further by adding rich text markers including icons, any suggestions?

[1] http://commits.kde.org/kmymoney/889c099c8fc8cfc5c972a7b6a74af8e5ae580515

--


Hi Cristian,
yesterday my UPS died and took with itself the power supply of my pc so I couldn't open a new review request in the reviewboard.

My fix is this:
-----------
    QAbstractTextDocumentLayout::PaintContext ctx;
    ctx.palette = option.palette;
    // Highlighting text if item is selected
    if (m_selected)
ctx.palette.setColor(QPalette::Text, option.palette.color(QPalette::Active, QPalette::HighlightedText));

    QTextDocument document;
    document.setHtml(txt);
// adjust the text rectangle to obtain a reasonable spacing between the text and the grid
    painter->translate(option.rect.adjusted(2, 0, -2, 0).topLeft());
    document.documentLayout()->draw(painter, ctx);
    painter->translate(-option.rect.adjusted(2, 0, -2, 0).topLeft());
------------

Choose whatever do you prefer.

Ciao,
 Alessandro

_______________________________________________
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel

Reply via email to