GNOME Bugzilla – Bug 742552
OVER transitions in GtkStack don't obscure old widget until transition is finished
Last modified: 2018-05-02 16:21:17 UTC
Created attachment 294062 [details] GtkStack over/under transitions Attached a script to demonstrate. The transition from the "top" to "bottom" screen, using GTK_STACK_TRANSITION_TYPE_UNDER_UP, works fine, but the transition from bottom to top, using OVER_DOWN, does not. Both of the labels, the old label on the widget being replaced and the new label on the widget becoming the visible child, are visible at the same time until the transition is finished. I am using gtk3-3.14.6-1.fc21.x86_64 on Fedora 21.
your problem is simply that labels and boxes don't draw background, normally. replace your labels with entries, and things look as expected. to fix your actual problem, you should just make sure that the topmost container in each page draws a background, either by using a suitable container or style class or with some custom css.
(In reply to comment #1) > either by using a suitable container If not a box or a grid, then what? > or style class Given the volatility of the provided styles and lack of API documentation for them I'd prefer not to rely on this. Are you really saying that this is considered expected behavior? Could that be documented?
> If not a box or a grid, then what? If you just want a background, an event box would be an option. > Given the volatility of the provided styles and lack of API documentation for > them I'd prefer not to rely on this. Your choice. Should you reconsider, this line takes care of the problem here: over_label.get_style_context().add_class("background"); > Are you really saying that this is considered expected behavior? Could that be > documented? The fact that labels don't draw background by default is expected, and required for backwards compat. Whether stack pages should always have an enforced background or not, I'm not sure, which is why I haven't closed this bug yet.
(In reply to Matthias Clasen from comment #3) > Whether stack pages should always have an enforced background or not, I'm > not sure, which is why I haven't closed this bug yet. I would definitely vote no; there may be legitimate cases where people would want to swap different stack pages over a fixed background, so no background should be enforced. I'd say what we currently have is fine. What do you think nowadays?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/523.