GNOME Bugzilla – Bug 707459
window explain SYD cannot be closed normally
Last modified: 2015-09-20 14:28:27 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
Bug still present in gnome-calculator 3.10 (tested on Fedora 20).
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.
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).
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.
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. :)
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 ;)
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.
Thanks a lot Matthias, fix committed and pushed.
Review of attachment 311657 [details] [review]: Looks good. Tested, committed and pushed.