summaryrefslogtreecommitdiff
path: root/sensors-applet/sensor-config-dialog.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-08-14 18:11:59 +0200
committerraveit65 <[email protected]>2017-01-19 23:15:31 +0100
commitb6f7a46ace135bdc9ed8d1fc5e4d040924d7ae1a (patch)
treee5ce43b308c85e7f0c30bae7b806997b5ac150db /sensors-applet/sensor-config-dialog.c
parent9e179f46b6ff71009530ff5848318754df3976d3 (diff)
downloadmate-sensors-applet-b6f7a46ace135bdc9ed8d1fc5e4d040924d7ae1a.tar.bz2
mate-sensors-applet-b6f7a46ace135bdc9ed8d1fc5e4d040924d7ae1a.tar.xz
sensor-config-dialog: port GtkTable to GtkGrid
Diffstat (limited to 'sensors-applet/sensor-config-dialog.c')
-rw-r--r--sensors-applet/sensor-config-dialog.c242
1 files changed, 108 insertions, 134 deletions
diff --git a/sensors-applet/sensor-config-dialog.c b/sensors-applet/sensor-config-dialog.c
index bc25dbb..f8bbe94 100644
--- a/sensors-applet/sensor-config-dialog.c
+++ b/sensors-applet/sensor-config-dialog.c
@@ -60,7 +60,7 @@ typedef struct {
GtkAlignment *alarm_timeout_spinbutton_aligner;
GtkAdjustment *alarm_timeout_adjust;
GtkSpinButton *alarm_timeout_spinbutton;
- GtkTable *table;
+ GtkGrid *grid;
GtkAlignment *alarm_enable_aligner;
GtkCheckButton *alarm_enable_checkbutton;
GtkEntry *low_alarm_command_entry, *high_alarm_command_entry;
@@ -783,139 +783,113 @@ void sensor_config_dialog_create(SensorsApplet *sensors_applet) {
GTK_WIDGET(config_dialog->graph_color_button));
g_object_unref(config_dialog->size_group);
- config_dialog->table = g_object_new(GTK_TYPE_TABLE,
- "column-spacing", 5,
- "homogeneous", FALSE,
- "n-columns", 3,
- "n-rows", 15,
- "row-spacing", 6,
- "column-spacing", 12,
- NULL);
-
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->scale_header),
- 0, 2,
- 0, 1);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->multiplier_label),
- 1, 2,
- 1, 2);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->multiplier_spinbutton_aligner),
- 2, 3,
- 1, 2);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->offset_label),
- 1, 2,
- 2, 3);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->offset_spinbutton_aligner),
- 2, 3,
- 2, 3);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->limits_header),
- 0, 2,
- 3, 4);
-
- /* now pack alarm widgets */
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->low_value_label),
- 1, 2,
- 4, 5);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->low_value_spinbutton_aligner),
- 2, 3,
- 4, 5);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->high_value_label),
- 1, 2,
- 5, 6);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->high_value_spinbutton_aligner),
- 2, 3,
- 5, 6);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->alarm_header),
- 0, 2,
- 6, 7);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->alarm_enable_aligner),
- 1, 2,
- 7, 8);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->alarm_timeout_label),
- 1, 2,
- 8, 9);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->alarm_timeout_spinbutton_aligner),
- 2, 3,
- 8, 9);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->low_alarm_command_label),
- 1, 2,
- 9, 10);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->low_alarm_command_entry),
- 2, 3,
- 9, 10);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->high_alarm_command_label),
- 1, 2,
- 10, 11);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->high_alarm_command_entry),
- 2, 3,
- 10, 11);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->icon_header),
- 0, 2,
- 11, 12);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->icon_type_label),
- 1, 2,
- 12, 13);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->icon_type_combo_box_aligner),
- 2, 3,
- 12, 13);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->graph_header),
- 0, 2,
- 13, 14);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->graph_color_label),
- 1, 2,
- 14, 15);
-
- gtk_table_attach_defaults(config_dialog->table,
- GTK_WIDGET(config_dialog->graph_color_button_aligner),
- 2, 3,
- 14, 15);
-
- content_area = gtk_dialog_get_content_area (GTK_DIALOG(config_dialog->dialog));
- gtk_box_pack_start(GTK_BOX(content_area), GTK_WIDGET(config_dialog->table), FALSE, FALSE, 0);
+ config_dialog->grid = g_object_new(GTK_TYPE_GRID,
+ "column-spacing", 5,
+ "row-homogeneous", FALSE,
+ "column-homogeneous", FALSE,
+ "row-spacing", 6,
+ "column-spacing", 12,
+ NULL);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->scale_header),
+ 0, 0, 2, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->multiplier_label),
+ 1, 1, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->multiplier_spinbutton_aligner),
+ 2, 1, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->offset_label),
+ 1, 2, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->offset_spinbutton_aligner),
+ 2, 2, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->limits_header),
+ 0, 3, 2, 1);
+
+ /* now pack alarm widgets */
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->low_value_label),
+ 1, 4, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->low_value_spinbutton_aligner),
+ 2, 4, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->high_value_label),
+ 1, 5, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->high_value_spinbutton_aligner),
+ 2, 5, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->alarm_header),
+ 0, 6, 2, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->alarm_enable_aligner),
+ 1, 7, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->alarm_timeout_label),
+ 1, 8, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->alarm_timeout_spinbutton_aligner),
+ 2, 8, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->low_alarm_command_label),
+ 1, 9, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->low_alarm_command_entry),
+ 2, 9, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->high_alarm_command_label),
+ 1, 10, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->high_alarm_command_entry),
+ 2, 10, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->icon_header),
+ 0, 11, 2, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->icon_type_label),
+ 1, 12, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->icon_type_combo_box_aligner),
+ 2, 12, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->graph_header),
+ 0, 13, 2, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->graph_color_label),
+ 1, 14, 1, 1);
+
+ gtk_grid_attach(config_dialog->grid,
+ GTK_WIDGET(config_dialog->graph_color_button_aligner),
+ 2, 14, 1, 1);
+
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG(config_dialog->dialog));
+ gtk_box_pack_start(GTK_BOX(content_area), GTK_WIDGET(config_dialog->grid), FALSE, FALSE, 0);
gtk_widget_show_all(config_dialog->dialog);
}