[gtranslator/gtk4: 32/52] Fix codeview UI file
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator/gtk4: 32/52] Fix codeview UI file
- Date: Mon, 5 Sep 2022 15:17:51 +0000 (UTC)
commit 966b4d6d46be01fe4f8e59f7eff1d2aec70b1e91
Author: Daniel GarcĂa Moreno <dani danigm net>
Date: Wed Jul 20 21:29:11 2022 +0200
Fix codeview UI file
src/codeview/gtr-viewer.c | 18 ++++++++++++----
src/codeview/gtr-viewer.ui | 51 ----------------------------------------------
2 files changed, 14 insertions(+), 55 deletions(-)
---
diff --git a/src/codeview/gtr-viewer.c b/src/codeview/gtr-viewer.c
index cff1590c..fc8097fd 100644
--- a/src/codeview/gtr-viewer.c
+++ b/src/codeview/gtr-viewer.c
@@ -68,6 +68,7 @@ gtr_viewer_init (GtrViewer *dlg)
NULL
};
GtrViewerPrivate *priv = gtr_viewer_get_instance_private (dlg);
+ GError *error = NULL;
gtk_dialog_add_buttons (GTK_DIALOG (dlg),
_("_Close"), GTK_RESPONSE_CLOSE, NULL);
@@ -84,8 +85,18 @@ gtr_viewer_init (GtrViewer *dlg)
/*Builder */
builder = gtk_builder_new ();
- gtk_builder_add_objects_from_resource (builder, "/org/gnome/gtranslator/plugins/codeview/ui/gtr-viewer.ui",
- root_objects, NULL);
+ gtk_builder_add_objects_from_resource (
+ builder,
+ "/org/gnome/gtranslator/plugins/codeview/ui/gtr-viewer.ui",
+ root_objects,
+ &error
+ );
+
+ if (error != NULL)
+ {
+ g_warning ("Error parsing gtr-viewer.ui: %s", (error)->message);
+ g_error_free (error);
+ }
priv->main_box = GTK_WIDGET (gtk_builder_get_object (builder, "main_box"));
g_object_ref (priv->main_box);
@@ -105,8 +116,7 @@ gtr_viewer_init (GtrViewer *dlg)
priv->view = gtk_source_view_new ();
gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->view), FALSE);
gtk_widget_show (priv->view);
- //gtk_container_add (GTK_CONTAINER (sw), priv->view);
- gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW(sw), priv->view);
+ gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), priv->view);
gtk_source_view_set_highlight_current_line (GTK_SOURCE_VIEW
(priv->view), TRUE);
diff --git a/src/codeview/gtr-viewer.ui b/src/codeview/gtr-viewer.ui
index a707f994..660fd75a 100644
--- a/src/codeview/gtr-viewer.ui
+++ b/src/codeview/gtr-viewer.ui
@@ -3,7 +3,6 @@
<requires lib="gtk+" version="2.16"/>
<object class="GtkDialog" id="dialog1">
<property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
@@ -14,43 +13,12 @@
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
<child>
<object class="GtkBox" id="main_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
@@ -64,39 +32,20 @@
<attribute name="weight" value="bold"/>
</attributes>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
- <property name="shadow_type">in</property>
<child>
<placeholder/>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="0">button1</action-widget>
- </action-widgets>
</object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]