Commit 358c65c3 authored by Ross Golder's avatar Ross Golder

Fix text/trans vbox packing and unpacking. Make text/trans vboxes fill

        * message.c (gtranslator_message_show): Fix text/trans vbox
        packing and unpacking.
        * page.c: Make text/trans vboxes fill available space.
parent 8f6f990f
......@@ -4,6 +4,9 @@
* menus.c: Helped to find the pixmaps.
* dialogs.c (gtranslator_file_chooser_analyse): Tidy up and remove
unnecessary loop (giving invalid cast warnings).
* message.c (gtranslator_message_show): Fix text/trans vbox
packing and unpacking.
* page.c: Make text/trans vboxes fill available space.
2005-12-01 Fatih Demir <kabalak@kabalak.net>
......
......@@ -151,16 +151,16 @@ void gtranslator_message_show(GtrMsg *msg)
* fields
*/
text_vbox = GTK_BOX(current_page->text_vbox);
while(g_list_length(GTK_BOX(current_page->text_vbox)->children) > 0) {
gpointer widget = text_vbox->children->data;
gtk_widget_destroy(GTK_WIDGET(widget));
text_vbox->children = text_vbox->children->next;
while(g_list_length(text_vbox->children) > 0) {
GtkBoxChild *boxchild = text_vbox->children->data;
gtk_widget_destroy(boxchild->widget);
g_list_remove(text_vbox->children, boxchild);
}
trans_vbox = GTK_BOX(current_page->trans_vbox);
while(g_list_length(trans_vbox->children) > 0) {
gpointer widget = trans_vbox->children->data;
gtk_widget_destroy(GTK_WIDGET(widget));
trans_vbox->children = trans_vbox->children->next;
GtkBoxChild *boxchild = trans_vbox->children->data;
gtk_widget_destroy(boxchild->widget);
g_list_remove(trans_vbox->children, boxchild);
}
/*
......@@ -178,7 +178,8 @@ void gtranslator_message_show(GtrMsg *msg)
gtk_text_buffer_set_text(buf, (gchar*)msgid, -1);
}
current_page->text_msgid = gtk_text_view_new_with_buffer(buf);
gtk_box_pack_end(GTK_BOX(current_page->text_vbox), current_page->text_msgid, FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(current_page->text_vbox), current_page->text_msgid, TRUE, TRUE, 0);
gtk_widget_show(current_page->text_msgid);
}
msgid_plural = po_message_msgid_plural(msg->message);
if(msgid_plural) {
......@@ -191,8 +192,9 @@ void gtranslator_message_show(GtrMsg *msg)
else {
gtk_text_buffer_set_text(buf, (gchar*)msgid, -1);
}
current_page->text_msgid = gtk_text_view_new_with_buffer(buf);
gtk_box_pack_end(GTK_BOX(current_page->text_vbox), current_page->text_msgid, FALSE, FALSE, 0);
current_page->text_msgid_plural = gtk_text_view_new_with_buffer(buf);
gtk_box_pack_end(GTK_BOX(current_page->text_vbox), current_page->text_msgid_plural, TRUE, TRUE, 0);
gtk_widget_show(current_page->text_msgid_plural);
}
msgstr[0] = po_message_msgstr(msg->message);
......
......@@ -118,6 +118,7 @@ GtrPage *gtranslator_page_new(GtrPo *po)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
page->text_vbox = gtk_vbox_new(TRUE, 1);
gtk_box_set_homogeneous(page->text_vbox, TRUE);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(original_text_scrolled_window), page->text_vbox);
/* Translation box is a vbox, containing one textview in most cases,
......@@ -128,6 +129,7 @@ GtrPage *gtranslator_page_new(GtrPo *po)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
page->trans_vbox = gtk_vbox_new(TRUE, 1);
gtk_box_set_homogeneous(page->trans_vbox, TRUE);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(translation_text_scrolled_window), page->trans_vbox);
/*
......@@ -165,7 +167,7 @@ void gtranslator_page_hide_messages_table(GtrPage *page) {
gboolean gtranslator_page_autosave(GtrPage *page) {
char *folder, *filename;
gchar *autosave_filename;
GError *error;
GError *error = NULL;
/*
* As the file didn't change, we don't need to autosave it, but
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment