Mail Archives: geda-user/2016/03/30/00:01:11
Hi all,
while rewriting the menu.res infrastructure in pcb-rnd, I stumbled upon
the following gtk hid bug.
If "Alternate window layout to allow smaller vertical size" is set and
gpcb-menu.res is edited to be shorter, some of the tools may disappear:
http://igor2.repo.hu/tmp/pcb_gtk1.jpg
I'd expect the box to be as wide as the wider one of the menu bar and
tools (mode_toolbar), but currently it's only as wide as the menu bar.
Which goes unnoticed, provided the menu bar is wide enough.
I've "fixed" it in pcb-rnd r1439. It's an ugly workaround, but
tested it with all combination of short/long menu bars and alternate
layout options and always worked properly. Also, if the workaround breaks,
worst case it can't end up being more broken than before.
Details: it seems adding image to a toolbar button doesn't set the
requisite size of the button properly, but leaves it 0. In turn this ends
up creating the whole toolbar with requisite width of 0. This means the
toolbar doesn't try to make its container any wider than 0 pixels, no
matter how many tool buttons we pack.
If other widgets in the same box system sets up the container of the
toolbar to be wide enough, things properly display, otherwise the leftmost
widgets of the toolbar is displayed until the first widget (button) that
can't be fully fit.
I couldn't figure how to fix the requisite size. (gtk+2 is a PITA).
Instead, I calculated the expected width of the toolbar looking at input
icon image widths and packed an invisible hbox that is just as wide as all
the buttons need. This invisible hbox stretches its parent to the right
width. The same parent is the parent of the toolbar, so it just works.
Don't ask me why I had to use the 3/4 of the calculated width to set up
the invisible box.
If someone figures how to fix this properly, please send me the patch so I
can fix it in pcb-rnd.
Regards,
Igor2
- Raw text -