[anjuta-devel] placeholder in GDL
- From: Sébastien Granjoux <seb sfo free fr>
- To: Anjuta Mailing List <anjuta-devel-list gnome org>
- Cc: Fabien Parent <parent f gmail com>, valavanisalex googlemail com
- Subject: [anjuta-devel] placeholder in GDL
- Date: Sun, 24 Jun 2012 19:17:58 +0200
Hi all,
I'm still working on GDL. I have tried to understand the placeholder
part which is not documented yet.
I think this part is just not working. At the moment, you can create
place holder but I don't see any use.
I have searched the mailing list archives to get more information. This
is not working and hasn't been implemented in MonoDevelop C# port of
GDL. MonoDevelop uses a new docking library now but I haven't found any
documentation.
As far as I understand, the goal of placeholder was to keep some
information about the widget hierarchy even when the widget itself is
removed. In order to be able to save and restore the layout correctly.
This is my primary goal to work on GDL, so I'm trying to fix it. I plan
to do the following:
* Minimize and Hide will be different
See https://bugzilla.gnome.org/show_bug.cgi?id=317007
* Minimize will only hide the widget and not remove it.
When a GDL widget is hidden, we have to propagate this information to
its parent which can be hidden too if it was its only visible child. But
it is not like the current reduce function which is removing unneeded
widget, here the parent will be only hidden.
As it is hidden, we keep all the widgets hierarchy which can be saved
without needing anything special like placeholders. You can restore it
at the right position just by showing it again.
The drawback is that you need to handle hidden widgets, so by example
don't display the tab label if the corresponding page is hidden or do
not display the separator if a pane widget has only one child. It is
already done in Gtk widgets, this has to be implemented in Gdl widgets.
* Hide will replace the widget with a placeholder.
Currently the widget is still keep by the master. I think it will be
better to remove the widget completely and replace it with a placeholder.
The reduce function which is destroying automatic widgets (notebook and
pane) will be used only when a widget is moved to another place. Not
when the widget is hidden or replaced by a placeholder.
* Change placeholder
The placeholder will have the same name than the original widget and
will be always hidden. Then, the rules above apply. So if the parent has
only hidden children, it will be hidden too. So we keep the hierarchy of
automatic dock objects.
A placeholder will be a hidden widget used to replace an user widget. I
think that I don't need all the GtkWidget data for it because it is an
invisible GUI element, a GObject or even a C structure would be enough.
But the advantage of deriving from a GtkWidget is that it can be put in
the already existing widget hierarchy.
Another option will be to mirror this widget hierarchy and keep only the
needed data (size, position...). It is almost already done in
GdlDockLayout object using a XML tree. But I think it would make things
more complex.
The current code uses a third option. It get the widgets from the widget
hierarchy but keep the placeholder is another list. The GdlDockLayout
object has to merge both.
* Update GdlDockLayout
I need to save the state of the widget hidden or not and restore it
correctly.
Do you have some comments about these plans? Do you have questions? Do
you think something would be better done in another way? Do you have
other ideas for GDL?
I have almost done the minimize part, it seems to work at the moment.
Regards,
Sébastien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]