Summary: | minimum width of sidebar too large | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Daniel Bauer <linux> |
Component: | Usability-Ergonomy | Assignee: | 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
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 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 No, zoomable GPS map is a big task. delayed later 0.9.0. Sorry... Gilles 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 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 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 |