[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kfile
From:       Rafael Fernández López <ereslibre () kde ! org>
Date:       2008-10-03 8:13:21
Message-ID: 1223021601.473461.5291.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 867252 by ereslibre:

Update slider when changing between views


 M  +4 -2      kdiroperator.cpp  
 M  +8 -0      kdiroperator.h  
 M  +2 -0      kfilewidget.cpp  


--- trunk/KDE/kdelibs/kfile/kdiroperator.cpp #867251:867252
@@ -1529,8 +1529,6 @@
     // needs to be done here, and not in createView, since we can be set an external \
view  d->decorationMenu->setEnabled(qobject_cast<QListView*>(d->itemView));
 
-    d->iconZoom = d->iconSizeForViewType(view);
-
     d->previewGenerator = new KFilePreviewGenerator(d->itemView, \
static_cast<QAbstractProxyModel*>(d->itemView->model()));  int maxSize = \
KIconLoader::SizeEnormous;  int val = maxSize * d->iconZoom / 100;
@@ -1542,6 +1540,10 @@
     d->_k_slotChangeDecorationPosition();
 
     emit viewChanged(view);
+
+    const int zoom = d->iconSizeForViewType(view);
+    // this will make d->iconZoom be updated, since changeIconsSize slot will be \
called +    emit currentIconSizeChanged(zoom);
 }
 
 void KDirOperator::setDirLister(KDirLister *lister)
--- trunk/KDE/kdelibs/kfile/kdiroperator.h #867251:867252
@@ -810,6 +810,14 @@
      */
     void contextMenuAboutToShow(const KFileItem& item, QMenu* menu);
 
+    /**
+     * Will notify that the icon size has changed. Since we save the icon size \
depending +     * on the view type (list view or a different kind of view), a call to \
setView() can +     * trigger this signal to be emitted.
+     * @since 4.2
+     */
+    void currentIconSizeChanged(int size);
+
 private:
     class Private;
     Private* const d;
--- trunk/KDE/kdelibs/kfile/kfilewidget.cpp #867251:867252
@@ -462,6 +462,8 @@
     iconSizeSlider->setMaximum(100);
     connect(iconSizeSlider, SIGNAL(valueChanged(int)),
             d->ops, SLOT(changeIconsSize(int)));
+    connect(d->ops, SIGNAL(currentIconSizeChanged(int)),
+            iconSizeSlider, SLOT(setValue(int)));
 
     KActionMenu *zoom = new KActionMenu( KIcon("zoom-fit-best"), i18n("Icon Size"), \
this);  zoom->setDelayed( false );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic