delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2016/03/30/00:01:11

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Wed, 30 Mar 2016 06:05:36 +0200 (CEST)
X-X-Sender: igor2 AT igor2priv
To: geda-user AT delorie DOT com
X-Debug: to=geda-user AT delorie DOT com from="gedau AT igor2 DOT repo DOT hu"
From: gedau AT igor2 DOT repo DOT hu
Subject: [geda-user] pcb gtk bugreport
Message-ID: <alpine.DEB.2.00.1603300424250.7885@igor2priv>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019