[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-76-gb56d0f1
ticho at claws-mail.org
ticho at claws-mail.org
Tue Feb 13 22:45:03 CET 2018
The branch, gtk3 has been updated
via b56d0f12e3410696c9ec3b72da18cd609cc25c2a (commit)
from 0ba0057777400c02c3aa8429fbb8aa111711bdc9 (commit)
Summary of changes:
src/gtk/about.c | 79 ++++++++++++++++++++++++++++++++-----------------------
1 file changed, 46 insertions(+), 33 deletions(-)
- Log -----------------------------------------------------------------
commit b56d0f12e3410696c9ec3b72da18cd609cc25c2a
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Tue Feb 13 15:06:56 2018 +0100
Rework the About window layout to use GtkGrid.
This commit also disables left/right margins for all
textviews in the About window, because of resize issues.
Reported upstream as
https://bugzilla.gnome.org/show_bug.cgi?id=793407
diff --git a/src/gtk/about.c b/src/gtk/about.c
index d7dfbd1..582282a 100644
--- a/src/gtk/about.c
+++ b/src/gtk/about.c
@@ -108,8 +108,9 @@ static GtkWidget *about_create_child_page_info(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
gtk_widget_add_events(text, GDK_LEAVE_NOTIFY_MASK);
@@ -226,8 +227,9 @@ static GtkWidget *about_create_child_page_authors(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
gtk_widget_add_events(text, GDK_LEAVE_NOTIFY_MASK);
@@ -396,8 +398,9 @@ static GtkWidget *about_create_child_page_features(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
gtk_widget_add_events(text, GDK_LEAVE_NOTIFY_MASK);
@@ -546,8 +549,9 @@ static GtkWidget *about_create_child_page_license(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
@@ -629,8 +633,9 @@ static GtkWidget *about_create_child_page_release_notes(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
@@ -678,8 +683,9 @@ static GtkWidget *about_create_child_page_session_stats(void)
text = gtk_text_view_new();
gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
+ /* disable margins until GTK bug 793407 is fixed
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 6);
- gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6);
+ gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 6); */
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(text), FALSE);
gtk_container_add(GTK_CONTAINER(scrolledwin), text);
@@ -772,18 +778,18 @@ static void about_update_stats(void)
static void about_create(void)
{
- GtkWidget *vbox1;
- GtkWidget *image;
- GtkWidget *vbox2;
+ GtkWidget *grid1;
+ GtkWidget *grid2;
+ GtkWidget *image;
GtkWidget *label;
GtkWidget *button;
GtkWidget *scrolledwin;
GtkWidget *notebook;
- GtkWidget *table;
char *markup;
GtkWidget *confirm_area;
GtkWidget *close_button;
static GdkGeometry geometry;
+ gint row = 0;
stats_text_buffer = NULL;
@@ -794,8 +800,6 @@ static void about_create(void)
gtk_widget_set_size_request(window, -1, -1);
g_signal_connect(G_OBJECT(window), "size_allocate",
G_CALLBACK(about_size_allocate_cb), NULL);
- g_signal_connect(G_OBJECT(window), "size_allocate",
- G_CALLBACK(about_size_allocate_cb), NULL);
g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(gtk_widget_hide_on_delete), NULL);
g_signal_connect(G_OBJECT(window), "key_press_event",
@@ -813,30 +817,33 @@ static void about_create(void)
gtk_widget_realize(window);
- vbox1 = gtk_vbox_new(FALSE, 8);
- gtk_container_add(GTK_CONTAINER(window), vbox1);
-
- table = gtk_table_new (2, 1, FALSE);
- gtk_box_pack_start(GTK_BOX(vbox1), table,
- FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (table), 8);
- gtk_table_set_row_spacings (GTK_TABLE (table), 8);
- gtk_table_set_col_spacings (GTK_TABLE (table), 8);
+ grid1 = gtk_grid_new();
+ gtk_widget_set_halign(grid1, GTK_ALIGN_FILL);
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(grid1),
+ GTK_ORIENTATION_VERTICAL);
+ gtk_grid_set_row_spacing(GTK_GRID(grid1), 8);
+ gtk_grid_set_column_spacing(GTK_GRID(grid1), 8);
+ gtk_container_add(GTK_CONTAINER(window), grid1);
image = stock_pixmap_widget(STOCK_PIXMAP_CLAWS_MAIL_LOGO);
- gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND),
- (GtkAttachOptions) (0), 0, 0);
+ gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
+ gtk_grid_attach(GTK_GRID(grid1), image, 0, row, 1, 1);
- vbox2 = gtk_vbox_new (FALSE, 4);
- gtk_table_attach (GTK_TABLE (table), vbox2, 1, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND),
- (GtkAttachOptions) (0), 0, 0);
+ grid2 = gtk_grid_new();
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(grid2),
+ GTK_ORIENTATION_VERTICAL);
+ gtk_widget_set_halign(grid2, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign(grid2, GTK_ALIGN_CENTER);
+ gtk_grid_set_row_spacing(GTK_GRID(grid2), 4);
+
+ gtk_grid_attach(GTK_GRID(grid1), grid2, 1, row, 1, 1);
+ row++;
label = gtk_label_new("");
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
- gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(grid2), label);
markup = g_markup_printf_escaped
("<span weight=\"bold\" size=\"xx-large\">Claws Mail</span>\nversion %s",
VERSION);
@@ -844,7 +851,7 @@ static void about_create(void)
g_free(markup);
button = gtkut_get_link_btn(window, HOMEPAGE_URI, " "HOMEPAGE_URI" ");
- gtk_box_pack_start(GTK_BOX(vbox2), button, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(grid2), button);
#ifndef GENERIC_UMPC
label = gtk_label_new
(_("Copyright (C) 1999-2017\nThe Claws Mail Team\n"
@@ -852,8 +859,9 @@ static void about_create(void)
gtk_label_set_selectable(GTK_LABEL(label), TRUE);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
- gtk_box_pack_start(GTK_BOX(vbox2), label, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(grid2), label);
#endif
+
notebook = gtk_notebook_new();
gtk_widget_set_size_request(notebook, -1, 220);
gtk_widget_show(notebook);
@@ -896,11 +904,16 @@ static void about_create(void)
gtk_label_new_with_mnemonic(_("_Statistics")));
}
- gtk_box_pack_start(GTK_BOX(vbox1), notebook, TRUE, TRUE, 0);
+ gtk_widget_set_hexpand(notebook, TRUE);
+ gtk_widget_set_vexpand(notebook, TRUE);
+ gtk_grid_attach(GTK_GRID(grid1), notebook, 0, row, 2, 1);
+ row++;
gtkut_stock_button_set_create(&confirm_area, &close_button, GTK_STOCK_CLOSE,
NULL, NULL, NULL, NULL);
- gtk_box_pack_end(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 4);
+ gtk_grid_attach(GTK_GRID(grid1), confirm_area, 0, row, 2, 1);
+ row++;
+
gtk_widget_grab_default(close_button);
gtk_widget_grab_focus(close_button);
g_signal_connect_closure
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list