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 516108 - Allow themes to define a minimum size and aspect ratio for GtkArrow.
Allow themes to define a minimum size and aspect ratio for GtkArrow.
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Sven Herzberg
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-02-12 21:04 UTC by Christian Dywan
Modified: 2012-01-26 04:51 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Introduce "min-size and "aspect-ratio" style properties. (5.90 KB, patch)
2008-02-12 21:05 UTC, Christian Dywan
none Details | Review
Proposed Patch (5.89 KB, patch)
2008-04-28 07:43 UTC, Sven Herzberg
reviewed Details | Review
Take orientation into consideration (5.42 KB, patch)
2008-06-16 14:49 UTC, Christian Dywan
needs-work Details | Review
Style fix and updated to trunk (5.84 KB, patch)
2008-09-29 09:46 UTC, Christian Dywan
none Details | Review
Update for GTK+ 2.20, removed size_allocate (5.71 KB, patch)
2009-10-06 15:43 UTC, Christian Dywan
none Details | Review

Description Christian Dywan 2008-02-12 21:04:14 UTC
With regard to devices with a small screen, it is sometimes desirable to adjust the minimum size and aspect ratio of GtkArrow. Someimtes the arrow is unreadable on the screen. According style properties have done the job in the case of Maemo, so the natural next step is to have this feature upstream.
Comment 1 Christian Dywan 2008-02-12 21:05:29 UTC
Created attachment 105088 [details] [review]
Introduce "min-size and "aspect-ratio" style properties.
Comment 2 Benjamin Berg 2008-02-13 15:31:46 UTC
Hm, I like the idea. A few things I noticed:
 * defining PROP_MIN_SIZE and PROP_ASPECT_RATIO should not happen for style properties
 * I think it would make sense to take the arrow-type into account. This means that a left/right arrow needs different handling in gtk_arrow_size_request.

This is probably not that interesting for this particular bug. But I noticed that there are already several style properties that related to arrow sizes. IE. the scroll-arrow-[hv]length (GtkWidget), arrow-size (GtkComboBox).
Comment 3 Sven Herzberg 2008-04-28 07:43:32 UTC
Created attachment 110020 [details] [review]
Proposed Patch

Updated the patch to take comments into account.
Comment 4 Matthias Clasen 2008-05-24 22:00:46 UTC
I can understand the case for min-size, but aspect-ratio looks a bit suspicious to me. Wouldn't that have to be flipped when changing the arrow orientation ?

Is there any example of aspect-ratio != 1 actually being used ?
Comment 5 Christian Dywan 2008-06-16 14:49:08 UTC
Created attachment 112839 [details] [review]
Take orientation into consideration

Correctly spotted, the formula ought to be flipped depending on the arrow type/ orientation. The attached patch does this.
Comment 6 Christian Dywan 2008-08-04 13:22:39 UTC
Any input on the updated patch?
Comment 7 Tim Janik 2008-08-12 09:14:07 UTC
(In reply to comment #4)
> I can understand the case for min-size, but aspect-ratio looks a bit suspicious
> to me. Wouldn't that have to be flipped when changing the arrow orientation ?
> 
> Is there any example of aspect-ratio != 1 actually being used ?

Off head, displays with xdpi!=ydpi, not sure how common those are though, particularly in the embedded device space.
Comment 8 Michael Natterer 2008-09-03 13:56:10 UTC
Quick comment from the middle of another review:

gtk_arrow_size_request (GtkWidget *widget, GtkRequisition *requisition)

This must be:

gtk_arrow_size_request (GtkWidget      *widget,
                        GtkRequisition *requisition)

More later...
Comment 9 Michael Natterer 2008-09-03 14:43:57 UTC
Some more comments:

- the addition of a size-request implementation is needed regardless
  of the addition of the two style properties, since GtkArrow completely
  ignores changes of GtkMisc' padding properties.

- the aspect-radio needs to be honored in size-allocate too, not only
  in size-request, since the widget can always be allocated more space
  than it requested. It shouldn't fill its entire allocation with the
  arrow then but use the set aspect-ratio to center the arrow into the
  available space.
Comment 10 Christian Dywan 2008-09-29 09:46:23 UTC
Created attachment 119568 [details] [review]
Style fix and updated to trunk
Comment 11 Christian Dywan 2009-09-10 16:57:08 UTC
Mitch, any chance you could have another look?
Comment 12 Michael Natterer 2009-10-06 12:42:12 UTC
Yep:

- size_allocate() is only declared and not implemented
- Since: 2.20 now
- +    default:
  +      ;
  should probably say break; just for the sake of it

Other than that, I suppose you tested the behavior to work correctly,
because I didn't :)
Comment 13 Christian Dywan 2009-10-06 15:43:52 UTC
Created attachment 144899 [details] [review]
Update for GTK+ 2.20, removed size_allocate
Comment 14 Matthias Clasen 2009-11-28 06:05:23 UTC
Minimum size seems to work nicely, but I understand what aspect-ratio is supposed to do.
Comment 15 Matthias Clasen 2012-01-26 04:51:09 UTC
Looking at this again, I don't think GtkArrow needs any new features