- 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
// 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();
// 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,
const int p1 = 70;
const int p2 = 100 - p1;
m_additionalInfoTextColor = QColor((c1.red() * p1 + c2.red() * p2) / 100,
newGroupValue = newFirstChar;
isLetter = true;
} else if (newFirstChar >= QLatin1Char('0') && newFirstChar <= QLatin1Char('9')) {
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.
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);
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);
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);
}
}
setLayouterSize(size, sizeType);
void KPixmapModifier::scale(QPixmap& pixmap, const QSize& scaledSize)
{
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()) {
#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);
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 },
XTransform xform = {{
{ XDoubleToFixed(1 / factor), 0, 0 },
XRenderPictureAttributes attr;
attr.repeat = RepeatPad;
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 {
0, 0, 0, 0, 0, 0, scaledPixmap.width(), scaledPixmap.height());
pixmap = scaledPixmap;
} else {