GNOME Bugzilla – Bug 538782
Make GtkMenu's arrow size themable
Last modified: 2008-09-24 08:56:46 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.)
Created attachment 112913 [details] [review] Implement GtkMenu::arrow-scaling
I think we want the arrows to be scaled with the font size instead.
(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.
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.
> 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
> 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 :-)
Now that all clarity was cleared, how do you like it?
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.
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).
Please update since tags to 2.16