-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buttons in toolbar drawn incorrectly in right-to-left layout #594
Comments
@asashnov and the icons should be on the right!!! |
@kelson42 Which icons did you ment in your previous comment? Icons inside tab headers (close button and the content web page icon) are reverted- that's right, this is a standard behaviour of QTabbar. At least, on my Linux. On Windows it can be different, need to check with Kiwix. One of the example I manage to find on the Internet with Arabic interface is ESET: Source: https://help.eset.com/ees/6/ar-EG/index.html?idh_config_antiphish.htm |
Qt manual says (https://doc.qt.io/qt-5/qtquick-positioning-righttoleft.html):
But it says nothing clearly about tabs header. So I'm confused here. I think we can rely on the default behaviour of QTabbar now, and may |
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
There was a hacky implementation which created QPushButton as a child of QLineEdit, but without using any Layout (actually, QLineEdit has no documented facilities to contain any other widget). So, somehow in old implementation Qt placed QPushButton in the left side of QLineEdit. QLineEdit itself didn't knew about it, so in CSS left padding 40px; was needed. With '-reverse' CLI option (right-to-left layout) padding 40px remained to be on the left. Also, depending on which text we enter in QLineEdit (English or Arabic) the text can also be started from the left or the right side of text area in QLineEdit, so otherwise we had to detect text layout and update CSS paddings on the fly. The new implementation is more elegant and uses the documented facility of QLineEdit to contain an QAction. So no hacks with CSS padding is need. Also, because QPushButton was a separate QWidget, clicking on it didn't pass the focus into QLineEdit, but clicking on QAction icon does focusIn. So focus interation code also has to be changed. Fixes: #594
@asashnov Sorry for my lack of feedback. I did not meant the tab headers. I meant the context of the search box:
|
There was a hacky implementation which created QPushButton as a child of QLineEdit, but without using any Layout (actually, QLineEdit has no documented facilities to contain any other widget). So, somehow in old implementation Qt placed QPushButton in the left side of QLineEdit. QLineEdit itself didn't knew about it, so in CSS left padding 40px; was needed. With '-reverse' CLI option (right-to-left layout) padding 40px remained to be on the left. Also, depending on which text we enter in QLineEdit (English or Arabic) the text can also be started from the left or the right side of text area in QLineEdit, so otherwise we had to detect text layout and update CSS paddings on the fly. The new implementation is more elegant and uses the documented facility of QLineEdit to contain an QAction. So no hacks with CSS padding is need. Also, because QPushButton was a separate QWidget, clicking on it didn't pass the focus into QLineEdit, but clicking on QAction icon does focusIn. So focus interation code also has to be changed. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
Use QLineEdit::addAction() to place a button inside the widget. It will automatically positioned on the left, or on the right, depending on the current language. Fixes: #594
@kelson42 May I have a summary on what is left to do? They seem to be looking ok in reverse mode on Linux. I did spot this one, where the text is wrongly shadowed as if it is still in left-to-right mode: |
@ShaopengLin Please rebase and then I will do a new review |
You might have commented on the wrong place. I assume you meant to put it on the save page PR. |
Found on current 'master' (ca776b4)
Steps to reproduce:
Actual result:
Expected result:
Graphical items in toolbar should not overwrite each other, no duplicate drawings.
Additional info
There is another issue about Back/Forward buttons order: #595
The text was updated successfully, but these errors were encountered: