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 538782 - Make GtkMenu's arrow size themable
Make GtkMenu's arrow size themable
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-06-17 15:11 UTC by Christian Dywan
Modified: 2008-09-24 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement GtkMenu::arrow-scaling (1.49 KB, patch)
2008-06-17 15:12 UTC, Christian Dywan
none Details | Review
Implement GtkMenu::arrow-scaling, updated (1.47 KB, patch)
2008-06-19 13:07 UTC, Christian Dywan
committed Details | Review

Description Christian Dywan 2008-06-17 15:11:26 UTC
GtkMenu draws its arrows with a hardcoded size. The theme should be able to adjust the size of the arrow. (This is similar to but not the same as GtkMenuItem::arrow-scaling.)
Comment 1 Christian Dywan 2008-06-17 15:12:12 UTC
Created attachment 112913 [details] [review]
Implement GtkMenu::arrow-scaling
Comment 2 Matthias Clasen 2008-06-19 05:29:26 UTC
I think we want the arrows to be scaled with the font size instead.
Comment 3 Tim Janik 2008-06-19 11:38:38 UTC
(In reply to comment #2)
> I think we want the arrows to be scaled with the font size instead.

Matthias, this property is just about how big the scroll arrows are drawn prortionally to the predetermined scroll arrow area.
Adapting scroll arrows in accordance to e.g. font-size would be about changing GtkWidget::scroll-arrow-vlength. However the patch in this bug is about making the constant "0.7" in arrow_size = 0.7 * GtkWidget::scroll-arrow-vlength; configurable, just like the hard coded "0.7" proportion in gtkarrow.c was turned into GtkArrow::arrow-scaling (default 0.7) at some point.

Christian, the comment indentation looks wierd here:
+ /**
+   * GtkMenu::arrow-scaling
+   *

Should be:

+ /**
+  * GtkMenu::arrow-scaling
+  *

And the doc string should refer to the full style property name: GtkWidget::scroll-arrow-vlength.
Comment 4 Christian Dywan 2008-06-19 13:07:21 UTC
Created attachment 113039 [details] [review]
Implement GtkMenu::arrow-scaling, updated

Thanks for the pointers, I updated the patch and in fact I replaced the blurb with the text in the documenting comment above.
Comment 5 Christian Dywan 2008-06-19 13:15:32 UTC
> Adapting scroll arrows in accordance to e.g. font-size would be about changing
> GtkWidget::scroll-arrow-vlength. However the patch in this bug is about making
> the constant "0.7" in arrow_size = 0.7 * GtkWidget::scroll-arrow-vlength;
> configurable, just like the hard coded "0.7" proportion in gtkarrow.c was
> turned into GtkArrow::arrow-scaling (default 0.7) at some point.

Just to prevent confusion: Note that scroll-arrow-vlength is taken into account, but the formula is slightly more complex than what GtkMenuItem does. Basically it ends up with this:

    arrow_space = scroll_arrow_vlength - 2 * widget->style->ythickness
    arrow_size = arrow_scaling * arrow_space
Comment 6 Matthias Clasen 2008-06-19 13:59:48 UTC
> Matthias, this property is just about how big the scroll arrows are drawn
> prortionally to the predetermined scroll arrow area.

Ah, would have helped if I had actually read the patch :-)
Comment 7 Christian Dywan 2008-08-04 13:19:28 UTC
Now that all clarity was cleared, how do you like it?
Comment 8 Christian Dywan 2008-08-13 15:31:02 UTC
Tim suggested in private, that we might want to expressly call this new style property scroll-arrow-scaling since there already is GtkMenu::arrow-scaling and that might confuse people, plus there is scroll-arrow-vlength as well.

I'm not sure at this point what the best decision is, but I guess this will have to wait until after 2.14 anyway.
Comment 9 Michael Natterer 2008-09-03 11:11:34 UTC
I don't think we should go for scroll-arrow-scaling here just because
GtkMenuItem already has arrow-scaling. There is no way of finding style
properties without reading documentation anyway, and we have
GtkArrow::arrow-scaling and GtkRange::arrow-scaling already, so
I vote for consistency rather than marginally improved unconfusing.

Please commit after we branched for 2.15 (unless tim eeks loudly now).
Comment 10 Matthias Clasen 2008-09-18 15:54:58 UTC
Please update since tags to 2.16