mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
Some more RTL support for wordlist and history list (issue #384)
This commit is contained in:
parent
c7cc9e41df
commit
bfb3d78367
10
delegate.cc
10
delegate.cc
|
@ -14,6 +14,16 @@ void WordListItemDelegate::paint( QPainter *painter, const QStyleOptionViewItem
|
||||||
QStyleOptionViewItem opt = option;
|
QStyleOptionViewItem opt = option;
|
||||||
initStyleOption( &opt4, index );
|
initStyleOption( &opt4, index );
|
||||||
if( opt4.text.isRightToLeft() )
|
if( opt4.text.isRightToLeft() )
|
||||||
|
{
|
||||||
opt.direction = Qt::RightToLeft;
|
opt.direction = Qt::RightToLeft;
|
||||||
|
if( opt4.textElideMode != Qt::ElideNone )
|
||||||
|
opt.textElideMode = Qt::ElideLeft;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
opt.direction = Qt::LeftToRight;
|
||||||
|
if( opt4.textElideMode != Qt::ElideNone )
|
||||||
|
opt.textElideMode = Qt::ElideRight;
|
||||||
|
}
|
||||||
mainDelegate->paint( painter, opt, index );
|
mainDelegate->paint( painter, opt, index );
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,11 @@ void WordList::updateMatchResults( bool finished )
|
||||||
20000 , QPixmap( ":/icons/error.png" ) );
|
20000 , QPixmap( ":/icons/error.png" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !results.empty() && results.front().first.isRightToLeft() )
|
||||||
|
setLayoutDirection( Qt::RightToLeft );
|
||||||
|
else
|
||||||
|
setLayoutDirection( Qt::LeftToRight );
|
||||||
|
|
||||||
emit contentChanged();
|
emit contentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue