Resizable GtkRevealer

I am looking for a way to get a resizable GtkRevealer widget, which behaves as if the GtkRevealer is coupled with a GtkPaned widget.

In essence, I want to use the GtkRevelear so the user can recover some screen real estate when the information in the GtkRevealer child is not needed. However, I also want to be able to resize the GtkRevealer so the user can select how much of the application window is taken by the GtkRevealer child when the revealer is shown.

Currently, I’ve added a GtkRevealer to a GtkPaned, which allows me to resize the GtkRevealer widget but when I hide the GtkRevealer, the side of the GtkPaned where the revealer is stays put.

Is there a way to accomplish what I am after? Thank you.

Currently, I’ve added a GtkRevealer to a GtkPaned, which allows me to resize the GtkRevealer widget but when I hide the GtkRevealer, the side of the GtkPaned where the revealer is stays put.

You have to connect to the revealer “notify::child-revealed” signal and hide the revealer widget when its child widget is completely hidden. The paned then hides the gutter because one of its childs is invisible.

Here are some informations on “notify::property” signals:

Now, an interesting bit. Objects have properties, right? Well, it turns out that, for each property an object has, there’s a corresponding signal called “notify::” and the function you hook up to it is always the same, no matter what is:

void property_name_has_changed (GObject *the_object, GParamSpec *pspec, gpointer user_data);

https://developer.pidgin.im/wiki/GObjectFeatures

I’d have an example in Python but attachments are disabled :confused:

Hi,

Thank you for the reply and suggestion. Works great! I am not getting the animation (when I “hide” the GtkRevealer, it just stays static for a split second and then just disappears) but that might be another issue.

Thank you

Great! Try setting the animation to SLIDE_LEFT
https://developer.gnome.org/gtk3/stable/GtkRevealer.html#gtk-revealer-set-transition-type

It already is SLIDE_LEFT with the default duration of 250 ms. Increasing the duration does not seem to change anything either.

Yep, happens to me too. After moving the gutter animations are broken.

“child-revealed” is true only while the child is exposed – fully. Therefore, it changes state after the open-slide and before the close-slide. Your call-back hides the “close” animation.

Hi Greg!

I have written a sample in python to test this. It seems that child-revealed changes state when a transition completes, be it open or close. So the signal fires after the open-slide and after the close-slide.

The name child-revealed is a bit misleading, seem to indicate what you say, i.e. child 100% shown.

Yes, that is correct.

However, in my code, I am actually using both “child-revealed” and “reveal-child”. With those two signals:

  1. Set GtkRevealer::visible = TRUE when reveal-child == 1,
  2. Set GtkRevealer::visible = FALSE when reveal-child == 0 && child-revealed == 0.

Using the above logic, the GtkRevealer become visible as soon as the request to reveal it is “received” and gets hidden only when the hide animation is fully complete.

So, in theory, I should be seeing both animations in both situations.

Yes doing so is better!
Anyway the close animation is broken even by doing nothing in signal handlers. We should file a bug…

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.