GtkComboBox size allocations magic?



Hi,

I've been trying to figure out how gtkcombobox handles size allocations
and I'm puzzled, it seems to have some very interesting magic involved.
I guess the '/* WELCOME, to THE house of evil code */' isn't kidding. I
was hoping maybe you could clarify some of issues here?

Anyway, for one in menu mode combobox seems to be managing allocations
for its arrow and separator grandgrandchildren, overriding the GtkHBox
inside GtkButton. Why is that? Shouldn't the button/box be able to
handle the allocations?

The other thing is BONUS_PADDING, 'focus-line-width' and 'focus-padding'
that are used in seemingly random fashion. For example
gtk_combo_box_remeasure() and gtk_combo_box_calc_requested_width() are
calculating more or less the same thing (one for one row, the other for
all rows) but they take (some) padding into account very differently.
What is the difference between those calculations?

I guess the intent (somewhere) is to get the currently active text and
the text in the popup nicely aligned. This seems to be happening with
GtkComboBoxEntry but not really with GtkComboBox, both in _new_text()
mode (it's much more visible if you exaggerate xthickness.) I think
there are some assumptions about certain pixels measurements which
happen to be true with default theme, but not necessarily others.

Shouldn't the combobox be checking the theming done on the popup
window/frame/scrollbar when calculating its own size requests?


-- 
Tommi Komulainen                            <tommi komulainen nokia com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]