[gnome-control-center] sound: Use GtkBox instead of GtkHBox
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] sound: Use GtkBox instead of GtkHBox
- Date: Wed, 2 Jul 2014 15:45:34 +0000 (UTC)
commit fa35a97fb2b3021a66b2447d4699f22c59a8b6ae
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Jul 2 15:05:58 2014 +0200
sound: Use GtkBox instead of GtkHBox
We need to account for the fact that unlike GtkHBox, GtkBox does not
expand the child in gtk_container_add.
https://bugzilla.gnome.org/show_bug.cgi?id=732624
panels/sound/gvc-balance-bar.c | 5 +++--
panels/sound/gvc-balance-bar.h | 4 ++--
panels/sound/gvc-channel-bar.c | 5 +++--
panels/sound/gvc-channel-bar.h | 4 ++--
panels/sound/gvc-combo-box.c | 5 +++--
panels/sound/gvc-combo-box.h | 4 ++--
6 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/panels/sound/gvc-balance-bar.c b/panels/sound/gvc-balance-bar.c
index 6353510..3b697ea 100644
--- a/panels/sound/gvc-balance-bar.c
+++ b/panels/sound/gvc-balance-bar.c
@@ -75,7 +75,7 @@ static gboolean on_scale_scroll_event (GtkWidget *widget,
static void on_adjustment_value_changed (GtkAdjustment *adjustment,
GvcBalanceBar *bar);
-G_DEFINE_TYPE (GvcBalanceBar, gvc_balance_bar, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GvcBalanceBar, gvc_balance_bar, GTK_TYPE_BOX)
static GtkWidget *
_scale_box_new (GvcBalanceBar *bar)
@@ -303,7 +303,7 @@ gvc_balance_bar_set_balance_type (GvcBalanceBar *bar,
/* frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (bar), frame);
+ gtk_box_pack_start (GTK_BOX (bar), frame, TRUE, TRUE, 0);
/* box with scale */
bar->priv->scale_box = _scale_box_new (bar);
@@ -536,6 +536,7 @@ gvc_balance_bar_new (const GvcChannelMap *channel_map, GvcBalanceType btype)
bar = g_object_new (GVC_TYPE_BALANCE_BAR,
"channel-map", channel_map,
"balance-type", btype,
+ "orientation", GTK_ORIENTATION_HORIZONTAL,
NULL);
return GTK_WIDGET (bar);
}
diff --git a/panels/sound/gvc-balance-bar.h b/panels/sound/gvc-balance-bar.h
index 929449a..f2204a3 100644
--- a/panels/sound/gvc-balance-bar.h
+++ b/panels/sound/gvc-balance-bar.h
@@ -45,13 +45,13 @@ typedef struct GvcBalanceBarPrivate GvcBalanceBarPrivate;
typedef struct
{
- GtkHBox parent;
+ GtkBox parent;
GvcBalanceBarPrivate *priv;
} GvcBalanceBar;
typedef struct
{
- GtkHBoxClass parent_class;
+ GtkBoxClass parent_class;
} GvcBalanceBarClass;
GType gvc_balance_bar_get_type (void);
diff --git a/panels/sound/gvc-channel-bar.c b/panels/sound/gvc-channel-bar.c
index d5f55ed..7fa4621 100644
--- a/panels/sound/gvc-channel-bar.c
+++ b/panels/sound/gvc-channel-bar.c
@@ -98,7 +98,7 @@ static gboolean on_scale_scroll_event (GtkWidget *widget,
GdkEventScroll *event,
GvcChannelBar *bar);
-G_DEFINE_TYPE (GvcChannelBar, gvc_channel_bar, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GvcChannelBar, gvc_channel_bar, GTK_TYPE_BOX)
static GtkWidget *
_scale_box_new (GvcChannelBar *bar)
@@ -936,7 +936,7 @@ gvc_channel_bar_init (GvcChannelBar *bar)
/* frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (bar), frame);
+ gtk_box_pack_start (GTK_BOX (bar), frame, TRUE, TRUE, 0);
gtk_widget_show_all (frame);
/* box with scale */
@@ -970,6 +970,7 @@ gvc_channel_bar_new (void)
{
GObject *bar;
bar = g_object_new (GVC_TYPE_CHANNEL_BAR,
+ "orientation", GTK_ORIENTATION_HORIZONTAL,
NULL);
return GTK_WIDGET (bar);
}
diff --git a/panels/sound/gvc-channel-bar.h b/panels/sound/gvc-channel-bar.h
index 5753d51..afa5231 100644
--- a/panels/sound/gvc-channel-bar.h
+++ b/panels/sound/gvc-channel-bar.h
@@ -35,13 +35,13 @@ typedef struct GvcChannelBarPrivate GvcChannelBarPrivate;
typedef struct
{
- GtkHBox parent;
+ GtkBox parent;
GvcChannelBarPrivate *priv;
} GvcChannelBar;
typedef struct
{
- GtkHBoxClass parent_class;
+ GtkBoxClass parent_class;
} GvcChannelBarClass;
GType gvc_channel_bar_get_type (void);
diff --git a/panels/sound/gvc-combo-box.c b/panels/sound/gvc-combo-box.c
index 4ccd39e..7dbe3c9 100644
--- a/panels/sound/gvc-combo-box.c
+++ b/panels/sound/gvc-combo-box.c
@@ -74,7 +74,7 @@ static void gvc_combo_box_class_init (GvcComboBoxClass *klass);
static void gvc_combo_box_init (GvcComboBox *combo_box);
static void gvc_combo_box_finalize (GObject *object);
-G_DEFINE_TYPE (GvcComboBox, gvc_combo_box, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (GvcComboBox, gvc_combo_box, GTK_TYPE_BOX)
void
gvc_combo_box_set_size_group (GvcComboBox *combo_box,
@@ -315,7 +315,7 @@ gvc_combo_box_init (GvcComboBox *combo_box)
/* frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (combo_box), frame);
+ gtk_box_pack_start (GTK_BOX (combo_box), frame, TRUE, TRUE, 0);
combo_box->priv->drop_box = box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
combo_box->priv->combobox = gtk_combo_box_new_with_model (combo_box->priv->model);
@@ -391,6 +391,7 @@ gvc_combo_box_new (const char *label)
GObject *combo_box;
combo_box = g_object_new (GVC_TYPE_COMBO_BOX,
"label", label,
+ "orientation", GTK_ORIENTATION_HORIZONTAL,
NULL);
return GTK_WIDGET (combo_box);
}
diff --git a/panels/sound/gvc-combo-box.h b/panels/sound/gvc-combo-box.h
index 136c251..97c3fb1 100644
--- a/panels/sound/gvc-combo-box.h
+++ b/panels/sound/gvc-combo-box.h
@@ -35,13 +35,13 @@ typedef struct GvcComboBoxPrivate GvcComboBoxPrivate;
typedef struct
{
- GtkHBox parent;
+ GtkBox parent;
GvcComboBoxPrivate *priv;
} GvcComboBox;
typedef struct
{
- GtkHBoxClass parent_class;
+ GtkBoxClass parent_class;
void (* changed) (GvcComboBox *combobox, const char *name);
void (* button_clicked) (GvcComboBox *combobox);
} GvcComboBoxClass;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]