Bug 455367 - Vertical unreadable `% Complete` progress bars
Summary: Vertical unreadable `% Complete` progress bars
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: 5.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
: 456036 457084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-15 20:48 UTC by Danail Branekov
Modified: 2022-08-28 10:19 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.08


Attachments
unreadable vertical progress bars (76.36 KB, image/png)
2022-06-15 20:48 UTC, Danail Branekov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danail Branekov 2022-06-15 20:48:10 UTC
Created attachment 149761 [details]
unreadable vertical progress bars

Hello,

After bumping KDE plasma to 5.25 on my Gentoo system I noticed that the `% Complete` column contains a vertical progress bar (see screenshots of when a torrent entry has been selected and not selected attached). On both screenshots the progress bar is supposed to show "71%"

From my point of view such a progress bar is quite unusable as
* the bar is quite thin and hard to spot
* it misses the numeric value of the percentage, therefore one cannot easily figure out whether the torrent is almost completed (at e.g. 99.5%), or completely completed
* when the new "Colour from current wallpaper" plasma feature is enabled, it is hard to see where the progress is up to as the colours of the "full" and "empty" bits are quite similar (though this is not a KTorrent issue, I assume)

I cannot imagine why one would want a vertical progress bar in the context of a table of torrents, but I could also imagine that this has been an incompatible upstream (e.g. Qt) change in the controls default state. Anyway, I have applied the following naive patch onto master to bring horizontal progress bars with numeric value back:

```
diff --git a/ktorrent/view/viewdelegate.cpp b/ktorrent/view/viewdelegate.cpp
index 8de17708..88b4c058 100644
--- a/ktorrent/view/viewdelegate.cpp
+++ b/ktorrent/view/viewdelegate.cpp
@@ -325,7 +325,7 @@ void ViewDelegate::paintProgressBar(QPainter *painter, const QStyleOptionViewIte
 
     QStyleOptionProgressBar progressBarOption;
     progressBarOption.palette = option.palette;
-    progressBarOption.state = option.state;
+    progressBarOption.state = option.state | QStyle::StateFlag::State_Horizontal;
     progressBarOption.rect = option.rect;
     progressBarOption.minimum = 0;
     progressBarOption.maximum = 100;
```

I would be happy to see horizontal progress bars back in the next release, even if hidden behind some configuration.


My system:

```
Operating System: Gentoo Linux 2.8
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.15.41-gentoo-x86_64 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 1800X Eight-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2
```


Danail
Comment 1 Yerrey Dev 2022-06-15 21:16:37 UTC
Can not reproduce.

KTorrent: 22.04.2
Plasma: 5.25.80
Frameworks: 5.96.0
Qt: 5.15.4
Comment 2 Danail Branekov 2022-06-15 22:20:03 UTC
> Can not reproduce.

Hmmm... 

I just checked out the v22.04.2 tag and do manage to reproduce it. 

In the meanwhile I came across an old issue (https://bugzilla.redhat.com/show_bug.cgi?id=1231340) which made me think about the application style. So, when I select "Fusion" in Settings > Global theme > Application Style, the issue is gone. But when I switch back to "Breeze" (I think the default) the progress bar becomes vertical...

¯\_(ツ)_/¯
Comment 3 Bogomil Vasilev 2022-06-16 17:46:33 UTC
I can confirm the same.
ktorrent 22.04.2
Comment 4 Danail Branekov 2022-06-19 04:12:06 UTC
I noticed those annoying vertical progress bars in KGet as well so apparently this is not a Ktorrent issue, it is rather an environment one. For the sake of the experiment I created a new test user and with all the defaults it gets the progress bars were horizontal. 

Probably there is some old setting buried somewhere that is causing this. Argh!!! I hate the idea of nuking my kde config directory :(

Please feel free to close the issue (as being not KTorrent related). Happy to get recommendations where to open it if anyone knows. Even happier if anyone suggests what to fix in the settings files :)
Comment 5 Patrick Silva 2022-06-27 16:24:44 UTC
*** Bug 456036 has been marked as a duplicate of this bug. ***
Comment 6 Adrián López Galera 2022-06-30 11:44:37 UTC
I can confirm the same on Ktorrent 22.04.2.
Maybe it's a framework issue.

Regards.
Comment 7 Nicole Schoebel 2022-06-30 20:24:54 UTC
I see the same problem with the vertical progress bar in LibreOffice when saving a big document. For a split second a progress bar appears at the bottom of the window, and with Breeze it is vertical, but it should be horizontal.

When I change the application style to Fusion the bug disappears both in KTorrent and LibreOffice. Switch back to Breeze, and the bug appears again. This is on Arch Linux.

So it looks to me as if the bug is actually in Breeze.

Looking at the recent commits, there is one from a few weeks ago (https://invent.kde.org/plasma/breeze/-/commit/2bf9fc4c7be280e2b77f7c150855e0fca0b80d9a) that made changes to the progress bar implementation in Breeze. I'm not familiar with the KDE codebase, not even familiar with C++, so I'm not sure if that is actually the cause.
Comment 8 Bug Janitor Service 2022-07-18 12:56:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/ktorrent/-/merge_requests/62
Comment 9 Roberto 2022-07-21 07:20:10 UTC
Confirmed on ubuntu devel 

KTorrent 22.04.3
KDE Frameworks 5.96.0
Qt 5.15.4
Comment 10 Marco 2022-07-27 11:15:19 UTC
I also confirm this bug when using KTorrent on KDE Plasma 5.25.3, and KFrameworks 5.96.0, on Fedora 36.
Comment 11 Lemuel Simon 2022-07-29 14:11:57 UTC
*** Bug 457084 has been marked as a duplicate of this bug. ***
Comment 12 Lemuel Simon 2022-07-29 14:28:04 UTC
Huh, I just reported this problem yesterday under Breeze, check here: https://bugs.kde.org/show_bug.cgi?id=457084 . The Classik/Classy application style is a Breeze-fork but it doesn't have this issue. Given that it affects multiple Qt-applications that applies the Breeze style, I think this should be relocated to the 'Breeze' product with the QStyle component for visibility. 


Operating System: openSUSE Leap 15.4
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.14.21-150400.22-default (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-3320M CPU @ 2.60GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4000
Comment 13 Gabriel Souza Franco 2022-07-30 22:57:57 UTC
Git commit e24e964aa2b40547d51240c626e98e8a4f38dc22 by Gabriel Souza Franco.
Committed on 18/07/2022 at 12:53.
Pushed by aacid into branch 'release/22.08'.

Explicitly set progress bar to horizontal mode

Breeze and Oxygen default to a vertical progress bar.
Related: bug 455451
FIXED-IN: 22.08

M  +1    -1    ktorrent/view/viewdelegate.cpp

https://invent.kde.org/network/ktorrent/commit/e24e964aa2b40547d51240c626e98e8a4f38dc22
Comment 14 Danail Branekov 2022-08-28 10:19:48 UTC
Confirming that the fix works for me. Thanks!