Bug 372081 - misinterpretation of system information
Summary: misinterpretation of system information
Status: RESOLVED FIXED
Alias: None
Product: kinfocenter
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Hubner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-04 16:14 UTC by Looserof7
Modified: 2017-02-25 07:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Bigger Image (90.05 KB, image/png)
2016-11-05 05:43 UTC, Looserof7
Details
Image Extending the left section (65.30 KB, image/png)
2016-11-05 12:27 UTC, Looserof7
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Looserof7 2016-11-04 16:14:58 UTC
Here, I just came across these weird things in k-infocenter. I'm uploading attachments.
In-case of memory, I have used 74% out of 400GB, remaining amount which should amount to around 80-90GB free memory, but it shows I have only 0.8GB free.
I have included 2 screenshots of similar problem.

Another one is information is regarding my battery, where it displays my battery is fully charged, but it isn't, and my battery notification shows it is 78% and discharging. 

Here's the link for screenshots: https://drive.google.com/open?id=0Bw1lzCYKRpNqMzBlNjZvaERlWUk
Comment 1 Christoph Feck 2016-11-04 22:26:40 UTC
Could you increase the size of the left section to see if the information was just cropped?
Comment 2 Christoph Feck 2016-11-04 22:27:36 UTC
... decrease the size of the left section, or increase the size of the right section ...
Comment 3 Christoph Feck 2016-11-04 22:38:12 UTC
Git commit 1fd35936668a168c19beb7c8def4f42380e43a4d by Christoph Feck.
Committed on 04/11/2016 at 22:37.
Pushed by cfeck into branch 'master'.

Fix battery charge state display

M  +1    -1    Modules/devinfo/soldevicetypes.cpp

http://commits.kde.org/kinfocenter/1fd35936668a168c19beb7c8def4f42380e43a4d
Comment 4 Christoph Feck 2016-11-04 23:14:34 UTC
Adding Hugo for the KCapacityBar issue.

The default rendering of KCapacityBar is visible on https://api.kde.org/frameworks/kwidgetsaddons/html/classKCapacityBar.html

"inline text" mode draws the text inside the bar
"outline text" mode draws the text below the bar

KInfoCenter uses the "outline text" mode.

KCapacityBar::minimumSizeHint() assumes this layout.

With Fusion style (which does not customize the rendering), the text is correctly drawn below the bar, and elided with trailing dots, if it does not fit completely.

With Breeze style, the text is rendered to the right of the bar, and the bar and leading text characters vanish when it does not fit completely.

Can KCapacityBar respect the different layout, in other words, is there some QStyle::sizeFromContents() for this custom ControlElements implemented in Breeze?
Comment 5 Looserof7 2016-11-05 05:43:34 UTC
Created attachment 102042 [details]
Bigger Image

I'm extremely sorry for the delay, I didn't have internet connection for a while, so please excuse me, being noob I didn't understand anything of comment4 , but I would try my best to help.
Here is the screenshot,
Comment 6 Christoph Feck 2016-11-05 06:51:20 UTC
When you are viewing disk information, you can resize the sections by grabbing the splitter between them. This should reveal the cropped information.

The battery status is already addressed by the comment from comment #3, and comment #4 is for Hugo.
Comment 7 Hugo Pereira Da Costa 2016-11-05 09:34:19 UTC
(In reply to Christoph Feck from comment #4)
> Adding Hugo for the KCapacityBar issue.
> 
> The default rendering of KCapacityBar is visible on
> https://api.kde.org/frameworks/kwidgetsaddons/html/classKCapacityBar.html
> 
> "inline text" mode draws the text inside the bar
> "outline text" mode draws the text below the bar
> 
> KInfoCenter uses the "outline text" mode.
> 
> KCapacityBar::minimumSizeHint() assumes this layout.
> 
> With Fusion style (which does not customize the rendering), the text is
> correctly drawn below the bar, and elided with trailing dots, if it does not
> fit completely.
> 
> With Breeze style, the text is rendered to the right of the bar, and the bar
> and leading text characters vanish when it does not fit completely.
> 
> Can KCapacityBar respect the different layout, in other words, is there some
> QStyle::sizeFromContents() for this custom ControlElements implemented in
> Breeze?

Hello Christoph

Thanks for adding me to the bug report.
So, first, this is not really a bug, right ? i mean, all the information is displayed, provided there is enough space for it.

More seriously, in the current kcapacity bar implementation, the drawTextMode you mention is only used when internal rendering is called, it is not known to the style at all.

I guess one could pass it via a property on the widget, at the minimum.

And then you are right, there is the minimumSizeHint. It basically works only if internal rendering is used. In principle the class should also call a style-implemented minimumSizeHint (some sizeFromContents with the right elements), in case of styled rendering. All in all there seems there is a need for some reworking of the kcapacitybar class if we want to really support sized rendering ....
Comment 8 Looserof7 2016-11-05 12:27:49 UTC
Created attachment 102044 [details]
Image Extending the left section

Here is another screenshot, another screenshot was included in google-drive, link 

https://drive.google.com/open?id=0Bw1lzCYKRpNqMzBlNjZvaERlWUk
Comment 9 Christoph Feck 2016-11-07 00:24:08 UTC
Please read comment #6. I did not request a new screen shot, and certainly not of the battery section (which I already fixed). Note that a bug tracker is also used for communication between developers, so you might read discussions that you cannot follow. In that case, it is better not to interrupt.
Comment 10 Christoph Feck 2016-11-07 00:24:17 UTC
Hugo, do you remember if there was a reason to change the layout? Or was it just implemented this way in Oxygen/Breeze from the beginning? In the latter case, I could change the internal layout to match what Oxygen/Breeze do, and adjust the mimimumSizeHint() accordingly.