[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-76-g1c5016e93

paul at claws-mail.org paul at claws-mail.org
Tue Aug 24 08:05:55 UTC 2021


The branch, gtk3 has been updated
       via  1c5016e935e69475f0d7a4d023eff14434054346 (commit)
      from  781785c94b1b19c6ee3fa5228d91b11fd1262bcd (commit)

Summary of changes:
 src/gtk/about.c      |  2 +-
 src/gtk/gtkutils.c   | 42 ------------------------------------------
 src/gtk/gtkutils.h   |  1 -
 src/prefs_spelling.c |  3 +--
 src/prefs_themes.c   |  2 +-
 5 files changed, 3 insertions(+), 47 deletions(-)


- Log -----------------------------------------------------------------
commit 1c5016e935e69475f0d7a4d023eff14434054346
Author: paul <paul at claws-mail.org>
Date:   Tue Aug 24 09:05:52 2021 +0100

    replace homebrewed gtkut_get_link_btn() with gtk_link_button_new[...]()

diff --git a/src/gtk/about.c b/src/gtk/about.c
index 23986f3ab..eb14eba7b 100644
--- a/src/gtk/about.c
+++ b/src/gtk/about.c
@@ -850,7 +850,7 @@ static void about_create(void)
 	gtk_label_set_markup(GTK_LABEL(label), markup);
 	g_free(markup);
 
-	button = gtkut_get_link_btn(window, HOMEPAGE_URI, " "HOMEPAGE_URI" ");
+	button = gtk_link_button_new(HOMEPAGE_URI);
 	gtk_container_add(GTK_CONTAINER(grid2), button);
 #ifndef GENERIC_UMPC
 	label = gtk_label_new
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index da8325717..6849bab69 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1214,48 +1214,6 @@ static void link_btn_unrealize(GtkButton *button, gpointer data)
 	g_free(url);
 }
 
-GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *label)
-{
-	GtkWidget *btn;
-	GtkWidget *btn_label;
-	GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
-	gchar *local_url = NULL;
-	if (!url)
-		return NULL;
-
-	GTKUT_GDKRGBA_TO_GDKCOLOR(prefs_common.color[COL_URI], uri_color[0])
-	GTKUT_GDKRGBA_TO_GDKCOLOR(prefs_common.color[COL_URI], uri_color[1])
-
-	btn = gtk_button_new_with_label(label?label:url);
-	gtk_button_set_relief(GTK_BUTTON(btn), GTK_RELIEF_NONE);
-	btn_label = gtk_bin_get_child(GTK_BIN((btn)));
-		GtkStyle *style;
-		gtk_widget_ensure_style(btn_label);
-		style = gtk_style_copy
-			(gtk_widget_get_style(btn_label));
-		style->fg[GTK_STATE_NORMAL]   = uri_color[0];
-		style->fg[GTK_STATE_ACTIVE]   = uri_color[1];
-		style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
-		gtk_widget_set_style(btn_label, style);
-		g_object_unref(style);
-
-	g_signal_connect(G_OBJECT(btn), "enter",
-			 G_CALLBACK(link_btn_enter), window);
-	g_signal_connect(G_OBJECT(btn), "leave",
-			 G_CALLBACK(link_btn_leave), window);
-	g_signal_connect(G_OBJECT(btn), "pressed",
-			 G_CALLBACK(link_btn_pressed), window);
-	g_signal_connect(G_OBJECT(btn), "released",
-			 G_CALLBACK(link_btn_released), window);
-			 
-	local_url = g_strdup(url);
-	g_signal_connect(G_OBJECT(btn), "clicked",
-			 G_CALLBACK(link_btn_clicked), local_url);
-	g_signal_connect(G_OBJECT(btn), "unrealize",
-			 G_CALLBACK(link_btn_unrealize), local_url);
-	return btn;
-}
-
 static gboolean _combobox_separator_func(GtkTreeModel *model,
 		GtkTreeIter *iter, gpointer data)
 {
diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index dfcdc23e3..0ed7440e8 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -181,7 +181,6 @@ gboolean get_tag_range(GtkTextIter *iter,
 				       GtkTextIter *end_iter);
 
 GtkWidget *face_get_from_header(const gchar *o_face);
-GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *label);
 
 GtkWidget *gtkut_sc_combobox_create(GtkWidget *eventbox, gboolean focus_on_click);
 void gtkutils_scroll_one_line	(GtkWidget *widget, 
diff --git a/src/prefs_spelling.c b/src/prefs_spelling.c
index ba3afb465..3d96fc29e 100644
--- a/src/prefs_spelling.c
+++ b/src/prefs_spelling.c
@@ -170,9 +170,8 @@ static void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gp
 	gtk_grid_attach(GTK_GRID(table), both_dict_check, 1, 2, 1, 1);
 
 #ifdef WIN32
-	get_dictionaries_btn = gtkut_get_link_btn(GTK_WIDGET(window), 
+	get_dictionaries_btn = gtk_link_button_new_with_label(
 				DICTS_URI, _("Get more dictionaries..."));
-
 	gtk_widget_show(get_dictionaries_btn);
 	gtk_grid_attach(GTK_GRID(table), get_dictionaries_btn, 1, 3, 1, 1);
 #endif
diff --git a/src/prefs_themes.c b/src/prefs_themes.c
index 1132ddb0b..90dfc93ef 100644
--- a/src/prefs_themes.c
+++ b/src/prefs_themes.c
@@ -973,7 +973,7 @@ static void prefs_themes_create_widget(PrefsPage *page, GtkWindow *window, gpoin
 	gtk_box_pack_start (GTK_BOX (hbox3), btn_install, FALSE, FALSE, 0);
 	gtk_widget_set_can_default (btn_install, TRUE);
 
-	btn_more = gtkut_get_link_btn((GtkWidget *)window, THEMES_URI, _("Get more..."));
+	btn_more = gtk_link_button_new_with_label(THEMES_URI, _("Get more..."));
 	gtk_widget_show (btn_more);
 	gtk_box_pack_start (GTK_BOX (hbox3), btn_more, FALSE, FALSE, 0);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list