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 629794 - Need for a way to know the natural size of any object.
Need for a way to know the natural size of any object.
Status: RESOLVED OBSOLETE
Product: libgoffice
Classification: Other
Component: Graphing / Charting
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Blocks: 647218
 
 
Reported: 2010-09-15 19:51 UTC by Jon Nordby
Modified: 2018-05-22 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jon Nordby 2010-09-15 19:51:13 UTC
By "natural size" I mean the size the rendered model will occupy if there are no external restrictions on its size.

Steps to reproduce:
1) Create a graph widget with GogAreaPlot. Add it to a GtkWindow
2) Add legend and populate with data
3) Note that when running, making the window (and thus the allocation for the widget) big enough will result in the legend being shown with all legend items in one row. The legend will then have a certain height X just a bit smaller than the window height. Increasing the window height further will not influence X.
4) Get a renderer for the graph view, update it with gog_renderer_update.
5) Get the view of the legend, and use gog_view_size_request() with (constant) very large sizes for the "available" attribute. Note that at the moment, you will need to modify gog_renderer_update from destroying the renderer surface (last two lines).

Expected results:
Height of the "required" GogViewRequisition equal to X, the height the legend had when the available area in the window was big enough. This should be independent of the size of the window the graph widget is in (as the sizes given to the renderer/view are not related to it).

Actual results:
Height that depends on the window height. Works fine for available height bigger than X. For available heights slightly smaller than X it seems to almost work (the value is a bit low, but does not seem to be a relation to the actual window size). For small window heights it seems to return the height of the window.
Comment 1 Murray Cumming 2010-09-17 10:20:31 UTC
I wonder if GOGraphWidget (that you use in massifg) needs its own size_request vfunc implementation, which asks for its minumum size. Or would the baase GtkLayout's size-request just be correct if gog_view_size_request() was correct?
Comment 2 Jon Nordby 2010-09-21 09:11:50 UTC
If gog_view_size_request() worked as expected, applications could set the size request of the widget based on the returned information. That sounds more flexible to me than the library deciding on a certain behavior by implementing the size_request vfunc on the widget. I at least consider that to be a separate issue from this bug.
Comment 3 Jean Bréfort 2010-09-21 13:31:17 UTC
Natural size makes sense for the legend, for titles and axes (at least in one dimension in that case), but not for the plot area.
Comment 4 Jean Bréfort 2010-10-22 09:13:17 UTC
What is actually needed is a new function giving the natural size for any object. This can't be done with gog_view_size_request since this would just break things. We need a new entry in GogViewClass, so this will have to wait until we branch.
Comment 5 GNOME Infrastructure Team 2018-05-22 13:05:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/goffice/issues/24.