[gtranslator: 1/2] Redesign add-notes dialog box



commit 78d3fd6cfaa3557631efb2d037b7471c72f35c0c
Author: Priyanka Saggu <priyankasaggu11929 gmail com>
Date:   Sun Oct 20 06:39:50 2019 +0000

    Redesign add-notes dialog box

 src/gtr-context.c | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)
---
diff --git a/src/gtr-context.c b/src/gtr-context.c
index 0d53fe5e..6604b868 100644
--- a/src/gtr-context.c
+++ b/src/gtr-context.c
@@ -71,16 +71,19 @@ setup_notes_edition (GtrContextPanel *panel)
 {
   GtrContextPanelPrivate *priv;
   GtkWidget *dialog;
+  GtkWidget *scrolled_window;
   GtkBox *dialog_area;
   GtkWidget *text_view;
-  GtkTextBuffer *text_buffer;
+  GtkTextBuffer *text_buffer = gtk_text_buffer_new (NULL);;
   gint result;
 
   priv = gtr_context_panel_get_instance_private (panel);
 
-  dialog = gtk_dialog_new_with_buttons (_("Edit notes"),
+  dialog = gtk_dialog_new_with_buttons (_("Notes"),
                                         GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (panel))),
-                                        GTK_DIALOG_MODAL,
+                                        GTK_DIALOG_MODAL|
+                                        GTK_DIALOG_USE_HEADER_BAR|
+                                        GTK_DIALOG_DESTROY_WITH_PARENT,
                                         _("_Save"),
                                         GTK_RESPONSE_ACCEPT,
                                         _("_Cancel"),
@@ -88,12 +91,31 @@ setup_notes_edition (GtrContextPanel *panel)
                                         NULL);
 
   dialog_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
-  text_view = gtk_text_view_new ();
-  gtk_box_pack_start (dialog_area, text_view, TRUE, TRUE, 6);
+  text_view = gtk_text_view_new_with_buffer (text_buffer);
+
+  gtk_text_view_set_left_margin (GTK_TEXT_VIEW (text_view),10);
+  gtk_text_view_set_right_margin (GTK_TEXT_VIEW (text_view),10);
+  gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_CHAR);
+  gtk_text_view_set_pixels_inside_wrap (GTK_TEXT_VIEW (text_view),0);
+
+  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+                                  GTK_POLICY_AUTOMATIC,
+                                  GTK_POLICY_AUTOMATIC);
+
+  gtk_container_add (GTK_CONTAINER (scrolled_window),
+                                         text_view);
+  gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 5);
+
+  gtk_box_pack_start (dialog_area, scrolled_window, TRUE, TRUE, 6);
 
   text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
   gtk_text_buffer_set_text (text_buffer, gtr_msg_get_comment (priv->current_msg), -1);
 
+  gtk_widget_set_size_request (dialog, 400, 300);
+  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+  gtk_window_set_deletable (GTK_WINDOW (dialog), FALSE);
+
   gtk_widget_show_all (dialog);
   result = gtk_dialog_run (GTK_DIALOG (dialog));
 
@@ -563,4 +585,3 @@ gtr_context_init_tm (GtrContextPanel *panel,
                       priv->translation_memory_ui,
                       FALSE, FALSE, 0);
 }
-


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