Bug 93213

Summary: Konqueror should surround web page regions of not-yet-loaded bitmaps/images with a temporary frame
Product: [Applications] konqueror Reporter: Helge Deller <deller>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: 3.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: patch which enables this (can be enabled/disabled by KHTML configuration)

Description Helge Deller 2004-11-13 18:12:59 UTC
Version:           3.3 (using KDE 3.3.89 (CVS >= 20041104), compiled sources)
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.4-52-default

When you compare Mozilla & Konqueror Mozilla IMHO sometimes seems faster, since it shows a gray frame with a very small graphic bitmap in the left upper corner where a image (gif/png) should show up and which still needs to be loaded.

This user-feedback is IMHO very good, since then I would be able to see which parts are not yet loaded and why the konqueror-wheel still spins although the webpage already seems completely loaded.
Comment 1 Helge Deller 2004-12-12 18:48:49 UTC
Created attachment 8634 [details]
patch which enables this (can be enabled/disabled by KHTML configuration)

this patch is a first draft to fix this feature.
The configuration entry "UnfinishedImageFrame" enables/disables this feature.
A patch to kcontrol to check this value with GUI is still missing..
Comment 2 Helge Deller 2004-12-22 22:19:34 UTC
CVS commit by deller: 

show frames around not yet fully loaded images; this feature is off by default right now (was this the result on kfm-devel or should I turn it on by default?)
Germain Garand's "contrast detection enhancement" is not applied with this commit yet, neither is the "inset enhancement" by Leo (would you please apply as you like...)
CCMAIL: Germain Garand <germain@ebooksfrance.org>, Leo Savernik <l.savernik@aon.at>
FEATURE: 93213


  M +9 -0      kdebase/kcontrol/konqhtml/htmlopts.cpp   1.88
  M +1 -0      kdebase/kcontrol/konqhtml/htmlopts.h   1.36
  M +9 -0      kdelibs/khtml/khtml_settings.cc   1.108
  M +1 -0      kdelibs/khtml/khtml_settings.h   1.43
  M +12 -0     kdelibs/khtml/rendering/render_image.cpp   1.139
  M +1 -0      kdelibs/khtml/rendering/render_image.h   1.57



Comment 3 Leo Savernik 2004-12-22 23:18:32 UTC
IMO, the option should be off by default.
Comment 4 Leo Savernik 2004-12-23 19:30:20 UTC
CVS commit by savernik: 

Added image loading indicator icon to Helge's image loading frame patch.

By discussion with Germain, it is grayscale. Additionally, I've given it a
50% transparency to make it even less intrusive.

CCMAIL: 93213@bugs.kde.org, germain@ebooksfrance.org


  A            pics/img-loading.png   1.1
  A            rendering/loading_icon.cpp   1.1 [no copyright]
  M +3 -0      rendering/Makefile.am   1.38
  M +11 -0     rendering/render_image.cpp   1.140


--- kdelibs/khtml/rendering/Makefile.am  #1.37:1.38
@@ -50,3 +50,6 @@
         kdoc -H -d $(SRCDOC_DEST) kdecore -lqt
 
+## maintainer: regen loading icon
+loading-icon:
+        bin2c -sploading_icon $(srcdir)/../pics/img-loading.png > $(srcdir)/loading_icon.cpp
 

--- kdelibs/khtml/rendering/render_image.cpp  #1.139:1.140
@@ -50,4 +50,6 @@
 #include <math.h>
 
+#include "loading_icon.cpp"
+
 using namespace DOM;
 using namespace khtml;
@@ -239,7 +241,16 @@ void RenderImage::paint(PaintInfo& paint
     // 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(QPen(Qt::gray, 1));
         paintInfo.p->setBrush( Qt::NoBrush );
         paintInfo.p->drawRect(_tx, _ty, m_width, m_height);
+        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);
+        }
+        
     }
 


Comment 5 Germain Garand 2004-12-24 03:25:11 UTC
CVS commit by ggarand: 

use contrast detection for determining the loading-image-frame color, 
so that it is visible on every background.

CCBUG:  93213


  M +71 -0     misc/helper.cpp   1.59
  M +6 -0      misc/helper.h   1.19
  M +4 -1      rendering/render_image.cpp   1.141
  M +3 -71     rendering/render_text.cpp   1.259