Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.8k stars 444 forks source link

Fix corrupted "add torrent" layout #7969

Closed drew2a closed 5 months ago

drew2a commented 5 months ago

Fixes #7965

The bug is a combination of two facts:

  1. QT dependencies upgrade made here: https://github.com/Tribler/tribler/pull/7944
  2. Using the "trick" for hiding a menu arrow: https://github.com/Tribler/tribler/blob/03adf6a49744bad2a5e914324e713038d66bf10d/src/tribler/gui/qt_resources/mainwindow.ui#L340

The solution is to change QPushButton to QToolButton as it seems to work a bit more correctly in our specific case with hiding the menu indicator:

QToolButton#add_torrent_button {
    border-style: outset;
    border-width: 1px;
    border-radius: 15px;
    border-color: grey;
    margin-left: 15px;
    padding-left: 10px;
    margin-right: 10px;
}
QToolButton::menu-indicator {
    image: none;
    width: 0px;
}
image

Please note that the first commit is just a reformatting of the entire mainwindow.ui to maintain strict indentation.

kozlovsky commented 5 months ago

When I run Tribler from the main branch from sources on Windows with Russian localization, this is what I see originally: image and this is what I see from the PR branch: image

It looks like something should still be done with this arrow... (Note that the button is slightly wider, but that in itself is not a problem)

drew2a commented 5 months ago

@kozlovsky thank you for your feedback. Could you please try the latest version of this PR? It seems that QT behaves differently on different OS.

kozlovsky commented 5 months ago

image

Now, the menu arrow is not visible. But the button's text looks a bit too large as if it were the most important UI element on the page. It looks like the font size is not fixed, but somehow, it depends on the text length and size of additional items like the icon.

kozlovsky commented 5 months ago

image

Now it looks good!

drew2a commented 5 months ago

@kozlovsky thank you for your help.