summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-08-01 11:21:54 +0200
committerraveit65 <[email protected]>2016-08-31 15:29:57 +0200
commita2b12bc49188a7fd79c39bdfd85a9278cbc8e3f2 (patch)
treee7e802a347624e7894adfca1c179acff4e08a6e9
parent9684cbb449ce68a11ea9ccf4d040e9b49b189eee (diff)
downloadmate-applets-a2b12bc49188a7fd79c39bdfd85a9278cbc8e3f2.tar.bz2
mate-applets-a2b12bc49188a7fd79c39bdfd85a9278cbc8e3f2.tar.xz
GTK+-3 command: port to GtkGrid
-rw-r--r--command/command.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/command/command.c b/command/command.c
index bf9c76ca..07d267fe 100644
--- a/command/command.c
+++ b/command/command.c
@@ -126,7 +126,11 @@ static void
command_settings_callback (GtkAction *action, CommandApplet *command_applet)
{
GtkDialog *dialog;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkGrid *grid;
+#else
GtkTable *table;
+#endif
GtkWidget *widget;
GtkWidget *command;
GtkWidget *interval;
@@ -139,9 +143,15 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
NULL));
+#if GTK_CHECK_VERSION (3, 0, 0)
+ grid = GTK_GRID (gtk_grid_new ());
+ gtk_grid_set_row_spacing (grid, 12);
+ gtk_grid_set_column_spacing (grid, 12);
+#else
table = GTK_TABLE (gtk_table_new (4, 2, FALSE));
gtk_table_set_row_spacings (table, 12);
gtk_table_set_col_spacings (table, 12);
+#endif
gtk_window_set_default_size (GTK_WINDOW (dialog), 350, 150);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
@@ -153,6 +163,12 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
#else
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (grid, widget, 1, 0, 1, 1);
+
+ command = gtk_entry_new ();
+ gtk_grid_attach (grid, command, 2, 0, 1, 1);
+#else
gtk_table_attach (table, widget, 1, 2, 0, 1,
GTK_FILL, GTK_FILL,
0, 0);
@@ -161,6 +177,7 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
gtk_table_attach (table, command, 2, 3, 0, 1,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL,
0, 0);
+#endif
widget = gtk_label_new (_("Interval (seconds):"));
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -169,6 +186,12 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
#else
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (grid, widget, 1, 1, 1, 1);
+
+ interval = gtk_spin_button_new_with_range (1.0, 600.0, 1.0);
+ gtk_grid_attach (grid, interval, 2, 1, 1, 1);
+#else
gtk_table_attach (table, widget, 1, 2, 1, 2,
GTK_FILL, GTK_FILL,
0, 0);
@@ -177,6 +200,7 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
gtk_table_attach (table, interval, 2, 3, 1, 2,
GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_FILL,
0, 0);
+#endif
widget = gtk_label_new (_("Maximum width (chars):"));
#if GTK_CHECK_VERSION (3, 16, 0)
@@ -185,6 +209,17 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
#else
gtk_misc_set_alignment (GTK_MISC (widget), 1.0, 0.5);
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (grid, widget, 1, 2, 1, 1);
+
+ width = gtk_spin_button_new_with_range(1.0, 100.0, 1.0);
+ gtk_grid_attach (grid, width, 2, 2, 1, 1);
+
+ showicon = gtk_check_button_new_with_label (_("Show icon"));
+ gtk_grid_attach (grid, showicon, 2, 3, 1, 1);
+
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)), GTK_WIDGET (grid), TRUE, TRUE, 0);
+#else
gtk_table_attach (table, widget, 1, 2, 2, 3,
GTK_FILL, GTK_FILL,
0, 0);
@@ -200,6 +235,7 @@ command_settings_callback (GtkAction *action, CommandApplet *command_applet)
0, 0);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)), GTK_WIDGET (table), TRUE, TRUE, 0);
+#endif
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);