Greetings to all.
As a simple introduction may I say I thank you all for your work on
Dillo.
Currently, I am trying to implement the Close-Tab button. I've been
discussing it with Jorge Arellano Cid and he suggested I 'brought-it' to
dillo-dev.
FLTK Tabs don't support a close-tab button, as many of you have seen,
and the idea was to have a button at the end of the tabs list.
For that, I created an fltk::Button widget in CustTabGroup. I position
this widget at the end of the tabs list and, then, I add() it to the
CustTabGroup's parent() (UI).
After that, I set the UI's resizer() to be an InvisibleBox positioned in
such a way that it doesn't resize the button itself, but only moves it.
Refreshing the button (when changing/adding/closing tabs) is done in the
handle() method of the CustTabGroup.
Just a second ago I solved one of the problems, which was the fact that
tab_height() returned 0 in the constructor and resize() didn't work. I
worked around that by constructing the button only in event() if
tab_height()>0 and it hasn't been constructed yet. This way we can use
the correct height for the button.
It may not seem reliable to do so many things in handle(). Any
suggestions?
It is functional, only you can say if it fully suits Dillo's needs
though.
Unfortunately, there are some problems:
The first one is the most-relevant one. When the list of tabs grows it
can go over the button. I have been trying to fix this, but I can't seem
to do it.
A possible way could (maybe) be to 'trick' the pager into thinking it
has less space left to draw the tabs, and that could possibly be
achieved using update_positions(), although I am having some problems
with that.
The second problem is a minor one, but annoying. I believe when CSS
rendering is triggered, the render area flickers and that is normal.
However, the way I implemented this (probably because of it being in
handle()) makes the Button also flash.
Thanks,
Jo?o