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);
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);
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 },
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 {