[epiphany/wip/exalm/dialogs] dialog



commit a22d37b81a5a163c66043466f1a3d9d6f89e2c0b
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Oct 6 19:14:27 2019 +0500

    dialog

 src/window-commands.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/src/window-commands.c b/src/window-commands.c
index bbc3c4eab..d1ac4d457 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -389,24 +389,33 @@ window_cmd_import_bookmarks (GSimpleAction *action,
   GtkWidget *combo_box;
   GtkTreeModel *tree_model;
   GtkCellRenderer *cell_renderer;
+  GtkWidget *button;
+
+  dialog = g_object_new (GTK_TYPE_DIALOG,
+                         "parent", window,
+                         "deletable", FALSE,
+                         "resizable", FALSE,
+                         "border-width", 6,
+                         "transient-for", window,
+                         "modal", TRUE,
+                         NULL);
 
-  dialog = hdy_dialog_new (GTK_WINDOW (window));
   gtk_window_set_title (GTK_WINDOW (dialog), _("Import Bookmarks"));
-  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                          _("_Cancel"),
-                          GTK_RESPONSE_CANCEL,
-                          _("Ch_oose File"),
-                          GTK_RESPONSE_OK,
-                          NULL);
+  gtk_dialog_add_button (GTK_DIALOG (dialog),
+                         _("_Cancel"),
+                         GTK_RESPONSE_CANCEL);
+
+  button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+                                  _("Ch_oose File"),
+                                  GTK_RESPONSE_OK);
+  gtk_style_context_add_class (gtk_widget_get_style_context (button),
+                               "suggested-action");
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-  gtk_widget_set_valign (content_area, GTK_ALIGN_CENTER);
-  gtk_widget_set_margin_start (content_area, 25);
-  gtk_widget_set_margin_end (content_area, 25);
-  gtk_container_set_border_width (GTK_CONTAINER (content_area), 5);
 
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+  g_object_set (hbox, "margin", 6, "margin-top", 0, NULL);
 
   label = gtk_label_new (_("From:"));
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]