]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix minor visual issues in the view-engine
authorPeter Penz <peter.penz19@gmail.com>
Thu, 27 Oct 2011 20:34:33 +0000 (22:34 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 27 Oct 2011 20:36:47 +0000 (22:36 +0200)
- Increasing the window-size should not result in increasing the
  size from previously invisible items
- Rename group 'Numerics' to '0 - 9'
- Fix "damaged" icons when changing the view-sizes or changing the
  view-mode

src/kitemviews/kfileitemlistwidget.cpp
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kitemlistview.cpp
src/kitemviews/kpixmapmodifier.cpp

index f6039b7a59153c23e6ff69bbb0d311253bdc09dd..5f659a1f618c877d977f539508219db6c466369d 100644 (file)
@@ -694,7 +694,7 @@ void KFileItemListWidget::updateAdditionalInfoTextColor()
     // is not used as this might lead to unreadable text for some color schemes. Instead
     // the text color is slightly mixed with the background color.
     const QColor c1 = textColor();
-    const QColor c2 = styleOption().palette.background().color();
+    const QColor c2 = styleOption().palette.base().color();
     const int p1 = 70;
     const int p2 = 100 - p1;
     m_additionalInfoTextColor = QColor((c1.red()   * p1 + c2.red()   * p2) / 100,
index 5ccca5a94b56a6ecef22f4240c7ac49ca48b15aa..27265487214efdb4eb98316c9d235f3bd447e624 100644 (file)
@@ -1190,13 +1190,15 @@ QList<QPair<int, QVariant> > KFileItemModel::nameRoleGroups() const
                 newGroupValue = newFirstChar;
                 isLetter = true;
             } else if (newFirstChar >= QLatin1Char('0') && newFirstChar <= QLatin1Char('9')) {
-                // Apply group 'Numerics' for any name that starts with a digit
-                newGroupValue = i18nc("@title:group", "Numerics");
+                // Apply group '0 - 9' for any name that starts with a digit
+                newGroupValue = i18nc("@title:group Groups that start with a digit", "0 - 9");
                 isLetter = false;
             } else {
                 if (isLetter) {
                     // If the current group is 'A' - 'Z' check whether a locale character
                     // fits into the existing group.
+                    // TODO: This does not work in the case if e.g. the group 'O' starts with
+                    // an umlaut 'O' -> provide unit-test to document this known issue
                     const QChar prevChar(firstChar.unicode() - ushort(1));
                     const QChar nextChar(firstChar.unicode() + ushort(1));
                     const QString currChar(newFirstChar);
index 84b8440847f2c35b41f184d06843b0a268f72bda..478bf62603de3b0b481815e33b7ad6a93d023191 100644 (file)
@@ -1423,8 +1423,9 @@ void KItemListView::prepareLayoutForIncreasedItemCount(const QSizeF& size, SizeT
         for (int i = minFirst; i <= maxLast; ++i) {
             if (!m_visibleItems.contains(i)) {
                 KItemListWidget* widget = createWidget(i);
-                const QPointF pos = m_layouter->itemRect(i).topLeft();
-                widget->setPos(pos);
+                const QRectF itemRect = m_layouter->itemRect(i);
+                widget->setPos(itemRect.topLeft());
+                widget->resize(itemRect.size());
             }
         }
         setLayouterSize(size, sizeType);
index 07c5286d7c41f4fb037f2594eeb53d69550f2185..f6838c032696c205ef55fbbef267b956f9aec26a 100644 (file)
@@ -327,13 +327,19 @@ namespace {
 
 void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
 {
+    if (scaledSize.isEmpty()) {
+        pixmap = QPixmap();
+        return;
+    }
+
 #if defined(Q_WS_X11) && defined(HAVE_XRENDER)
     // Assume that the texture size limit is 2048x2048
     if ((pixmap.width() <= 2048) && (pixmap.height() <= 2048) && pixmap.x11PictureHandle()) {
+        const QPixmap unscaledPixmap = pixmap.copy(); // Make a deep copy for XRender
         QSize scaledPixmapSize = pixmap.size();
         scaledPixmapSize.scale(scaledSize, Qt::KeepAspectRatio);
 
-        const qreal factor = scaledPixmapSize.width() / qreal(pixmap.width());
+        const qreal factor = scaledPixmapSize.width() / qreal(unscaledPixmap.width());
 
         XTransform xform = {{
             { XDoubleToFixed(1 / factor), 0, 0 },
@@ -348,11 +354,11 @@ void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
 
         XRenderPictureAttributes attr;
         attr.repeat = RepeatPad;
-        XRenderChangePicture(dpy, pixmap.x11PictureHandle(), CPRepeat, &attr);
+        XRenderChangePicture(dpy, unscaledPixmap.x11PictureHandle(), CPRepeat, &attr);
 
-        XRenderSetPictureFilter(dpy, pixmap.x11PictureHandle(), FilterBilinear, 0, 0);
-        XRenderSetPictureTransform(dpy, pixmap.x11PictureHandle(), &xform);
-        XRenderComposite(dpy, PictOpOver, pixmap.x11PictureHandle(), None, scaledPixmap.x11PictureHandle(),
+        XRenderSetPictureFilter(dpy, unscaledPixmap.x11PictureHandle(), FilterBilinear, 0, 0);
+        XRenderSetPictureTransform(dpy, unscaledPixmap.x11PictureHandle(), &xform);
+        XRenderComposite(dpy, PictOpOver, unscaledPixmap.x11PictureHandle(), None, scaledPixmap.x11PictureHandle(),
                          0, 0, 0, 0, 0, 0, scaledPixmap.width(), scaledPixmap.height());
         pixmap = scaledPixmap;
     } else {