BUG: 334263
Details
- Reviewers
ngraham rkflx - Group Reviewers
Frameworks - Maniphest Tasks
- T9297: Polish file/folder properties dialog
- Goto properties
- Used space displayed in GiB also
Diff Detail
- Repository
- R241 KIO
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Thanks for tackling this bug! I approve of the idea here, but the presentation you've chosen doesn't seem ideal. How about this instead?
Device capacity: 94.4 Gib Device usage: ==------ 24% full (71.9 GiB free, 22.5 GiB used)
That's much better. Another proposal built on top of that:
Device capacity: 94.4 Gib (22.5 GiB used, 71.9 GiB free) ====---------- 24% full
(Does not duplicate "device", shorter for improved translatability, same units on the same line, order of used/free matches what the bar shows.)
Or perhaps there is a way to emphasize the most important information a bit more (IMO that's "71.9 GiB free")?
+1 for using the same label but putting the information on more than one line like @rkflx suggests.
I think there are basically three important pieces of information here:
- Percentage free (for people who don't understand what a "GiB" is--the "Simple by default" folks)
- Amount of free space left (for people who know what a GiB is and want hard numbers)
- Total disk capacity (for the above group of people)
The amount of space used is non-critical, which is probably why it wasn't displayed before, but I don't see the harm in adding it if we can avoid using too much horizontal space. Here's another idea for how to express everything while remaining compact in the horizontal dimension:
Device capacity: ====---------- 24% full 22.5 GiB used, 71.9 GiB free 94.4 Gib total size
Not bad at all, but due to using 3 lines now puts quite some emphasis on the device, while the dialog is about the folder actually. Would this be a compromise?:
Device capacity: ==----- 24% used of 94.4 Gib 22.5 GiB used, 71.9 GiB free
(Not too happy about the duplication of "used", though.)
We have other places where such information is displayed, e.g. the disk quota applet: https://kate-editor.org/2015/08/02/plasma-5-keeping-an-eye-on-the-disk-quota/
Maybe this is useful for input :)
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1270 | Unnecessary/unintentional whitespace change. |
I think it looks visually distracting that one progress bar line ends up in two lines of text - this should be avoided.
To behonest, the suggestion by @ngraham makes most sense to me: Two lines with the distinction of "Device capacity" and "Device usage".
Device capacity: 94.4 Gib Device usage: ==------ 24% full (71.9 GiB free, 22.5 GiB used)
Could you give this a try with screenshot?
dhaumann: but that deviec capacity label seems to be redundant, because capacity is simply used + free
Yeah, but you have to do mental math to calculate that. It doesn't make sense to make the user do math to find out how big their disk is.
Correct, but "visual cleanness" goes over redundancy (imo). In fact, the information 100 GiB, 20 GiB used (20%), 80 GiB free is also highly redundant.
So redundancy is not the argument here. Instead, I think we should follow the best visual design. And the progress bar + 2 lines text behind is clearly not visually the best solution :-)
I'm afraid the second line will become too long for locales other than English, making the capacity bar a tiny dot. Try it in GammaRay (⇧+Ctrl click, then change the text, add some spacing in front which currently is missing).
Let me plug my suggestion again:
Device capacity: ==----- 24% used of 94.4 Gib 22.5 GiB used, 71.9 GiB free
@ngraham Any opinions on that?
@rkflx Would be fine with this, as long as the alignment is correct (i.e. the text "Device capacity: ==----- 24% used of 94.4 Gib" should all be one one line, and the text " 22.5 GiB used, 71.9 GiB free" should be below. The screenshot above is an example of wrong alignment.
I'm fine with that. A simple way to make sure the alignment is correct is to put all the strings that should be on a second line in their own cell in the gridView.
Device capacity: ==----- 24% used of 94.4 Gib 22.5 GiB used, 71.9 GiB free
if this design is used , then the capacity bar would look elongated and stretched, which doesn't looks good. (above screen shot)
Since used space is not of that much importance, so we can just omit it like this
Device capacity: =======> 24% full of 90GiB (70GiB free)
Not if you set a maximum width.
Since used space is not of that much importance, so we can just omit it like this
Device capacity: =======> 24% full of 90GiB (70GiB free)
That's more or less what we currently have without your patch, but if we want to close the bug as WONTFIX I'd prefer the original order.
Not if you set a maximum width.
@rkflx eeh, skipped from my mind
btw , then it is doable
Thanks, looking better than before now. There are still some improvements you could make:
- There is a superfluous space before the comma in the second line.
- I'd prefer the bar to be a bit wider by default. However, it turns out there is a problem with my original suggestion (see inline comment).
- The vertical spacing between the first and the second line is too big, it should be the same as for Size:. However, there should still be enough spacing so it also looks good with the Oxygen style. As far as I can see this is an issue with how Breeze renders the KCapacityBar, in particular the bounding rect contains unnecessary margins (⇧+Ctrl-click on it in GammaRay and compare Breeze and Oxygen). Of course that's material for a patch in a different repo, but the "hole" in your current screenshot does not look good (the second line is closer to the bottom than to the first line, which is bad!), and it would be better to fix the problem there before landing the KIO patch.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1184–1186 ↗ | (On Diff #38690) | That's a bit odd: Why would you have to query that information here again, if in the original implementation it is already available? Perhaps all calls to setText should take place only in one part of the code, e.g. slotFreeSpaceResult. |
1188 ↗ | (On Diff #38690) | Do you need curRow++ here, in case additional rows are added later on? |
1189 ↗ | (On Diff #38690) | Translators will only see the string and the context, so "Device usage information" is not enough. It would be better to also describe what the parameters are for, see slotFreeSpaceResult for an example. |
1279 ↗ | (On Diff #38690) | I don't think we can set a maximum width for the complete bar, because it can conflict with languages with longer translations. More importantly, for the Oxygen widget style the text in a KCapacityBar might be drawn inline and the bar should span the complete width of the dialog, so I don't think we should fiddle too much with the sizes of m_capacityBar or its sub-components. I guess we have to live with the longer bar for Breeze, which could already become quite long without your patch if you resized the dialog. For other languages it is also less of an issue. |
1281 ↗ | (On Diff #38690) | Please also update the translation context when you change the string to translate. |
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1184–1186 ↗ | (On Diff #38690) | If all function calls to setText are to take place inside slotFreeSpaceResult, then we will need to make a new QLabel, so we can't re-use it(which is the main point as @ngraham had earlier said) |
1279 ↗ | (On Diff #38690) | so we need to remove setMaximumWidth() ? |
This comment has been deleted.
You are doing this in every other Diff, which is a bit annoying. Please first check what you wrote, then click on Send. Otherwise people will just ignore notifications.
is there any other simpler way to achieve this?
Maybe, maybe not. I added my idea on that topic above, but it's not my job to research that in depth.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1184–1186 ↗ | (On Diff #38690) | Could you point out where @ngraham said something like that? I cannot find it. |
1279 ↗ | (On Diff #38690) | Yes. |
As far as I can see that comment was part of the discussion about what to show, which I think we now concluded. I don't think that was meant as an advice regarding implementation.
You are already creating a new label (which is fine, also where you're doing it is the perfect spot). I was only wondering whether the call to setText should better be placed elsewhere.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
1189 ↗ | (On Diff #38690) | Also, style for i18n strings: there must be no space before comma. |
Do you plan to submit a new version of this after the layout has been converted to use QFormLayout? I do hope some form of this patch makes it in, since IMHO it's a nice little quality-of-life improvement.
A pie chart could work. But is there something wrong with the current representation?