After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 738480 - Support GtkStack and GtkStackSwitcher
Support GtkStack and GtkStackSwitcher
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-13 20:30 UTC by Matthias Clasen
Modified: 2016-08-10 09:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Support GtkStack and GtkStackSwitcher (12.64 KB, patch)
2014-10-13 20:30 UTC, Matthias Clasen
none Details | Review
Load gnome-taquin/data/taquin.ui using glade (80.48 KB, image/png)
2015-02-19 16:54 UTC, Sahil Sareen
  Details

Description Matthias Clasen 2014-10-13 20:30:09 UTC
These widgets are in GTK+ since 3.12, time that glade starts
supporting them.
Comment 1 Matthias Clasen 2014-10-13 20:30:17 UTC
Created attachment 288418 [details] [review]
Support GtkStack and GtkStackSwitcher
Comment 2 Matthias Clasen 2014-10-14 17:53:22 UTC
pushed a stack branch now
Comment 3 Matthias Clasen 2014-11-03 01:58:32 UTC
I've added editors for GtkStack and GtkStackSwitcher now. 

One thing that could be improved is to use a custom control for the visible-child-name property that offers only the names of the existing children. Maybe a combobox.
Comment 4 Juan Pablo Ugarte 2014-11-10 21:30:23 UTC
> I've added editors for GtkStack and GtkStackSwitcher now. 
> 
> One thing that could be improved is to use a custom control for the
> visible-child-name property that offers only the names of the existing
> children. Maybe a combobox.

Yes a combo box would be great!

BTW it could also be used as a way to switch between pages, (same as GtkNotebook "edit page" virtual property) which is needed to switch to an empty page since placeholders are not shown in the treeview.

A few notes about the branch

GtkStack:
  o child widget is not removed from the project when removing a page
  o removing last page, leave the widget without a way to add a new page
    (perhaps GtkStack needs an Append Page action)
  o title packing property needs a default value so switcher has
    something to show.

GtkStackSwitcher:
  o stack property should have custom-layout="True" to avoid showing it twice
Comment 5 Matthias Clasen 2014-11-11 03:50:19 UTC
I think all of your comments should be fixed now.

I ended up adding a virtual int property for the edited page, that was easier than making a custom combo for visible-child-name.
Comment 6 Tristan Van Berkom 2014-11-20 13:47:08 UTC
Taking an initial look at this:


Stack:

  o 'Remove page' packing action should be disabled when there is only one page,
     as it allows a situation of a stack with no pages

     This is expecially undesirable because there is no direct 'append/prepend'
     page action, so it's unclear how to add a page to a pageless stack

     Alternatively we could just allow the stack to have 0 pages, and add
     a direct action on the stack object allowing one to append/prepend a page.

Stack Switcher:

  o Weird things happen when double-clicking on one of the stack switcher
    pages.

    I get a popover with a search window listing a bunch of glade widgets,
    if I select a toplevel, it actually adds it to the project.

    Selecting a widget leaves an empty popover hovering there

  o The icon is a little sharp for this one and sort of stands out from
    the rest of the icons in the palette, would be nice to have an icon
    which uses the grays we normally use.
Comment 7 Tristan Van Berkom 2014-11-21 05:59:28 UTC
Today I did a full review.

> Stack:
> 
>   o 'Remove page' packing action should be disabled when there is only one
> page,
>      as it allows a situation of a stack with no pages
> 
>      This is expecially undesirable because there is no direct 'append/prepend'
>      page action, so it's unclear how to add a page to a pageless stack
> 
>      Alternatively we could just allow the stack to have 0 pages, and add
>      a direct action on the stack object allowing one to append/prepend a page.

The above will really be nice to have, but I'm not blocking the merge
based on this.

> 
> Stack Switcher:
> 
>   o Weird things happen when double-clicking on one of the stack switcher
>     pages.
> 
>     I get a popover with a search window listing a bunch of glade widgets,
>     if I select a toplevel, it actually adds it to the project.
> 
>     Selecting a widget leaves an empty popover hovering there

The above is my mistake, I wasn't aware of the feature Juan added, we
should probably make it behave in a less intrusive/unexpected way.

>   o The icon is a little sharp for this one and sort of stands out from
>     the rest of the icons in the palette, would be nice to have an icon
>     which uses the grays we normally use.

The above, again, would be really nice to have, but I really appreciate that
you have been including icons in all your patches, we've went though stints
where many widgets were added without icons.

For what it's worth, the colors being used is not so very much of an issue,
however the way the black on white behaves in the rounded corner is really
yuck (the lack of antialiasing at this small size really stands out, compared
to the rest of Glade's icons).

Again, I wont block the merge on this.

Finally, I've looked through all the added code, and it looks more or less
sane except for one thing, which is the updating of child positions in the
plugin when a position changes.

However, this is not a problem that is particular to your branch, GtkBox
adaptor and GtkNotebook both have 'issues' in this regard, so I also will
not block the merge based on this. We rather need a real unilateral fix
for handling the child positions, and it probably needs to be done in
a custom editor for each of these classes, hopefully with some level of
code sharing.

All of that said, I'm mergeing the branch as is, I would really like a
cleaner icon, and it would be nice to do something cleaner for the 0 page
situation, but the base functionality as far as I can see is as good as it
needs to be.
Comment 8 Tristan Van Berkom 2014-11-21 06:00:18 UTC
Comment on attachment 288418 [details] [review]
Support GtkStack and GtkStackSwitcher

Marking patch obsolete, code went onto the branch, and the branch is merged now.
Comment 9 Jorge Araya Navarro 2015-01-24 06:52:57 UTC
I'm using Glade 3.18.3 and such widget is not available on the editor.
Comment 10 Sahil Sareen 2015-02-19 16:54:33 UTC
Created attachment 297286 [details]
Load gnome-taquin/data/taquin.ui using glade

(In reply to Tristan Van Berkom from comment #8)
> Comment on attachment 288418 [details] [review] [review]
> Support GtkStack and GtkStackSwitcher
> 
> Marking patch obsolete, code went onto the branch, and the branch is merged
> now.

I couldn't get this to work, I tried to see gnome-taquin's data/taquin.ui using glade.

[sahilsareen@localhost data]$ glade --version
glade 3.18.3

Attaching a screenshot of what I saw on the glade screen.
Comment 11 Tobias Mueller 2016-06-10 13:22:53 UTC
which glade release is GtkStack supposed to be in?
Comment 12 gnome.vrb 2016-08-10 09:09:49 UTC
In Glade 3.19.0 as per NEWS file below:

https://github.com/GNOME/glade/blob/74b21b316c8d5c8176a479f275437d3a1da7fc21/NEWS

Search for "738480" ( this bug no. ) in the page.