]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphiniconsview.cpp
assure that the widgets of the panels are resized after receiving the Polish event
[dolphin.git] / src / dolphiniconsview.cpp
index bd070ad1c7dfa9adf7117a6ea96d10e44f54af0f..a8188d9717e09fc0264df175cf2c164f0a775440 100644 (file)
@@ -146,6 +146,7 @@ QStyleOptionViewItem DolphinIconsView::viewOptions() const
 {
     QStyleOptionViewItem viewOptions = KCategorizedView::viewOptions();
     viewOptions.font = m_font;
+    viewOptions.fontMetrics = QFontMetrics(m_font);
     viewOptions.decorationPosition = m_decorationPosition;
     viewOptions.decorationSize = m_decorationSize;
     viewOptions.displayAlignment = m_displayAlignment;
@@ -199,12 +200,14 @@ void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
 
 void DolphinIconsView::dragLeaveEvent(QDragLeaveEvent* event)
 {
-    Q_UNUSED(event);
+    KCategorizedView::dragLeaveEvent(event);
     setDirtyRegion(m_dropRect);
 }
 
 void DolphinIconsView::dragMoveEvent(QDragMoveEvent* event)
 {
+    KCategorizedView::dragMoveEvent(event);
+
     // TODO: remove this code when the issue #160611 is solved in Qt 4.4
     const QModelIndex index = indexAt(event->pos());
     setDirtyRegion(m_dropRect);
@@ -231,6 +234,8 @@ void DolphinIconsView::dropEvent(QDropEvent* event)
     const QModelIndex index = indexAt(event->pos());
     const KFileItem item = m_controller->itemForIndex(index);
     m_controller->indicateDroppedUrls(item, m_controller->url(), event);
+    // don't call KCategorizedView::dropEvent(event), as it moves
+    // the items which is not wanted
 }
 
 QModelIndex DolphinIconsView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
@@ -314,14 +319,8 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
 
 void DolphinIconsView::wheelEvent(QWheelEvent* event)
 {
-    // let Ctrl+wheel events propagate to the DolphinView for icon zooming
-    if (event->modifiers() & Qt::ControlModifier) {
-        event->ignore();
-        return;
-    }
-
-    horizontalScrollBar()->setSingleStep(m_itemSize.width() / 10);
-    verticalScrollBar()->setSingleStep(m_itemSize.height() / 10);
+    horizontalScrollBar()->setSingleStep(m_itemSize.width() / 5);
+    verticalScrollBar()->setSingleStep(m_itemSize.height() / 5);
 
     KCategorizedView::wheelEvent(event);
     // if the icons are aligned left to right, the vertical wheel event should