[gtk] levelbar: Use a bin layout
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] levelbar: Use a bin layout
- Date: Wed, 25 Sep 2019 15:54:00 +0000 (UTC)
commit ca3d855c44f5bab8de4815756c452f736964d83f
Author: Timm Bäder <mail baedert org>
Date: Sat Sep 21 12:56:09 2019 +0200
levelbar: Use a bin layout
gtk/gtklevelbar.c | 37 ++-----------------------------------
1 file changed, 2 insertions(+), 35 deletions(-)
---
diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c
index 08d0ee50d8..1186bd9f5f 100644
--- a/gtk/gtklevelbar.c
+++ b/gtk/gtklevelbar.c
@@ -119,6 +119,7 @@
*/
#include "config.h"
+#include "gtkbinlayout.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
#include "gtkintl.h"
@@ -418,24 +419,6 @@ gtk_level_bar_measure_trough (GtkGizmo *gizmo,
*natural = size;
}
-static void
-gtk_level_bar_measure (GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline)
-{
- GtkLevelBarPrivate *priv = gtk_level_bar_get_instance_private (GTK_LEVEL_BAR (widget));
-
- gtk_widget_measure (priv->trough_widget,
- orientation,
- for_size,
- minimum, natural,
- minimum_baseline, natural_baseline);
-}
-
static void
gtk_level_bar_allocate_trough_continuous (GtkLevelBar *self,
int width,
@@ -552,21 +535,6 @@ gtk_level_bar_allocate_trough (GtkGizmo *gizmo,
gtk_level_bar_allocate_trough_discrete (self, width, height, baseline);
}
-static void
-gtk_level_bar_size_allocate (GtkWidget *widget,
- int width,
- int height,
- int baseline)
-{
- GtkLevelBarPrivate *priv = gtk_level_bar_get_instance_private (GTK_LEVEL_BAR (widget));
-
- gtk_widget_size_allocate (priv->trough_widget,
- &(GtkAllocation) {
- 0, 0,
- width, height
- }, baseline);
-}
-
static void
update_block_nodes (GtkLevelBar *self)
{
@@ -962,8 +930,6 @@ gtk_level_bar_class_init (GtkLevelBarClass *klass)
oclass->set_property = gtk_level_bar_set_property;
oclass->finalize = gtk_level_bar_finalize;
- wclass->size_allocate = gtk_level_bar_size_allocate;
- wclass->measure = gtk_level_bar_measure;
wclass->direction_changed = gtk_level_bar_direction_changed;
g_object_class_override_property (oclass, PROP_ORIENTATION, "orientation");
@@ -1065,6 +1031,7 @@ gtk_level_bar_class_init (GtkLevelBarClass *klass)
g_object_class_install_properties (oclass, LAST_PROPERTY, properties);
gtk_widget_class_set_accessible_type (wclass, GTK_TYPE_LEVEL_BAR_ACCESSIBLE);
+ gtk_widget_class_set_layout_manager_type (wclass, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_css_name (wclass, I_("levelbar"));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]