mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -07:00
Fix search icon placement when using RTL languages
This commit is contained in:
parent
f86c5442aa
commit
1e029da5ad
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QResizeEvent>
|
||||
#include <QStyle>
|
||||
#include <QToolButton>
|
||||
|
@ -38,7 +39,10 @@ LineEdit::LineEdit(QWidget *parent)
|
|||
void LineEdit::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
const int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
|
||||
m_searchButton->move(frameWidth, (e->size().height() - m_searchButton->sizeHint().height()) / 2);
|
||||
const int xPos = QGuiApplication::isLeftToRight()
|
||||
? frameWidth
|
||||
: (e->size().width() - m_searchButton->sizeHint().width() - frameWidth);
|
||||
m_searchButton->move(xPos, (e->size().height() - m_searchButton->sizeHint().height()) / 2);
|
||||
}
|
||||
|
||||
void LineEdit::keyPressEvent(QKeyEvent *event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue