[Xfce4-commits] [apps/xfce4-mixer] 01/03: Migrate to GTK 3.14+, except for xfce-mixer-window.{c, h}
noreply at xfce.org
noreply at xfce.org
Fri Jul 8 21:22:16 CEST 2016
This is an automated email from the git hooks/post-receive script.
landry pushed a commit to branch master
in repository apps/xfce4-mixer.
commit 851d44dbce9b5f0f9b8b356b00bc4eb46b79c45e
Author: Mike Gelfand <mikedld at mikedld.com>
Date: Tue Jul 5 17:27:58 2016 +0300
Migrate to GTK 3.14+, except for xfce-mixer-window.{c,h}
---
configure.ac.in | 18 ++---
panel-plugin/mixer.desktop.in | 1 +
panel-plugin/xfce-mixer-plugin.c | 17 ++--
panel-plugin/xfce-plugin-dialog.c | 26 ++++---
panel-plugin/xfce-volume-button.c | 128 ++++++++++++++++++++++---------
xfce4-mixer/xfce-mixer-container.c | 78 ++++++-------------
xfce4-mixer/xfce-mixer-controls-dialog.c | 9 ++-
xfce4-mixer/xfce-mixer-option.c | 8 +-
xfce4-mixer/xfce-mixer-track.c | 63 ++++++---------
xfce4-mixer/xfce-mixer-window.c | 7 +-
10 files changed, 186 insertions(+), 169 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 57ae07c..4b545a8 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -93,22 +93,22 @@ AC_CHECK_LIB([m],[round])
dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
-XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
-XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.24.0])
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.42.0])
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.42.0])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.84])
XDT_CHECK_PACKAGE([GST_PLUGINS_BASE], [gstreamer-plugins-base-0.10], [0.10.25])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.20.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.10.0])
-XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.14.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.12.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.12.0])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.12.0])
dnl ***********************************
dnl *** Check for optional packages ***
dnl ***********************************
-XDT_CHECK_OPTIONAL_PACKAGE([KEYBINDER], [keybinder], [0.2.2], [keybinder],
+XDT_CHECK_OPTIONAL_PACKAGE([KEYBINDER], [keybinder-3.0], [0.3], [keybinder],
[keybinder Support])
-XDT_CHECK_OPTIONAL_PACKAGE([UNIQUE], [unique-1.0], [1.1], [unique],
+XDT_CHECK_OPTIONAL_PACKAGE([UNIQUE], [unique-3.0], [3.0], [unique],
[unique Support])
dnl ***********************************
diff --git a/panel-plugin/mixer.desktop.in b/panel-plugin/mixer.desktop.in
index f4e7637..728f808 100644
--- a/panel-plugin/mixer.desktop.in
+++ b/panel-plugin/mixer.desktop.in
@@ -6,3 +6,4 @@ Icon=multimedia-volume-control
X-XFCE-Internal=false
X-XFCE-Module=mixer
X-XFCE-Unique=true
+X-XFCE-API=2.0
diff --git a/panel-plugin/xfce-mixer-plugin.c b/panel-plugin/xfce-mixer-plugin.c
index 949e63e..85f4805 100644
--- a/panel-plugin/xfce-mixer-plugin.c
+++ b/panel-plugin/xfce-mixer-plugin.c
@@ -276,7 +276,7 @@ xfce_mixer_plugin_init (XfceMixerPlugin *mixer_plugin)
xfce_mixer_dump_gst_data ();
/* Create container for the plugin */
- mixer_plugin->hvbox = GTK_WIDGET (xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0));
+ mixer_plugin->hvbox = GTK_WIDGET (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
xfce_panel_plugin_add_action_widget (XFCE_PANEL_PLUGIN (mixer_plugin), mixer_plugin->hvbox);
gtk_container_add (GTK_CONTAINER (mixer_plugin), mixer_plugin->hvbox);
gtk_widget_show (mixer_plugin->hvbox);
@@ -300,7 +300,6 @@ xfce_mixer_plugin_construct (XfcePanelPlugin *plugin)
{
XfceMixerPlugin *mixer_plugin = XFCE_MIXER_PLUGIN (plugin);
GtkWidget *command_menu_item;
- GtkWidget *command_image;
xfce_panel_plugin_menu_show_configure (plugin);
@@ -311,10 +310,7 @@ xfce_mixer_plugin_construct (XfcePanelPlugin *plugin)
gtk_widget_show (mixer_plugin->mute_menu_item);
/* Add menu item for running the user-defined command */
- command_image = gtk_image_new_from_icon_name ("multimedia-volume-control", GTK_ICON_SIZE_MENU);
- gtk_widget_show (command_image);
- command_menu_item = gtk_image_menu_item_new_with_mnemonic (_("Run Audio Mi_xer"));
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (command_menu_item), command_image);
+ command_menu_item = gtk_menu_item_new_with_mnemonic (_("Run Audio Mi_xer"));
xfce_panel_plugin_menu_insert_item (plugin, GTK_MENU_ITEM (command_menu_item));
g_signal_connect_swapped (G_OBJECT (command_menu_item), "activate", G_CALLBACK (xfce_mixer_plugin_command_item_activated), mixer_plugin);
gtk_widget_show (command_menu_item);
@@ -608,6 +604,9 @@ xfce_mixer_plugin_size_changed (XfcePanelPlugin *plugin,
gint size)
{
XfceMixerPlugin *mixer_plugin = XFCE_MIXER_PLUGIN (plugin);
+ GtkBorder button_padding;
+ gint xthickness;
+ gint ythickness;
gint icon_size;
g_return_val_if_fail (mixer_plugin != NULL, FALSE);
@@ -616,7 +615,11 @@ xfce_mixer_plugin_size_changed (XfcePanelPlugin *plugin,
size /= xfce_panel_plugin_get_nrows (XFCE_PANEL_PLUGIN (mixer_plugin));
/* Determine size for the volume button icons */
- icon_size = size - 2 - 2 * MAX (mixer_plugin->button->style->xthickness, mixer_plugin->button->style->ythickness);
+ gtk_style_context_get_padding (gtk_widget_get_style_context (GTK_WIDGET (mixer_plugin->button)), GTK_STATE_FLAG_NORMAL,
+ &button_padding);
+ xthickness = button_padding.left + button_padding.right;
+ ythickness = button_padding.top + button_padding.bottom;
+ icon_size = size - 2 - MAX (xthickness, ythickness);
/* Set volume button icon size and update the volume button */
xfce_volume_button_set_icon_size (XFCE_VOLUME_BUTTON (mixer_plugin->button), icon_size);
diff --git a/panel-plugin/xfce-plugin-dialog.c b/panel-plugin/xfce-plugin-dialog.c
index f89f872..64dbf4d 100644
--- a/panel-plugin/xfce-plugin-dialog.c
+++ b/panel-plugin/xfce-plugin-dialog.c
@@ -142,7 +142,7 @@ xfce_plugin_dialog_new (XfcePanelPlugin *plugin)
static void
xfce_plugin_dialog_create_contents (XfcePluginDialog *dialog)
{
- GtkWidget *table;
+ GtkWidget *grid;
GtkWidget *button;
GtkWidget *label;
@@ -151,33 +151,35 @@ xfce_plugin_dialog_create_contents (XfcePluginDialog *dialog)
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), _("Configure the sound card and mixer track"));
- button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+ button = gtk_button_new_with_mnemonic (_("_Close"));
+ gtk_button_set_image (GTK_BUTTON (button),
+ gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_BUTTON));
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CLOSE);
gtk_widget_show (button);
- table = gtk_table_new (2, 2, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 12);
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_container_set_border_width (GTK_CONTAINER (table), 6);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
- gtk_widget_show (table);
+ grid = gtk_grid_new ();
+ g_object_set (G_OBJECT (grid), "row-spacing", 6, "column-spacing", 12, "margin-top", 6, "margin-bottom", 6, NULL);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), grid);
+ gtk_widget_show (grid);
label = gtk_label_new_with_mnemonic (_("Sound _card:"));
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
gtk_widget_show (label);
dialog->card_combo = xfce_mixer_card_combo_new (NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->card_combo);
- gtk_table_attach (GTK_TABLE (table), dialog->card_combo, 1, 2, 0, 1, GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
+ g_object_set (G_OBJECT (dialog->card_combo), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (grid), dialog->card_combo, 1, 0, 1, 1);
gtk_widget_show (dialog->card_combo);
label = gtk_label_new_with_mnemonic (_("Mixer _track:"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dialog->track_combo);
- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
gtk_widget_show (label);
dialog->track_combo = xfce_mixer_track_combo_new (NULL, NULL);
- gtk_table_attach (GTK_TABLE (table), dialog->track_combo, 1, 2, 1, 2, GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
+ g_object_set (G_OBJECT (dialog->track_combo), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (grid), dialog->track_combo, 1, 1, 1, 1);
gtk_widget_show (dialog->track_combo);
/* Hack to initialize the widget state */
diff --git a/panel-plugin/xfce-volume-button.c b/panel-plugin/xfce-volume-button.c
index 6877614..5589112 100644
--- a/panel-plugin/xfce-volume-button.c
+++ b/panel-plugin/xfce-volume-button.c
@@ -152,7 +152,7 @@ struct _XfceVolumeButton
GtkWidget *vbox;
/* Adjustment for the volume range and current value */
- GtkObject *adjustment;
+ GtkAdjustment *adjustment;
/* Icon size currently used */
gint icon_size;
@@ -292,7 +292,7 @@ xfce_volume_button_init (XfceVolumeButton *button)
/* Make the button look flat and make it never grab the focus */
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
+ gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_default (GTK_WIDGET (button), FALSE);
gtk_widget_set_can_focus (GTK_WIDGET (button), FALSE);
@@ -499,13 +499,13 @@ xfce_volume_button_create_dock_contents (XfceVolumeButton *button)
* not matter here since only one of the boxes it holds will be visibe at any
* time depending on the panel orientation
*/
- box = gtk_vbox_new (TRUE, 6);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (box), 2);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
/* Container for the widgets shown in vertical mode */
- button->hbox = gtk_hbox_new(FALSE, 6);
+ button->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (box), button->hbox, TRUE, TRUE, 0);
/* Show the position of lowest and highest volume through icons */
@@ -513,7 +513,7 @@ xfce_volume_button_create_dock_contents (XfceVolumeButton *button)
gtk_box_pack_start (GTK_BOX (button->hbox), image, TRUE, TRUE, 0);
gtk_widget_show (image);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (button->adjustment));
+ scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (button->adjustment));
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_box_pack_start (GTK_BOX (button->hbox), scale, TRUE, TRUE, 0);
gtk_widget_set_size_request (scale, SCALE_SIZE, -1);
@@ -525,10 +525,10 @@ xfce_volume_button_create_dock_contents (XfceVolumeButton *button)
gtk_widget_show (image);
/* Container for the widgets shown in horizontal mode */
- button->vbox = gtk_vbox_new(FALSE, 6);
+ button->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (box), button->vbox, TRUE, TRUE, 0);
- scale = gtk_vscale_new (GTK_ADJUSTMENT (button->adjustment));
+ scale = gtk_scale_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (button->adjustment));
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_range_set_inverted (GTK_RANGE (scale), TRUE);
gtk_box_pack_start (GTK_BOX (button->vbox), scale, TRUE, TRUE, 0);
@@ -549,6 +549,72 @@ xfce_volume_button_create_dock_contents (XfceVolumeButton *button)
+static gboolean
+xfce_volume_button_grab_input (XfceVolumeButton *button)
+{
+ GtkWidget *dock = button->dock;
+ GdkWindow *window = gtk_widget_get_window (dock);
+ GdkDisplay *display = gtk_widget_get_display (dock);
+#if GTK_CHECK_VERSION(3, 20, 0)
+ GdkSeat *seat = gdk_display_get_default_seat (display);
+#else
+ GdkDeviceManager *device_manager = gdk_display_get_device_manager (display);
+ GdkDevice *pointer = gdk_device_manager_get_client_pointer (device_manager);
+ GdkDevice *keyboard = gdk_device_get_associated_device (pointer);
+#endif
+
+ gtk_grab_add (dock);
+
+#if GTK_CHECK_VERSION(3, 20, 0)
+ if (gdk_seat_grab (seat, window, GDK_SEAT_CAPABILITY_ALL, TRUE, NULL, NULL, NULL, NULL) != GDK_GRAB_SUCCESS)
+ goto fail_remove_grab;
+#else
+ if (gdk_device_grab (pointer, window, GDK_OWNERSHIP_WINDOW, TRUE, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK, NULL, GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
+ goto fail_remove_grab;
+
+ if (gdk_device_grab (keyboard, window, GDK_OWNERSHIP_WINDOW, TRUE, GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL,
+ GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
+ {
+ gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
+ goto fail_remove_grab;
+ }
+#endif
+
+ return TRUE;
+
+fail_remove_grab:
+ gtk_grab_remove (dock);
+ return FALSE;
+}
+
+
+
+static void
+xfce_volume_button_ungrab_input (XfceVolumeButton *button)
+{
+ GtkWidget *dock = button->dock;
+ GdkDisplay *display = gtk_widget_get_display (dock);
+#if GTK_CHECK_VERSION(3, 20, 0)
+ GdkSeat *seat = gdk_display_get_default_seat (display);
+#else
+ GdkDeviceManager *device_manager = gdk_display_get_device_manager (display);
+ GdkDevice *pointer = gdk_device_manager_get_client_pointer (device_manager);
+ GdkDevice *keyboard = gdk_device_get_associated_device (pointer);
+#endif
+
+#if GTK_CHECK_VERSION(3, 20, 0)
+ gdk_seat_ungrab (seat);
+#else
+ gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
+ gdk_device_ungrab (keyboard, GDK_CURRENT_TIME);
+#endif
+
+ gtk_grab_remove (dock);
+}
+
+
+
static void
xfce_volume_button_popup_dock (XfceVolumeButton *button)
{
@@ -564,7 +630,7 @@ xfce_volume_button_popup_dock (XfceVolumeButton *button)
gint x;
gint y;
GtkPositionType position;
- GdkDisplay *display;
+ GtkAllocation button_allocation;
/* Lazily create dock contents */
if (button->dock == NULL)
@@ -591,12 +657,13 @@ xfce_volume_button_popup_dock (XfceVolumeButton *button)
}
/* Get size request of the dock */
- gtk_widget_size_request (GTK_WIDGET (button->dock), &dock_requisition);
+ gtk_widget_get_preferred_size (GTK_WIDGET (button->dock), NULL, &dock_requisition);
/* Determine the absolute coordinates of the button widget */
gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (button)), &x, &y);
- x += button_widget->allocation.x;
- y += button_widget->allocation.y;
+ gtk_widget_get_allocation (button_widget, &button_allocation);
+ x += button_allocation.x;
+ y += button_allocation.y;
/* Determine the geometry of the monitor containing the window containing the button */
screen = gtk_widget_get_screen (button_widget);
@@ -631,22 +698,22 @@ xfce_volume_button_popup_dock (XfceVolumeButton *button)
switch (position)
{
case GTK_POS_TOP:
- x += (button_widget->allocation.width / 2) - (dock_requisition.width / 2);
+ x += (button_allocation.width / 2) - (dock_requisition.width / 2);
y -= dock_requisition.height;
break;
case GTK_POS_RIGHT:
- x += button_widget->allocation.width;
- y += (button_widget->allocation.height / 2) - (dock_requisition.height / 2);
+ x += button_allocation.width;
+ y += (button_allocation.height / 2) - (dock_requisition.height / 2);
break;
case GTK_POS_LEFT:
x -= dock_requisition.width;
- y += (button_widget->allocation.height / 2) - (dock_requisition.height / 2);
+ y += (button_allocation.height / 2) - (dock_requisition.height / 2);
break;
case GTK_POS_BOTTOM:
default:
/* default to GTK_POS_BOTTOM */
- x += (button_widget->allocation.width / 2) - (dock_requisition.width / 2);
- y += button_widget->allocation.height;
+ x += (button_allocation.width / 2) - (dock_requisition.width / 2);
+ y += button_allocation.height;
break;
}
@@ -666,25 +733,12 @@ xfce_volume_button_popup_dock (XfceVolumeButton *button)
gtk_widget_show (button->dock);
/* Grab keyboard and mouse, focus on the slider */
- gtk_grab_add (button->dock);
-
- if (gdk_pointer_grab (gtk_widget_get_window (button->dock), TRUE,
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK,
- NULL, NULL, GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
+ if (!xfce_volume_button_grab_input (button))
{
- gtk_grab_remove (button->dock);
gtk_widget_hide (button->dock);
return;
}
- if (gdk_keyboard_grab (gtk_widget_get_window (button->dock), TRUE, GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
- {
- display = gtk_widget_get_display (button->dock);
- gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME);
- gtk_grab_remove (button->dock);
- gtk_widget_hide (button->dock);
- return;
- }
gtk_widget_grab_focus (button->dock);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
@@ -695,14 +749,9 @@ xfce_volume_button_popup_dock (XfceVolumeButton *button)
static void
xfce_volume_button_popdown_dock (XfceVolumeButton *button)
{
- GdkDisplay *display;
-
if (button->dock != NULL && gtk_widget_get_visible (button->dock))
{
- display = gtk_widget_get_display (GTK_WIDGET (button->dock));
- gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME);
- gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME);
- gtk_grab_remove (button->dock);
+ xfce_volume_button_ungrab_input (button);
gtk_widget_hide (button->dock);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
@@ -776,6 +825,9 @@ xfce_volume_button_scroll_event (GtkWidget *widget,
/* Decrease one step when scrolling down/left */
gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), old_value - increment);
break;
+
+ case GDK_SCROLL_SMOOTH:
+ break;
}
new_value = gtk_adjustment_get_value (GTK_ADJUSTMENT (button->adjustment));
@@ -923,7 +975,7 @@ xfce_volume_button_dock_key_release (XfceVolumeButton *button,
GtkWidget *widget)
{
/* Pop down on Escape */
- if (event->keyval == GDK_Escape)
+ if (event->keyval == GDK_KEY_Escape)
{
xfce_volume_button_popdown_dock (button);
return TRUE;
diff --git a/xfce4-mixer/xfce-mixer-container.c b/xfce4-mixer/xfce-mixer-container.c
index d59240a..560ee66 100644
--- a/xfce4-mixer/xfce-mixer-container.c
+++ b/xfce4-mixer/xfce-mixer-container.c
@@ -216,15 +216,12 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
GstMixerTrack *track;
const GList *iter;
const gchar *titles[4] = { N_("_Playback"), N_("C_apture"), N_("S_witches"), N_("_Options") };
- GtkWidget *label_alignment;
- GtkWidget *option_alignment;
GtkWidget *track_widget;
GtkWidget *track_label_widget;
GtkWidget *labels[4];
GtkWidget *scrollwins[4];
GtkWidget *views[4];
GtkWidget *last_separator[4] = { NULL, NULL, NULL, NULL };
- GtkWidget *alignment;
GtkWidget *vbox;
GtkWidget *label1;
GtkWidget *label2;
@@ -248,16 +245,9 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
gtk_container_set_border_width (GTK_CONTAINER (scrollwins[i]), 6);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwins[i]), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- if (i < 2)
- views[i] = gtk_table_new (1, 2, FALSE);
- else
- views[i] = gtk_table_new (2, 1, FALSE);
-
- gtk_table_set_col_spacings (GTK_TABLE (views[i]), 12);
- gtk_table_set_row_spacings (GTK_TABLE (views[i]), 6);
-
- gtk_container_set_border_width (GTK_CONTAINER (views[i]), 6);
- gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrollwins[i]), views[i]);
+ views[i] = gtk_grid_new ();
+ g_object_set (G_OBJECT (views[i]), "row-spacing", 6, "column-spacing", 12, "border-width", 6, NULL);
+ gtk_container_add (GTK_CONTAINER (scrollwins[i]), views[i]);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (gtk_bin_get_child (GTK_BIN (scrollwins[i]))), GTK_SHADOW_NONE);
gtk_widget_show (views[i]);
gtk_widget_show (scrollwins[i]);
@@ -283,19 +273,17 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
case XFCE_MIXER_TRACK_TYPE_PLAYBACK:
/* Create a regular volume control for this track */
track_label_widget = gtk_label_new (track_label);
- gtk_table_attach (GTK_TABLE (views[0]), track_label_widget,
- num_children[0], num_children[0] + 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (views[0]), track_label_widget, num_children[0], 0, 1, 1);
gtk_widget_show (track_label_widget);
track_widget = xfce_mixer_track_new (mixer_container->card, track);
- gtk_table_attach (GTK_TABLE (views[0]), track_widget,
- num_children[0], num_children[0] + 1, 1, 2, GTK_SHRINK, GTK_FILL|GTK_EXPAND, 0, 0);
+ g_object_set (G_OBJECT (track_widget), "valign", GTK_ALIGN_FILL, "vexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (views[0]), track_widget, num_children[0], 1, 1, 1);
gtk_widget_show (track_widget);
num_children[0]++;
/* Append a separator. The last one will be destroyed later */
- last_separator[0] = gtk_vseparator_new ();
- gtk_table_attach (GTK_TABLE (views[0]), last_separator[0],
- num_children[0], num_children[0] + 1, 0, 2, GTK_SHRINK, GTK_FILL|GTK_EXPAND, 0, 0);
+ last_separator[0] = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+ gtk_grid_attach (GTK_GRID (views[0]), last_separator[0], num_children[0], 0, 1, 2);
gtk_widget_show (last_separator[0]);
num_children[0]++;
@@ -306,19 +294,17 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
case XFCE_MIXER_TRACK_TYPE_CAPTURE:
/* Create a regular volume control for this track */
track_label_widget = gtk_label_new (track_label);
- gtk_table_attach (GTK_TABLE (views[1]), track_label_widget,
- num_children[1], num_children[1] + 1, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+ gtk_grid_attach (GTK_GRID (views[1]), track_label_widget, num_children[1], 0, 1, 1);
gtk_widget_show (track_label_widget);
track_widget = xfce_mixer_track_new (mixer_container->card, track);
- gtk_table_attach (GTK_TABLE (views[1]), track_widget,
- num_children[1], num_children[1] + 1, 1, 2, GTK_SHRINK, GTK_FILL|GTK_EXPAND, 0, 0);
+ g_object_set (G_OBJECT (track_widget), "valign", GTK_ALIGN_FILL, "vexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (views[1]), track_widget, num_children[1], 1, 1, 1);
gtk_widget_show (track_widget);
num_children[1]++;
/* Append a separator. The last one will be destroyed later */
- last_separator[1] = gtk_vseparator_new ();
- gtk_table_attach (GTK_TABLE (views[1]), last_separator[1],
- num_children[1], num_children[1] + 1, 0, 2, GTK_SHRINK, GTK_FILL|GTK_EXPAND, 0, 0);
+ last_separator[1] = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
+ gtk_grid_attach (GTK_GRID (views[1]), last_separator[1], num_children[1], 0, 1, 2);
gtk_widget_show (last_separator[1]);
num_children[1]++;
@@ -328,8 +314,8 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
case XFCE_MIXER_TRACK_TYPE_SWITCH:
track_widget = xfce_mixer_switch_new (mixer_container->card, track);
- gtk_table_attach (GTK_TABLE (views[2]), track_widget,
- 0, 1, num_children[2], num_children[2] + 1, GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
+ g_object_set (G_OBJECT (track_widget), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (views[2]), track_widget, 0, num_children[2], 1, 1);
gtk_widget_show (track_widget);
num_children[2]++;
@@ -339,24 +325,16 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
break;
case XFCE_MIXER_TRACK_TYPE_OPTIONS:
- label_alignment = gtk_alignment_new (0, 0, 0, 0);
- gtk_table_attach (GTK_TABLE (views[3]), label_alignment,
- 0, 1, num_children[3], num_children[3] + 1, GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_widget_show (label_alignment);
-
option_track_label = g_strdup_printf ("%s:", track_label);
track_label_widget = gtk_label_new (option_track_label);
- gtk_container_add (GTK_CONTAINER (label_alignment), track_label_widget);
+ g_object_set (G_OBJECT (track_label_widget), "halign", GTK_ALIGN_FILL, NULL);
+ gtk_grid_attach (GTK_GRID (views[3]), track_label_widget, 0, num_children[3], 1, 1);
gtk_widget_show (track_label_widget);
g_free (option_track_label);
- option_alignment = gtk_alignment_new (0, 0, 1.0f, 0);
- gtk_table_attach (GTK_TABLE (views[3]), option_alignment,
- 1, 2, num_children[3], num_children[3] + 1, GTK_FILL|GTK_EXPAND, GTK_SHRINK, 0, 0);
- gtk_widget_show (option_alignment);
-
track_widget = xfce_mixer_option_new (mixer_container->card, track);
- gtk_container_add (GTK_CONTAINER (option_alignment), track_widget);
+ g_object_set (G_OBJECT (track_widget), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, NULL);
+ gtk_grid_attach (GTK_GRID (views[3]), track_widget, 1, num_children[3], 1, 1);
gtk_widget_show (track_widget);
num_children[3]++;
@@ -390,30 +368,24 @@ xfce_mixer_container_create_contents (XfceMixerContainer *mixer_container)
label1 = gtk_label_new (_("No controls visible"));
gtk_widget_show (label1);
- alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
- gtk_widget_show (alignment);
-
- vbox = gtk_vbox_new (6, FALSE);
- gtk_container_add (GTK_CONTAINER (alignment), vbox);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ g_object_set (G_OBJECT (vbox), "halign", GTK_ALIGN_CENTER, "hexpand", TRUE, "valign", GTK_ALIGN_CENTER, "vexpand", TRUE,
+ "border-width", 6, NULL);
gtk_widget_show (vbox);
label2 = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label2), _("<span weight=\"bold\" size=\"larger\">No controls visible</span>"));
- gtk_label_set_max_width_chars (GTK_LABEL (label2), 80);
- gtk_label_set_line_wrap (GTK_LABEL (label2), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label2), 0.0, 0.5);
+ g_object_set (G_OBJECT (label2), "max-width-chars", 80, "xalign", 0.0, "wrap", TRUE, NULL);
gtk_box_pack_start (GTK_BOX (vbox), label2, FALSE, TRUE, 0);
gtk_widget_show (label2);
label3 = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label3), _("In order to toggle the visibility of mixer controls, open the <b>\"Select Controls\"</b> dialog."));
- gtk_label_set_max_width_chars (GTK_LABEL (label3), 80);
- gtk_label_set_line_wrap (GTK_LABEL (label3), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label3), 0.0, 0.5);
+ g_object_set (G_OBJECT (label3), "max-width-chars", 80, "xalign", 0.0, "wrap", TRUE, NULL);
gtk_box_pack_start (GTK_BOX (vbox), label3, FALSE, TRUE, 0);
gtk_widget_show (label3);
- gtk_notebook_append_page (GTK_NOTEBOOK (mixer_container), alignment, label1);
+ gtk_notebook_append_page (GTK_NOTEBOOK (mixer_container), vbox, label1);
}
g_object_unref (preferences);
diff --git a/xfce4-mixer/xfce-mixer-controls-dialog.c b/xfce4-mixer/xfce-mixer-controls-dialog.c
index dd79a77..92886fb 100644
--- a/xfce4-mixer/xfce-mixer-controls-dialog.c
+++ b/xfce4-mixer/xfce-mixer-controls-dialog.c
@@ -119,7 +119,9 @@ xfce_mixer_controls_dialog_init (XfceMixerControlsDialog *dialog)
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (dialog), _("Select which controls should be visible"));
- button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+ button = gtk_button_new_with_mnemonic (_("_Close"));
+ gtk_button_set_image (GTK_BUTTON (button),
+ gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_BUTTON));
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_CLOSE);
gtk_widget_show (button);
}
@@ -191,14 +193,15 @@ xfce_mixer_controls_dialog_create_contents (XfceMixerControlsDialog *dialog)
dialog->store = gtk_list_store_new (2, G_TYPE_BOOLEAN, G_TYPE_STRING);
dialog->frame = gtk_frame_new (NULL);
- gtk_container_set_border_width (GTK_CONTAINER (dialog->frame), 6);
+ g_object_set (G_OBJECT (dialog->frame), "margin-top", 6, "margin-bottom", 6, NULL);
gtk_frame_set_shadow_type (GTK_FRAME (dialog->frame), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->frame);
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->frame);
gtk_widget_show (dialog->frame);
scrollwin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin), GTK_SHADOW_IN);
+ g_object_set (G_OBJECT (scrollwin), "halign", GTK_ALIGN_FILL, "hexpand", TRUE, "valign", GTK_ALIGN_FILL, "vexpand", TRUE, NULL);
gtk_container_add (GTK_CONTAINER (dialog->frame), scrollwin);
gtk_widget_show (scrollwin);
diff --git a/xfce4-mixer/xfce-mixer-option.c b/xfce4-mixer/xfce-mixer-option.c
index d16b766..969baad 100644
--- a/xfce4-mixer/xfce-mixer-option.c
+++ b/xfce4-mixer/xfce-mixer-option.c
@@ -189,15 +189,15 @@ static void
xfce_mixer_option_changed (GtkComboBox *combo,
XfceMixerOption *option)
{
- gchar *active_option;
+ GtkTreeIter iter;
+ gchar *active_option;
if (G_UNLIKELY (option->ignore_signals))
return;
- active_option = gtk_combo_box_get_active_text (combo);
-
- if (G_LIKELY (active_option != NULL))
+ if (G_LIKELY (gtk_combo_box_get_active_iter (combo, &iter)))
{
+ gtk_tree_model_get (GTK_TREE_MODEL (option->list_store), &iter, OPTION_COLUMN, &active_option, -1);
gst_mixer_set_option (GST_MIXER (option->card), GST_MIXER_OPTIONS (option->track),
active_option);
g_free (active_option);
diff --git a/xfce4-mixer/xfce-mixer-track.c b/xfce4-mixer/xfce-mixer-track.c
index a7442ed..831d127 100644
--- a/xfce4-mixer/xfce-mixer-track.c
+++ b/xfce4-mixer/xfce-mixer-track.c
@@ -45,8 +45,8 @@
static void xfce_mixer_track_dispose (GObject *object);
static void xfce_mixer_track_finalize (GObject *object);
-static gboolean xfce_mixer_track_lock_button_line_expose_event (GtkWidget *widget,
- GdkEventExpose *event,
+static gboolean xfce_mixer_track_lock_button_line_draw (GtkWidget *widget,
+ cairo_t *cr,
gpointer user_data);
static void xfce_mixer_track_create_contents (XfceMixerTrack *track);
static void xfce_mixer_track_fader_changed (GtkRange *range,
@@ -83,7 +83,7 @@ struct _XfceMixerTrack
-G_DEFINE_TYPE (XfceMixerTrack, xfce_mixer_track, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (XfceMixerTrack, xfce_mixer_track, GTK_TYPE_BOX)
@@ -138,7 +138,7 @@ xfce_mixer_track_new (GstElement *card,
g_return_val_if_fail (GST_IS_MIXER (card), NULL);
g_return_val_if_fail (GST_IS_MIXER_TRACK (gst_track), NULL);
- track = g_object_new (TYPE_XFCE_MIXER_TRACK, NULL);
+ track = g_object_new (TYPE_XFCE_MIXER_TRACK, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
track->card = card;
track->gst_track = gst_track;
@@ -150,32 +150,27 @@ xfce_mixer_track_new (GstElement *card,
static gboolean
-xfce_mixer_track_lock_button_line_expose_event (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer user_data)
+xfce_mixer_track_lock_button_line_draw (GtkWidget *widget,
+ cairo_t *cr,
+ gpointer user_data)
{
GtkPositionType position = GPOINTER_TO_INT (user_data);
GtkAllocation allocation;
- cairo_t *cr;
- GtkStyle *style = gtk_widget_get_style (widget);
+ GtkStyleContext *style_context = gtk_widget_get_style_context (widget);
GdkPoint points[3];
double line_width = 2.0;
-
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
+ GdkRGBA fg_color;
gtk_widget_get_allocation (widget, &allocation);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
position = (position == GTK_POS_LEFT) ? GTK_POS_RIGHT : GTK_POS_LEFT;
- /* Only refresh regions where it is necessary */
- gdk_cairo_region (cr, event->region);
- cairo_clip (cr);
-
/*
* Draw an L-shaped line from the right/left center to the top middle of the
* allocation
*/
- gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_context_get_color (style_context, GTK_STATE_FLAG_NORMAL, &fg_color);
+ gdk_cairo_set_source_rgba (cr, &fg_color);
cairo_set_line_width(cr, line_width);
if (position == GTK_POS_RIGHT)
{
@@ -200,8 +195,6 @@ xfce_mixer_track_lock_button_line_expose_event (GtkWidget *widget,
cairo_line_to (cr, points[2].x, points[2].y);
cairo_stroke (cr);
- cairo_destroy (cr);
-
return TRUE;
}
@@ -216,7 +209,6 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
const gchar *track_label;
gchar *tooltip_text;
gdouble step;
- GtkWidget *faders_alignment;
GtkWidget *faders_vbox;
GtkWidget *faders_hbox;
GtkWidget *lock_button_hbox;
@@ -224,7 +216,6 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
GtkWidget *lock_button_line1;
GtkWidget *lock_button_line2;
GtkWidget *image;
- GtkWidget *buttons_alignment;
GtkWidget *buttons_hbox;
GtkRequisition lock_button_hbox_requisition;
@@ -239,15 +230,12 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
gtk_box_set_spacing (GTK_BOX (track), 6);
/* Center and do not expand faders and lock button */
- faders_alignment = gtk_alignment_new (0.5, 1.0, 0, 1.0);
- gtk_box_pack_start (GTK_BOX (track), faders_alignment, TRUE, TRUE, 0);
- gtk_widget_show (faders_alignment);
-
- faders_vbox = gtk_vbox_new (FALSE, 6);
- gtk_container_add (GTK_CONTAINER (faders_alignment), faders_vbox);
+ faders_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ g_object_set (G_OBJECT (faders_vbox), "halign", GTK_ALIGN_CENTER, "valign", GTK_ALIGN_FILL, "vexpand", TRUE, NULL);
+ gtk_box_pack_start (GTK_BOX (track), faders_vbox, TRUE, TRUE, 0);
gtk_widget_show (faders_vbox);
- faders_hbox = gtk_hbox_new (TRUE, 6);
+ faders_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (faders_vbox), faders_hbox, TRUE, TRUE, 0);
gtk_widget_show (faders_hbox);
@@ -256,7 +244,7 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
{
tooltip_text = g_strdup_printf (_("Volume of channel %d on %s"), channel, track_label);
- fader = gtk_vscale_new_with_range (track->gst_track->min_volume, track->gst_track->max_volume, step);
+ fader = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL, track->gst_track->min_volume, track->gst_track->max_volume, step);
gtk_scale_set_draw_value (GTK_SCALE (fader), FALSE);
gtk_range_set_inverted (GTK_RANGE (fader), TRUE);
gtk_range_set_value (GTK_RANGE (fader), volumes[channel]);
@@ -278,7 +266,7 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
}
/* Create lock button with lines */
- lock_button_hbox = gtk_hbox_new (FALSE, 0);
+ lock_button_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (faders_vbox), lock_button_hbox, FALSE, FALSE, 0);
gtk_widget_show (lock_button_hbox);
@@ -286,7 +274,7 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
lock_button_line1 = gtk_drawing_area_new ();
gtk_widget_set_size_request (lock_button_line1, 12, 8);
gtk_box_pack_start (GTK_BOX (lock_button_hbox), lock_button_line1, TRUE, TRUE, 0);
- g_signal_connect (G_OBJECT (lock_button_line1), "expose-event", G_CALLBACK (xfce_mixer_track_lock_button_line_expose_event), GINT_TO_POINTER (GTK_POS_LEFT));
+ g_signal_connect (G_OBJECT (lock_button_line1), "draw", G_CALLBACK (xfce_mixer_track_lock_button_line_draw), GINT_TO_POINTER (GTK_POS_LEFT));
gtk_widget_show (lock_button_line1);
/* Lock button */
@@ -309,7 +297,7 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
lock_button_line2 = gtk_drawing_area_new ();
gtk_widget_set_size_request (lock_button_line2, 12, 8);
gtk_box_pack_start (GTK_BOX (lock_button_hbox), lock_button_line2, TRUE, TRUE, 0);
- g_signal_connect (G_OBJECT (lock_button_line2), "expose-event", G_CALLBACK (xfce_mixer_track_lock_button_line_expose_event), GINT_TO_POINTER (GTK_POS_RIGHT));
+ g_signal_connect (G_OBJECT (lock_button_line2), "draw", G_CALLBACK (xfce_mixer_track_lock_button_line_draw), GINT_TO_POINTER (GTK_POS_RIGHT));
gtk_widget_show (lock_button_line2);
/*
@@ -318,20 +306,17 @@ xfce_mixer_track_create_contents (XfceMixerTrack *track)
*/
if (track->gst_track->num_channels < 2)
{
- gtk_widget_size_request (lock_button_hbox, &lock_button_hbox_requisition);
+ gtk_widget_get_preferred_size (lock_button_hbox, NULL, &lock_button_hbox_requisition);
gtk_widget_destroy (lock_button_hbox);
- lock_button_hbox = gtk_hbox_new (FALSE, 0);
+ lock_button_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_set_size_request (lock_button_hbox, lock_button_hbox_requisition.width, lock_button_hbox_requisition.height);
gtk_box_pack_start (GTK_BOX (faders_vbox), lock_button_hbox, FALSE, FALSE, 0);
gtk_widget_show (lock_button_hbox);
}
- buttons_alignment = gtk_alignment_new (0.5, 1.0, 0, 0);
- gtk_box_pack_start (GTK_BOX (track), buttons_alignment, FALSE, FALSE, 0);
- gtk_widget_show (buttons_alignment);
-
- buttons_hbox = gtk_hbox_new (FALSE, 12);
- gtk_container_add (GTK_CONTAINER (buttons_alignment), buttons_hbox);
+ buttons_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+ g_object_set (G_OBJECT (buttons_hbox), "halign", GTK_ALIGN_CENTER, "valign", GTK_ALIGN_END, NULL);
+ gtk_box_pack_start (GTK_BOX (track), buttons_hbox, FALSE, FALSE, 0);
gtk_widget_show (buttons_hbox);
/* Mute button for playback tracks */
diff --git a/xfce4-mixer/xfce-mixer-window.c b/xfce4-mixer/xfce-mixer-window.c
index 7f9a9e9..32cbb28 100644
--- a/xfce4-mixer/xfce-mixer-window.c
+++ b/xfce4-mixer/xfce-mixer-window.c
@@ -150,7 +150,6 @@ xfce_mixer_window_init (XfceMixerWindow *window)
gtk_window_set_title (GTK_WINDOW (window), _("Audio Mixer"));
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
- gtk_dialog_set_has_separator (GTK_DIALOG (window), FALSE);
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (window), _("Configure sound card(s) and control the volume of selected tracks"));
g_signal_connect (window, "delete-event", G_CALLBACK (xfce_mixer_window_closed), window);
@@ -177,7 +176,7 @@ xfce_mixer_window_init (XfceMixerWindow *window)
vbox = gtk_dialog_get_content_area (GTK_DIALOG (window));
gtk_widget_show (vbox);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
gtk_widget_show (hbox);
@@ -188,14 +187,14 @@ xfce_mixer_window_init (XfceMixerWindow *window)
window->soundcard_combo = xfce_mixer_card_combo_new (card);
g_signal_connect (G_OBJECT (window->soundcard_combo), "soundcard-changed", G_CALLBACK (xfce_mixer_window_soundcard_changed), window);
- gtk_container_add (GTK_CONTAINER (hbox), window->soundcard_combo);
+ gtk_box_pack_start (GTK_BOX (hbox), window->soundcard_combo, TRUE, TRUE, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), window->soundcard_combo);
gtk_widget_show (window->soundcard_combo);
window->mixer_frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (window->mixer_frame), GTK_SHADOW_NONE);
gtk_container_set_border_width (GTK_CONTAINER (window->mixer_frame), 6);
- gtk_container_add (GTK_CONTAINER (vbox), window->mixer_frame);
+ gtk_box_pack_start (GTK_BOX (vbox), window->mixer_frame, TRUE, TRUE, 0);
gtk_widget_show (window->mixer_frame);
window->mixer_container = xfce_mixer_container_new (NULL);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list