From 652694c5fde3d7e400ab6f97d2a4f0660a59ddd8 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 18 May 2009 20:20:45 +0000 Subject: [PATCH] draw correctly in RTL layouts BUG: 188172 svn path=/trunk/KDE/kdelibs/; revision=969749 --- delegate.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/delegate.cpp b/delegate.cpp index a470458fd..d9d313a96 100644 --- a/delegate.cpp +++ b/delegate.cpp @@ -389,13 +389,8 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, if (column == 0) { //clip right (or left for rtl languages) to make the connection with the next column if (columns > 1) { - if (option.direction == Qt::LeftToRight) { - painter->setClipRect(option.rect); - highlightRect.adjust(0, 0, roundedRadius, 0); - } else { - painter->setClipRect(option.rect); - highlightRect.adjust(-roundedRadius, 0, 0, 0); - } + painter->setClipRect(option.rect); + highlightRect.adjust(0, 0, roundedRadius, 0); } QLinearGradient gradient(highlightRect.topLeft(), highlightRect.topRight()); @@ -416,13 +411,8 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, //last column, clip left (right for rtl) } else if (column == columns-1) { - if (option.direction == Qt::LeftToRight) { - painter->setClipRect(option.rect); - highlightRect.adjust(-roundedRadius, 0, 0, 0); - } else { - painter->setClipRect(option.rect); - highlightRect.adjust(0, 0, +roundedRadius, 0); - } + painter->setClipRect(option.rect); + highlightRect.adjust(-roundedRadius, 0, 0, 0); //column < columns-1; clip both ways } else {