/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2018 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (!GTK_IS_PROGRESS_BAR(w)) {
return FALSE;
}
-
+ gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(w), 0.1);
gtk_progress_bar_pulse(GTK_PROGRESS_BAR(w));
GTK_EVENTS_FLUSH();
return TRUE;
{
GtkWidget *btn;
GtkWidget *btn_label;
-#if !GTK_CHECK_VERSION(3, 0, 0)
GdkColormap *cmap;
gboolean success[2];
-#endif
GdkColor uri_color[2] = {{0, 0, 0, 0xffff}, {0, 0xffff, 0, 0}};
gchar *local_url = NULL;
if (!url)
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)));
-#if !GTK_CHECK_VERSION(3, 0, 0)
cmap = gdk_drawable_get_colormap(gtk_widget_get_window(window));
gdk_colormap_alloc_colors(cmap, uri_color, 2, FALSE, TRUE, success);
if (success[0] == TRUE && success[1] == TRUE) {
-#endif
GtkStyle *style;
gtk_widget_ensure_style(btn_label);
style = gtk_style_copy
style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
gtk_widget_set_style(btn_label, style);
g_object_unref(style);
-#if !GTK_CHECK_VERSION(3, 0, 0)
} else
g_warning("color allocation failed");
-#endif
g_signal_connect(G_OBJECT(btn), "enter",
G_CALLBACK(link_btn_enter), window);
}
}
- w = gdk_pixbuf_get_width(pixbuf);
- h = gdk_pixbuf_get_height(pixbuf);
-
- if (angle == 90 || angle == 270) {
- avail_height = box_width;
- avail_width = box_height;
- } else {
- avail_width = box_width;
- avail_height = box_height;
- }
-
- /* Scale first */
- if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
- if (w > avail_width) {
- h = (avail_width * h) / w;
- w = avail_width;
- }
- if (h > avail_height) {
- w = (avail_height * w) / h;
- h = avail_height;
- }
- t_pixbuf = gdk_pixbuf_scale_simple(pixbuf,
- w, h, GDK_INTERP_BILINEAR);
- g_object_unref(pixbuf);
- pixbuf = t_pixbuf;
- }
/* Rotate if needed */
if (angle != 0) {
pixbuf = t_pixbuf;
}
+ w = gdk_pixbuf_get_width(pixbuf);
+ h = gdk_pixbuf_get_height(pixbuf);
+
+ avail_width = box_width;
+ avail_height = box_height;
+
+ if (box_width != -1 && box_height != -1 && avail_width - 100 > 0) {
+ if (w > avail_width || h > avail_height) {
+ h = (avail_width * h) / w;
+ w = avail_width;
+ }
+ t_pixbuf = gdk_pixbuf_scale_simple(pixbuf,
+ w, h, GDK_INTERP_BILINEAR);
+ g_object_unref(pixbuf);
+ pixbuf = t_pixbuf;
+ }
+
return pixbuf;
}