summaryrefslogtreecommitdiff
path: root/shell/ev-password-view.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-23 00:22:11 +0200
committerraveit65 <[email protected]>2016-06-24 20:48:20 +0200
commitf320383369c4105e8076a0a5248a728fac76a0c0 (patch)
tree6197bb42e94e0a7e06a19489b2e301edbee45729 /shell/ev-password-view.c
parentf87c11ab0472e8a105c2aaab8ba97886960c141f (diff)
downloadatril-f320383369c4105e8076a0a5248a728fac76a0c0.tar.bz2
atril-f320383369c4105e8076a0a5248a728fac76a0c0.tar.xz
GTK+-3: Use GtkGrid instead of GtkTable
taken from: https://git.gnome.org/browse/evince/commit/?id=da8f31e
Diffstat (limited to 'shell/ev-password-view.c')
-rw-r--r--shell/ev-password-view.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
index 5e5a5559..545c064c 100644
--- a/shell/ev-password-view.c
+++ b/shell/ev-password-view.c
@@ -251,7 +251,11 @@ ev_password_view_ask_password (EvPasswordView *password_view)
GtkWidget *content_area, *action_area;
GtkWidget *entry_container;
GtkWidget *hbox, *main_vbox, *vbox, *icon;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *grid;
+#else
GtkWidget *table;
+#endif
GtkWidget *label;
gchar *format, *markup, *file_name;
@@ -332,11 +336,19 @@ ev_password_view_ask_password (EvPasswordView *password_view)
FALSE, FALSE, 0);
gtk_widget_show (entry_container);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ grid = gtk_grid_new ();
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
+ gtk_container_add (GTK_CONTAINER (entry_container), grid);
+ gtk_widget_show (grid);
+#else
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_container_add (GTK_CONTAINER (entry_container), table);
gtk_widget_show (table);
+#endif
label = gtk_label_new_with_mnemonic (_("_Password:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
@@ -349,6 +361,13 @@ ev_password_view_ask_password (EvPasswordView *password_view)
g_signal_connect (password_view->priv->password_entry, "activate",
G_CALLBACK (ev_password_dialog_entry_activated_cb),
dialog);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
+ gtk_widget_show (label);
+
+ gtk_grid_attach (GTK_GRID (grid), password_view->priv->password_entry, 1, 0, 1, 1);
+ gtk_widget_set_hexpand (password_view->priv->password_entry, TRUE);
+#else
gtk_table_attach (GTK_TABLE (table), label,
0, 1, 0, 1,
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
@@ -356,6 +375,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
gtk_table_attach_defaults (GTK_TABLE (table), password_view->priv->password_entry,
1, 2, 0, 1);
+#endif
gtk_widget_show (password_view->priv->password_entry);
gtk_label_set_mnemonic_widget (GTK_LABEL (label),