qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.16k stars 3.84k forks source link

Resize window that spills from desktop area by performing searches!!!! #9826

Open xzj8b3 opened 5 years ago

xzj8b3 commented 5 years ago

Reported several times, we want to resize window using the search field exits the desktop area??? schermata da 2018-11-07 11-54-11

Nome : qbittorrent Epoca : 1 Versione : 4.1.2 Rilascio : 1.fc29 Arch : x86_64 Dim. : 8.5 M Sorgente : qbittorrent-4.1.2-1.fc29.src.rpm Repo : @System Dal repo : fedora Sommario : A Bittorrent Client URL : http://www.qbittorrent.org Licenza : GPLv2+

thalieht commented 5 years ago

You probably have a small (laptop) screen and that's why it doesn't fit. It doesn't fit because there are many filters for the search results and i suppose this problem appeared in the qBt version that added the Filter search results field. One hacky solution would be to change that field's minimum width but i have no way of knowing what number would be enough. I also don't know what would be the proper way to fix it.

--- a/src/gui/search/searchjobwidget.cpp
+++ b/src/gui/search/searchjobwidget.cpp
@@ -129,7 +129,7 @@ SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
     updateFilter();

     m_lineEditSearchResultsFilter = new LineEdit(this);
-    m_lineEditSearchResultsFilter->setFixedWidth(Utils::Gui::scaledSize(this, 170));
+    m_lineEditSearchResultsFilter->setMinimumWidth(Utils::Gui::scaledSize(this, 90));
     m_lineEditSearchResultsFilter->setPlaceholderText(tr("Filter search results..."));
     m_lineEditSearchResultsFilter->setContextMenuPolicy(Qt::CustomContextMenu);
     connect(m_lineEditSearchResultsFilter, &QWidget::customContextMenuRequested, this, &SearchJobWidget::showFilterContextMenu);
xzj8b3 commented 5 years ago

Probabilmente hai uno schermo piccolo (portatile) ed è per questo che non si adatta. Non si adatta perché ci sono molti filtri per i risultati della ricerca e suppongo che questo problema sia apparso nella versione qBt che ha aggiunto il campo dei risultati della ricerca del filtro. Una soluzione hacky sarebbe quella di modificare la larghezza minima di quel campo, ma non ho modo di sapere quale numero sarebbe sufficiente. Inoltre, non so quale sarebbe il modo corretto per risolverlo.

--- a/src/gui/search/searchjobwidget.cpp
+++ b/src/gui/search/searchjobwidget.cpp
@@ -129,7 +129,7 @@ SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
     updateFilter();

     m_lineEditSearchResultsFilter = new LineEdit(this);
-    m_lineEditSearchResultsFilter->setFixedWidth(Utils::Gui::scaledSize(this, 170));
+    m_lineEditSearchResultsFilter->setMinimumWidth(Utils::Gui::scaledSize(this, 90));
     m_lineEditSearchResultsFilter->setPlaceholderText(tr("Filter search results..."));
     m_lineEditSearchResultsFilter->setContextMenuPolicy(Qt::CustomContextMenu);
     connect(m_lineEditSearchResultsFilter, &QWidget::customContextMenuRequested, this, &SearchJobWidget::showFilterContextMenu);

My monitor is 1366x768 (16.9) sure is the version with search filters ...the 4.1.2 in the repositories of Fedora. Previously it did not have this problem it was born with the versions inserted by Fedora 28 onwards ..... too bad make qbittorrent really uncomfortable to use ..... but I know many people use notebooks the same size ..... I will have to opt for other software when I have always used qbittorrent??

thalieht commented 5 years ago

There will be a fix in 4.1.4. Report back if there is still a problem or if there isn't, close this issue.

xzj8b3 commented 5 years ago

The problem has been reported several times since this summer, can it still not come to any resolution in the servers of fedora given had already been anticipated a correction?

therloux commented 4 years ago

@thalieht the issue still happens on fedora (qbittorrent is currently on version 4.2.3 on f31). i think it comes down to allowing the window to resize, which i don't think it should. maybe, because the buttons are so big on fedora, they could move a row below the filter box? (this could also prevent the filter box from being so small)

FranciscoPombal commented 4 years ago

@Kolcha thoughts?

Kolcha commented 4 years ago

GNOME became almost unusable last years due to such huge interface elements... It is unusable even on HiDPI (aka Retina displays) - interface maybe even bigger and almost have no free space... I stopped to use GNOME on my old 1366x768 laptop since ~2014 due to lack of space, and switched to XFCE, I didn't like KDE for some reason. And it is known that Qt apps have look and feel issues on GNOME, especially on Fedoda. Since Qt devs dropped GTK2 styles integration with Qt 5.7, most Qt apps started to have GUI issues in GTK environments (especially GNOME). A lot of different hacks/workarounds appeared to mitigate that issues and trying to achieve "uniform apps look" like was before, but really they bring more issues than solved. Almost each distro uses one of that "hacks", which one may depend on default desktop environment. For example, Fedora with GNOME environment uses custom Qt style plugin (shared library) called Adwaita (after default GNOME3 theme), it makes Qt apps to have a look like GTK3 apps, with that ugly huge buttons. Forcing Qt apps to use Fusion style may solve an issue, but it can be unavailable (everything depend on how Qt was build for distro, this is not "must have" feature, and it can be disabled). Even more issues with Qt apps on Fedora are caused by Wayland, Qt still not ready for it. moreover, any development in this direction is abandoned and nothing changes since 5.8 (or even just become worst, because no one care). very likely it will work acceptable only with it own Qt compositor, it even has issue with reference implementation called Weston.

Right now I have Fedora 31 installed on my old slightly broken MacBook (used mostly for different test cases), so I'll look what can be done for that issue, or at least is it reproducible for me. Than report result and maybe some suggestions/workarounds here. But this will be only in 1-2 days...

Kolcha commented 4 years ago

so... I did quick testing and now have some results. first of all, bug is 100% reproducible on my Fedora 31 (will be 32 in few hours).

My observation caused more questions than answered, know I want know how qBittorrent displays search results and what happens right after pressing 'Search' and before displaying first results, also I'm interested in window layout and few flags. This is because it is very strange to that window is resized when content appears... Even more, it continues to grow only in horizontal direction as search results appear... I assume model/view is used for that and something wrong with it. Also few very unusual window flags may be set, I spent a lot of time to achieve similar behavior in my app (resize window depending on content), so I am very surprised to see that "out of the box"... I have enough knowledge to solve that, just some time is required. I'll back in few days.

Kolcha commented 4 years ago

so... I'm back, but with bad news... there is no easy fix for that... details below

shortly - the reason is in huge controls. the top part of widget displaying search results (SearchJobWidget) has a line with a lot of controls (aka filter settings). when search is started, new SearchJobWidget is created and added to main window layout (doesn't matter it is actually added to some widget layout). it's (SearchJobWidget) sizeHint() reports desired value to outer layout, and this value bigger that current window size. due to various size policies on that controls (mostly set to QSizePolicy::Minimum), SearchJobWidget has minimal sufficient value for width, and that value depends on system style and/or Qt defaults for that controls. Qt layout system respects such requirements, so it forces main window resize to fulfill them. when new search results is added, and their count becomes for example more than thousand, window is resized slightly again (just to make number completely visible) due to the same reasons, origins of which lays in sizeHint() and size policy.

so, that's why we see window size change and why it is very noticeable on GNOME (due to huge controls). hope I wrote technical details understandably and anyone familiar with Qt GUI principals will understand what I mean.

actually, this is reproducible on any system with any screen, only initial main window size is matter (just make it small enough and this effect appears). I investigated this on Windows due to issues with Qt on Fedora and that known workarounds for it don't work since ~f24

so, my suggestion how to fix this: redesign SearchJobWidget to do not use a lot of controls in one line, split them in 3 rows for example. but such decision, I think, must be made by qBittorrent team. as practice shows, I'm pretty bad in GUI design, especially taking into account any modern trends...

FranciscoPombal commented 4 years ago

@Kolcha

so, my suggestion how to fix this: redesign SearchJobWidget to do not use a lot of controls in one line, split them in 3 rows for example. but such decision, I think, must be made by qBittorrent team. as practice shows, I'm pretty bad in GUI design, especially taking into account any modern trends...

AFAIK You're one of the people here with most expertise in Qt GUI-related stuff (and you take the time to explain it). If you have an idea of how to fix this - please do submit a PR! Maybe @jagannatharjun and/or @glassez can also help out?

Kolcha commented 4 years ago

so, right now I got next results (screenshots from MacBook with Retina display, but due to Wayland limitations and "out of the box" configuration just think that I have 1280x800 display):

before (qBittorrent sources as is): Screenshot from 2020-04-30 22-58-00

after (SearchJobWidget was redesigned): Screenshot from 2020-04-30 22-59-55

in both cases main window was NOT resized before search and qBittorrent' config was dropped (i.e. "first launch" in both cases), so I think results is relevant

please note that filter edit box was also unusable previously, now it is fine

P.S> I'll submit draft pull request for any further discussion slightly later (very likely tomorrow), I also made some few other hacks, and now code is very dirty to show it. also I want to test it on all OSes (Win/Linux/macOS) with normal/HiDPI displays. I have "full set" for that - slightly broken MacBook with Retina display and 3 OSes installed on it + standard 22" FullHD HDMI monitor. Also I have few VMs on my "primary" MacBook with other Linux systems.

jagannatharjun commented 4 years ago

How about horizontal scroll bar in filter selection (SearchJobWidget)?

es20490446e commented 3 years ago

I'm experiencing this on KDE Plasma with a 24 inch display. I would say that my screen elements are no big no small.

The fix is quite simple: just shorten the following elements:


From:

To:


From:

To: