[libhandy/wip/haecker-felix/flap-widget: 75/98] Implement hdy_flap_forall() and hdy_flap_remove()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/wip/haecker-felix/flap-widget: 75/98] Implement hdy_flap_forall() and hdy_flap_remove()
- Date: Mon, 3 Aug 2020 16:27:56 +0000 (UTC)
commit 3169905dc40428d46eb057f0548e415df37efb5c
Author: Felix Häcker <haeckerfelix gnome org>
Date: Mon Jul 27 18:11:38 2020 +0200
Implement hdy_flap_forall() and hdy_flap_remove()
src/hdy-flap.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/src/hdy-flap.c b/src/hdy-flap.c
index 3682e834..4cc464f7 100644
--- a/src/hdy-flap.c
+++ b/src/hdy-flap.c
@@ -382,11 +382,52 @@ hdy_flap_get_preferred_height (GtkWidget *widget,
minimum, natural, NULL, NULL);
}
+static void
+hdy_flap_forall (GtkContainer* base,
+ gboolean include_internals,
+ GtkCallback callback,
+ gpointer callback_target)
+{
+ HdyFlap * self;
+ GtkWidget* content;
+ GtkWidget* flap;
+ self = (HdyFlap*) base;
+
+ content = gtk_bin_get_child ((GtkBin*) self);
+ if (content != NULL) {
+ callback (content, callback_target);
+ }
+
+ flap = hdy_flap_get_flap (self);
+ if (flap != NULL) {
+ callback (flap, callback_target);
+ }
+}
+
+static void
+hdy_flap_remove (GtkContainer* base,
+ GtkWidget* widget)
+{
+ HdyFlap * self;
+ GtkWidget* flap;
+ self = (HdyFlap*) base;
+
+ g_return_if_fail (widget != NULL);
+
+ flap = hdy_flap_get_flap (self);
+ if (widget == flap) {
+ hdy_flap_set_flap (self, NULL);
+ } else {
+ gtk_container_remove (GTK_CONTAINER (self), widget);
+ }
+}
+
static void
hdy_flap_class_init (HdyFlapClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
object_class->get_property = hdy_flap_get_property;
object_class->set_property = hdy_flap_set_property;
@@ -397,6 +438,9 @@ hdy_flap_class_init (HdyFlapClass *klass)
widget_class->get_preferred_height_for_width = hdy_flap_get_preferred_height_for_width;
widget_class->size_allocate = hdy_flap_size_allocate;
+ container_class->remove = hdy_flap_remove;
+ container_class->forall = hdy_flap_forall;
+
/**
* HdyFlap:flap:
*
@@ -690,7 +734,7 @@ hdy_flap_get_overlay (HdyFlap *self)
*
* Since: 1.0
*/
-void
+static void
hdy_flap_set_overlay (HdyFlap *self,
gboolean overlay)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]