After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707459 - window explain SYD cannot be closed normally
window explain SYD cannot be closed normally
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
git master
Other Linux
: High major
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-04 12:57 UTC by Marie.KOWALCZYK
Modified: 2015-09-20 14:28 UTC
See Also:
GNOME target: ---
GNOME version: 3.15/3.16


Attachments
Screenshot of the Pmt dialog. (18.84 KB, image/png)
2013-11-14 13:38 UTC, Kévin THIERRY
  Details
Pmt function window correctly displayed. (16.63 KB, image/png)
2013-11-14 13:50 UTC, Kévin THIERRY
  Details
Fix all the financial dialogs (6.93 KB, patch)
2015-09-18 20:55 UTC, Matthias Clasen
committed Details | Review

Description Marie.KOWALCZYK 2013-09-04 12:57:37 UTC
Steps
1. Open calculator
2. Click Calculator on top bar and select Finance
3. Click on SYD

Result: 
the window that appears cannot be closed normally (no X) and size of the window is weird
Expected:
 I should be able to close the window normally and the size of the window should be normal
Comment 1 Kévin THIERRY 2013-10-18 07:15:14 UTC
Bug still present in gnome-calculator 3.10 (tested on Fedora 20).
Comment 2 Kévin THIERRY 2013-11-14 13:38:33 UTC
Created attachment 259803 [details]
Screenshot of the Pmt dialog.

The bug is not only with the Syd function window but with all financial functions windows.
Comment 3 Kévin THIERRY 2013-11-14 13:50:50 UTC
Created attachment 259804 [details]
Pmt function window correctly displayed.

Here is a correctly displayed window. I didn't find how to correct this bug (yet), this is just a hack (hard-coded value).

The problem with this bug is that on a low resolution screen (800x600) the Syd function becomes unusable since the window goes off-screen.
I don't have other examples of this bug but it might be found in other applications (maybe without usability impact).
Comment 4 Kévin THIERRY 2013-11-14 14:11:12 UTC
I traced what happens in gtklabel and it seems that:
- the problem is not in pango
- the label's layout size is correct
- the allocated height is correct

However the allocated height value used to display the window is not the correct one but a previously computed value.
Comment 5 PioneerAxon 2013-12-15 18:37:59 UTC
Hello Kevin,

Is there any way by which we can make the GtkLabel shrink according to the text content, making the whole dialogue appear in proper size?

Thank you. :)
Comment 6 Kévin THIERRY 2013-12-16 07:53:05 UTC
Hi  PioneerAxon,

I've investigated this bug a bit and didn't find an easy way to achieve that. However, from my understanding the size of the GtkLabel is correct but the size allocated to i is wrong (in the parent class: GtkWidget). It seems that either the correct allocation size isn't updated or there is a another problem in the allocation mechanism. I'm pretty sure the problem is not in pango since it computes well the number of lines. Note that this bug is directly linked to the WRAP function.

I don't remember the exact steps to compute the size of the label but it's something like that:

1) Compute the max height and min width by putting one word per line (the number of words defines the height, the longest word, the width).
2) Try to shrink the height by putting several words per line using the width computed in step 1). This way we get a new height inferior or equal to the height in 1). Now we have the real min width and max height.
3) Compute the min height for the given width (the values we really want).

It seems that the allocation height is the one computed in step 2, not in step 3 hence the wrong size.

Please note that I'm very new to Gtk so I might be wrong in my analysis.

Right now I don't have time to work on that bug but if I find anything else that can help, I will share it ;)
Comment 7 Matthias Clasen 2015-09-18 20:55:04 UTC
Created attachment 311657 [details] [review]
Fix all the financial dialogs

All these dialogs contain long labels which need a minimum
line width to prevent them from growing super-tall.
Comment 8 Alberto Ruiz 2015-09-20 14:26:46 UTC
Thanks a lot Matthias, fix committed and pushed.
Comment 9 Alberto Ruiz 2015-09-20 14:28:27 UTC
Review of attachment 311657 [details] [review]:

Looks good. Tested, committed and pushed.