Bug 127584

Summary: minimum width of sidebar too large
Product: [Applications] digikam Reporter: Daniel Bauer <linux>
Component: Usability-ErgonomyAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: caulier.gilles
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.0
Sentry Crash Report:

Description Daniel Bauer 2006-05-18 14:31:19 UTC
Version:           0.9.0 svn (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs
OS:                Linux

in the new version the sidebars in the album view have a much larger minimum width than before. I understand, that it is desired that the new infos can be displayed, but expecially the right sidebar takes very much space for it self.

Is it possible to remove this restriction, so I can freely size the width as I'd like to? Or at least make the minimum as small as it was in 0.8.1?

In most cases for example one knows what keywords one has and so it is sufficient to see only the beginning of the words and if they are selected. In 0.8.1 I can have 4 medium size preview pictures per line plus left and right sidebars open on a 19" screen. No I can have only 3, which makes the list 25% longer and less comfortable to overview, especially with large amounts of pictures in one album.

Switching the sidebar away and only display it when needed is no solution, because then the album view gets refreshed every time. This takes a long time, and then one has to scroll down to search the actual picture again (even when it was selected).
Comment 1 caulier.gilles 2006-05-18 16:20:16 UTC
This width restriction is given by the GPS map pixmap. 

In the future, we wil add a real world map using a scrollview. This will remove this restriction

Gilles
Comment 2 Jens 2006-06-26 11:24:42 UTC
I was going to add this bug too, because I find it is a major annoyance.

Do you think this can be fixed before beta1 by converting the GPS map to a "zoomable" one? Does a Qt object exist that can do that?

If yes, I will have a look at it.

Jens
Comment 3 caulier.gilles 2006-06-26 11:43:19 UTC
No, zoomable GPS map is a big task. delayed later 0.9.0. Sorry...

Gilles
Comment 4 Jens 2006-06-26 21:17:12 UTC
Hm.. is it possible to just remove the minimum size limitation, so that the GPS map (which is not useable right now anyway) will just be partially visible? I think more space is needed for pictures, than for the map, especially with lower resolutions (at 1024x768, opening both sidebars leaves only one or two columns of pictures in the middle).

Jens
Comment 5 caulier.gilles 2006-06-26 21:34:49 UTC
yes of course. Actually the lenght of the map is 256 pixed (fixed). Try to use other values (look in gpswidget.cpp), and give me a feedback. Take acare that the map need to be suitable of course.

You can find some JPEG pictures including GPS coordinates in my repository :

http://digikam3rdparty.free.fr/TEST_IMAGES/METADATA/

Gilles
Comment 6 caulier.gilles 2006-06-27 07:54:15 UTC
SVN commit 555353 by cgilles:

digikam from trunk : GPSWidget : size of map is 256*128 instead 300*150 to reduce at minimum lenght of right sidebar. We cannot reduce again this size because this is dependiong of histogram size now from Color tab. This is suitable and enought for 0.9.0.

Later 0.9.0 release a new GPS position editor will be add and the map in sidebar will use a QScrollView 

CCMAIL: digikam-devel@kde.org
BUG: 127584

 M  +33 -13    worldmapwidget.cpp  
 M  +4 -5      worldmapwidget.h  


--- trunk/extragear/graphics/digikam/libs/widgets/metadata/worldmapwidget.cpp #555352:555353
@@ -23,6 +23,7 @@
 #include <qimage.h>
 #include <qpainter.h>
 #include <qstring.h>
+#include <qpixmap.h>
 
 // KDE includes.
 
@@ -37,43 +38,62 @@
 namespace Digikam
 {
 
-WorldMapWidget::WorldMapWidget( QWidget *parent, const char *name )
-              : QWidget( parent, name ), m_latitude( 0 ), m_longitude( 0 )
+class WorldMapWidgetPriv
 {
+
+public:
+
+    WorldMapWidgetPriv()
+    {
+        latitude  = 0;
+        longitude = 0;
+    }
+
+    double  latitude;
+    double  longitude;
+
+    QPixmap worldMap;
+};
+
+WorldMapWidget::WorldMapWidget( QWidget *parent, const char *name, int mapLenght )
+              : QWidget( parent, name )
+{
+    d = new WorldMapWidgetPriv;
     KGlobal::dirs()->addResourceType("worldmap", KGlobal::dirs()->kde_default("data") + "digikam/data");
     QString directory = KGlobal::dirs()->findResourceDir("worldmap", "worldmap.png");
     QImage map(directory + "worldmap.png");
-    m_worldMap = QPixmap(map.scale(300, 150));
+    d->worldMap = QPixmap(map.scale(mapLenght, mapLenght/2));
     
     setBackgroundMode( Qt::NoBackground );
-    setFixedSize( m_worldMap.size() );
+    setFixedSize( d->worldMap.size() );
     update();
 }
 
 WorldMapWidget::~WorldMapWidget()
 {
+    delete d;
 }
 
 double WorldMapWidget::getLatitude(void)
 {
-    return m_latitude;
+    return d->latitude;
 }
 
 double WorldMapWidget::getLongitude(void)
 {
-    return m_longitude;
+    return d->longitude;
 }
 
 void WorldMapWidget::setGPSPosition(double lat, double lng)
 {
-    m_latitude  = lat;
-    m_longitude = lng;
+    d->latitude  = lat;
+    d->longitude = lng;
     repaint(false);
 }
 
 void WorldMapWidget::paintEvent( QPaintEvent* )
 {
-    QPixmap pm( m_worldMap );
+    QPixmap pm( d->worldMap );
 
     if (isEnabled())
     {
@@ -81,13 +101,13 @@
         p.begin( &pm, this );
     
         double latMid  = height() / 2.0;
-        double longMid = width() / 2.0;
+        double longMid = width()  / 2.0;
         
-        double latOffset  = ( m_latitude * latMid ) / 90.0;
-        double longOffset = ( m_longitude * longMid ) / 180.0;
+        double latOffset  = ( d->latitude  * latMid )  / 90.0;
+        double longOffset = ( d->longitude * longMid ) / 180.0;
     
         int xPos = (int)(longMid + longOffset);
-        int yPos = (int)(latMid - latOffset);
+        int yPos = (int)(latMid  - latOffset);
     
         p.setPen(QPen(Qt::white, 0, Qt::SolidLine));
         p.drawLine(xPos, 0, xPos, height());
--- trunk/extragear/graphics/digikam/libs/widgets/metadata/worldmapwidget.h #555352:555353
@@ -24,7 +24,6 @@
 // Qt includes.
 
 #include <qwidget.h>
-#include <qpixmap.h>
 
 // Local includes
 
@@ -33,13 +32,15 @@
 namespace Digikam
 {
 
+class WorldMapWidgetPriv;
+
 class DIGIKAM_EXPORT WorldMapWidget : public QWidget
 {
 Q_OBJECT
 
 public:
 
-    WorldMapWidget( QWidget *parent, const char *name = 0 );
+    WorldMapWidget( QWidget *parent, const char *name = 0, int mapLenght=256 );
     ~WorldMapWidget();
 
     void setGPSPosition(double lat, double lng);
@@ -53,10 +54,8 @@
 
 private:
 
-    double m_latitude;
-    double m_longitude;
+    WorldMapWidgetPriv *d;
 
-    QPixmap m_worldMap;
 };
 
 }  // namespace Digikam