Modify device usage information
AbandonedPublic

Authored by shubham on Jul 29 2018, 5:17 AM.

Details

Reviewers
ngraham
rkflx
Group Reviewers
Frameworks
Maniphest Tasks
T9297: Polish file/folder properties dialog
Summary

BUG: 334263

Test Plan
  1. Goto properties
  2. Used space displayed in GiB also

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
shubham created this revision.Jul 29 2018, 5:17 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 29 2018, 5:17 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
shubham requested review of this revision.Jul 29 2018, 5:17 AM

Can you add a screenshot?

ngraham requested changes to this revision.Jul 29 2018, 4:06 PM
ngraham added a reviewer: Frameworks.

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)
This revision now requires changes to proceed.Jul 29 2018, 4:06 PM
rkflx added a subscriber: rkflx.Jul 29 2018, 5:18 PM
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")?

This comment was removed by shubham.

+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
rkflx added a comment.Jul 30 2018, 5:08 AM

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 :)

shubham updated this revision to Diff 38740.Jul 30 2018, 6:09 AM
shubham retitled this revision from Display used space in GiB also to Modify device usage information.

Looks neat and tidy

ngraham added inline comments.Jul 30 2018, 2:28 PM
src/widgets/kpropertiesdialog.cpp
1270

Unnecessary/unintentional whitespace change.

shubham updated this revision to Diff 38784.Jul 30 2018, 2:41 PM

Remove unintentional " "(that was silly)

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?

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

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 :-)

rkflx added a comment.Jul 30 2018, 5:55 PM
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?

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.

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?

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.

shubham added a comment.EditedAug 5 2018, 9:07 AM

> Let me plug my suggestion again:

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)

rkflx added a comment.Aug 5 2018, 9:13 AM

Let me plug my suggestion again:

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.

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

shubham updated this revision to Diff 39120.Aug 5 2018, 10:28 AM


@rkflx is this okay now?

shubham edited reviewers, added: rkflx; removed: elvisangelaccio.Aug 5 2018, 10:41 AM
rkflx requested changes to this revision.Aug 5 2018, 12:37 PM

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.

This revision now requires changes to proceed.Aug 5 2018, 12:37 PM
shubham added a comment.EditedAug 5 2018, 2:54 PM
This comment has been deleted.
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() ?

rkflx added a comment.Aug 5 2018, 3:03 PM

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.

+1 for using the same label but putting the information on more than one line like @rkflx suggests.

sorry for causing trouble : (

rkflx added a comment.Aug 5 2018, 10:42 PM

+1 for using the same label but putting the information on more than one line like @rkflx suggests.

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.

pino added a subscriber: pino.Aug 6 2018, 3:44 AM
pino added inline comments.
src/widgets/kpropertiesdialog.cpp
1189 ↗(On Diff #38690)

Also, style for i18n strings: there must be no space before comma.

shubham abandoned this revision.Aug 17 2018, 3:48 PM

Actually should be implemented using form layout

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.

This comment was removed by shubham.

Great! Are you gonna do the QFormLayout patch, or should I?

You plz proceed on it. Right now working on some other patch.

won't the pie chart representation look good, as we have in windows?

A pie chart could work. But is there something wrong with the current representation?

pino added a comment.Oct 4 2018, 5:57 AM

won't the pie chart representation look good, as we have in windows?

That would be way too much wasted space for eye candy.