]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/19.12'
authorNate Graham <nate@kde.org>
Sat, 21 Dec 2019 18:54:53 +0000 (11:54 -0700)
committerNate Graham <nate@kde.org>
Sat, 21 Dec 2019 18:54:53 +0000 (11:54 -0700)
1  2 
src/kitemviews/kitemlistcontainer.cpp
src/kitemviews/kitemlistview.cpp
src/kitemviews/kitemlistview.h

index a3cafc83853f327c0dc9ac04aeb7ab769f6adbfe,b274e75e2f0c18617f193a7a07cacb3f00046e80..6279b15a994baf8f0f7579f57aa47a981ccf584d
@@@ -1,7 -1,8 +1,7 @@@
  /***************************************************************************
   *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
   *                                                                         *
 - *   Based on the Itemviews NG project from Trolltech Labs:                *
 - *   http://qt.gitorious.org/qt-labs/itemviews-ng                          *
 + *   Based on the Itemviews NG project from Trolltech Labs                 *
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
@@@ -26,6 -27,7 +26,7 @@@
  #include "private/kitemlistsmoothscroller.h"
  
  #include <QApplication>
+ #include <QFontMetrics>
  #include <QGraphicsScene>
  #include <QGraphicsView>
  #include <QScrollBar>
@@@ -260,7 -262,14 +261,14 @@@ void KItemListContainer::updateScrollOf
      if (view->scrollOrientation() == Qt::Vertical) {
          smoothScroller = m_verticalSmoothScroller;
          scrollOffsetScrollBar = verticalScrollBar();
-         singleStep = view->itemSizeHint().height();
+         // Don't scroll super fast when using a wheel mouse:
+         // We want to consider one "line" to be the text label which has a
+         // roughly fixed height rather than using the height of the icon which
+         // may be very tall
+         const QFontMetrics metrics(font());
+         singleStep = metrics.height() * QApplication::wheelScrollLines();
          // We cannot use view->size().height() because this height might
          // include the header widget, which is not part of the scrolled area.
          pageStep = view->verticalPageStep();
index 5dd21615eb50a68a7d38bac8a375d23cd94886b7,e64e226ab70c2328e8363fe4cb056b047c32acdd..5665d9b9cfea918f29787db5b342c483020b0906
@@@ -1,7 -1,8 +1,7 @@@
  /***************************************************************************
   *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
   *                                                                         *
 - *   Based on the Itemviews NG project from Trolltech Labs:                *
 - *   http://qt.gitorious.org/qt-labs/itemviews-ng                          *
 + *   Based on the Itemviews NG project from Trolltech Labs                 *
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
@@@ -334,11 -335,6 +334,6 @@@ QSizeF KItemListView::itemSize() cons
      return m_itemSize;
  }
  
- QSizeF KItemListView::itemSizeHint() const
- {
-     return m_sizeHintResolver->minSizeHint();
- }
  const KItemListStyleOption& KItemListView::styleOption() const
  {
      return m_styleOption;
index 982df1c20d891a5db13f0f9dfc99108b86ecd302,3dff35a63276f4a0c493838708d4453ef2849a8f..2a3b7ada27569f3e4544936b158a801384d398f3
@@@ -1,7 -1,8 +1,7 @@@
  /***************************************************************************
   *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
   *                                                                         *
 - *   Based on the Itemviews NG project from Trolltech Labs:                *
 - *   http://qt.gitorious.org/qt-labs/itemviews-ng                          *
 + *   Based on the Itemviews NG project from Trolltech Labs                 *
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
@@@ -157,11 -158,6 +157,6 @@@ public
       */
      QSizeF itemSize() const;
  
-     /**
-      * @return The size hint of all items. It is provided by the KItemListSizeHintResolver.
-      */
-     QSizeF itemSizeHint() const;
      const KItemListStyleOption& styleOption() const;
  
      void setGeometry(const QRectF& rect) override;