[gnome-applets] drivemount: port to gtkgrid
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] drivemount: port to gtkgrid
- Date: Wed, 25 Mar 2015 23:23:58 +0000 (UTC)
commit 41c210b2338b5fbde9f0916399eff5ab3054315b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Mar 26 00:25:32 2015 +0200
drivemount: port to gtkgrid
drivemount/drive-list.c | 23 +++++++++--------------
drivemount/drive-list.h | 4 ++--
2 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/drivemount/drive-list.c b/drivemount/drive-list.c
index 8e16209..12a85fe 100644
--- a/drivemount/drive-list.c
+++ b/drivemount/drive-list.c
@@ -29,7 +29,7 @@
#include "drive-button.h"
#include <glib/gi18n.h>
-G_DEFINE_TYPE (DriveList, drive_list, GTK_TYPE_TABLE);
+G_DEFINE_TYPE (DriveList, drive_list, GTK_TYPE_GRID);
static GVolumeMonitor *volume_monitor = NULL;
@@ -79,7 +79,8 @@ drive_list_init (DriveList *self)
{
GList *volumes, *mounts, *tmp;
- gtk_table_set_homogeneous (GTK_TABLE (self), TRUE);
+ gtk_grid_set_column_homogeneous (GTK_GRID (self), TRUE);
+ gtk_grid_set_row_homogeneous (GTK_GRID (self), TRUE);
self->volumes = g_hash_table_new (NULL, NULL);
self->mounts = g_hash_table_new (NULL, NULL);
@@ -236,22 +237,16 @@ relayout_buttons (gpointer data)
if (self->orientation == GTK_ORIENTATION_HORIZONTAL) {
gtk_container_child_set (GTK_CONTAINER (self), button,
- "left_attach", i, "right_attach", i+1,
- "top_attach", 0, "bottom_attach", 1,
- "x_options", GTK_FILL,
- "y_options", GTK_FILL,
- NULL);
+ "left-attach", i + 1, "top-attach", 0,
+ "width", 1, "height", 1,
+ NULL);
} else {
gtk_container_child_set (GTK_CONTAINER (self), button,
- "left_attach", 0, "right_attach", 1,
- "top_attach", i, "bottom_attach", i+1,
- "x_options", GTK_FILL,
- "y_options", GTK_FILL,
- NULL);
+ "left-attach", 0, "top-attach", i + 1,
+ "width", 1, "height", 1,
+ NULL);
}
}
- /* shrink wrap the table */
- gtk_table_resize (GTK_TABLE (self), 1, 1);
return FALSE;
}
diff --git a/drivemount/drive-list.h b/drivemount/drive-list.h
index 4dd4c68..e870349 100644
--- a/drivemount/drive-list.h
+++ b/drivemount/drive-list.h
@@ -38,7 +38,7 @@ typedef struct _DriveListClass DriveListClass;
struct _DriveList
{
- GtkTable parent;
+ GtkGrid parent;
GHashTable *volumes;
GHashTable *mounts;
@@ -51,7 +51,7 @@ struct _DriveList
struct _DriveListClass
{
- GtkTableClass parent_class;
+ GtkGridClass parent_class;
};
GType drive_list_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]