]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Removed minimum size hint since we have zooming anyway.
authorSebastian Trueg <sebastian@trueg.de>
Tue, 1 Apr 2008 09:19:34 +0000 (09:19 +0000)
committerSebastian Trueg <sebastian@trueg.de>
Tue, 1 Apr 2008 09:19:34 +0000 (09:19 +0000)
One problem persists: the heightForWidth method does not take zooming
into account. Anyway, the tagcloud would probably benefit from being
implemented using QGraphicsView (any volounteers? ;)

BUG: 160159

svn path=/trunk/KDE/kdebase/apps/; revision=792475

src/tagcloud/resourcetaggingwidget.cpp
src/tagcloud/tagcloud.cpp

index e7d6dfa787bed1be9a80960fe03912b0baaac988..b67e8f47de8812518f2250ae72caea6647f86687 100644 (file)
@@ -24,7 +24,7 @@
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QContextMenuEvent>
 #include <QtGui/QCursor>
-#include <QtGui/QAction>
+#include <QtGui/QLabel>
 
 #include <KLocale>
 
@@ -39,8 +39,6 @@ public:
 
     QList<Tag> resourceTags;
 
-    QAction* changeTagsAction;
-
     void showTaggingPopup( const QPoint& );
     void _k_slotShowTaggingPopup();
 };
@@ -74,9 +72,10 @@ Nepomuk::ResourceTaggingWidget::ResourceTaggingWidget( QWidget* parent )
     layout->setMargin( 0 );
     d->resourceTagCloud = new TagCloud( this );
     layout->addWidget( d->resourceTagCloud );
-
-    d->changeTagsAction = new QAction( i18n( "Change tags..." ), this );
-    d->resourceTagCloud->setCustomNewTagAction( d->changeTagsAction );
+    QLabel* changeTagsLabel = new QLabel( "<p align=center><a style=\"font-size:small;\" href=\"dummy\">" + i18n( "Change tags..." ) + "</a>", this );
+    connect( changeTagsLabel, SIGNAL( linkActivated( const QString ) ),
+             this, SLOT( _k_slotShowTaggingPopup() ) );
+    layout->addWidget( changeTagsLabel );
 
     // the popup tag cloud
     d->popup = new TaggingPopup;
@@ -88,9 +87,6 @@ Nepomuk::ResourceTaggingWidget::ResourceTaggingWidget( QWidget* parent )
     connect( d->popup, SIGNAL( tagAdded( const Nepomuk::Tag& ) ),
              this, SLOT( slotTagAdded( const Nepomuk::Tag& ) ) );
 
-    connect( d->changeTagsAction, SIGNAL( activated() ),
-             this, SLOT( _k_slotShowTaggingPopup() ) );
-
     connect( d->resourceTagCloud, SIGNAL( tagClicked( const Nepomuk::Tag& ) ),
              this, SIGNAL( tagClicked( const Nepomuk::Tag& ) ) );
 }
index 8fe5cba891980b0497e791131f2b293ce0ab96a4..f22a39aa20c79514ad5a0c1f24a4ff551c1db8b1 100644 (file)
@@ -732,6 +732,7 @@ QSize Nepomuk::TagCloud::sizeHint() const
 
 QSize Nepomuk::TagCloud::minimumSizeHint() const
 {
+    return QFrame::minimumSizeHint();
     // If we have tags d->rebuildCloud() has been called at least once,
     // thus, we have proper rects (i.e. needed sizes)
     if ( d->nodes.isEmpty() && !d->newTagButtonEnabled ) {
@@ -760,6 +761,8 @@ int Nepomuk::TagCloud::heightForWidth( int contentsWidth ) const
     // If we have tags d->rebuildCloud() has been called at least once,
     // thus, we have proper rects (i.e. needed sizes)
 
+    // FIXME: add zoom here
+
     if ( d->cachedHfwWidth != contentsWidth ) {
         // have to keep in mind the frame
         contentsWidth -= frameWidth()*2;