KHTML-Patch - show frame around not-yet-loaded images

Leo Savernik l.savernik at aon.at
Thu Dec 16 21:42:41 GMT 2004


Am Mittwoch, 15. Dezember 2004 12:30 schrieb Leo Savernik:
> Am Mittwoch, 15. Dezember 2004 01:59 schrieb Germain Garand:
> > So I'd definetly recommend:
> > -         outlineBox(paintInfo.p, _tx, _ty, "gray");
> > +        paintInfo.p->setPen(QPen(Qt::gray, 1));
> > +        paintInfo.p->setBrush( Qt::NoBrush );
> > +        paintInfo.p->drawRect(_tx, _ty, m_width, m_height);
> >
> > Otherwise, I'd even like this by default :-)
>
> Hmm, it'd better display an inset like IE does.

To pour more gas into the fire, here's my mozillated inset implementation:

    // paint frame around image as long as it is not completely loaded from 
web.
    if (bUnfinishedImageFrame && paintInfo.phase == PaintActionForeground && 
cWidth > 2 && cHeight > 2 && !complete()) {
        static QPixmap *loadingIcon;
        paintInfo.p->setPen(QColor(128, 128, 128));
 paintInfo.p->drawLine(_tx, _ty, _tx + m_width - 1, _ty);
 paintInfo.p->drawLine(_tx, _ty + 1, _tx, _ty + m_height - 1);
        paintInfo.p->setPen(QColor(232, 232, 232));
 paintInfo.p->drawLine(_tx + m_width - 1, _ty + 1, _tx + m_width - 1, _ty + 
m_height - 1);
 paintInfo.p->drawLine(_tx + 1, _ty + m_height - 1, _tx + m_width - 1, _ty + 
m_height - 1);
 if (!(m_width <= 5 || m_height <= 5)) {
     if (!loadingIcon) {
         loadingIcon = new QPixmap();
  loadingIcon->loadFromData(loading_icon_data, loading_icon_len);
     }
     paintInfo.p->drawPixmap(_tx + 4, _ty + 4, *loadingIcon, 0, 0, m_width - 
5, m_height - 5);
 }
    }


See screenshot. The inset solves the uglyness of two adjacent borders.

mfg
 Leo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: img_placeholders.png
Type: image/png
Size: 1475 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041216/72f54a3c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041216/72f54a3c/attachment.sig>


More information about the kfm-devel mailing list