diff --git a/data/pixmaps/clock.svg b/data/pixmaps/clock.svg deleted file mode 100644 index 913c80f43f39..000000000000 --- a/data/pixmaps/clock.svg +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/dtgtk/paint.c b/src/dtgtk/paint.c index f500fdcb3091..0f2cd70a1afb 100644 --- a/src/dtgtk/paint.c +++ b/src/dtgtk/paint.c @@ -1396,6 +1396,31 @@ void dtgtk_cairo_paint_color_harmony(cairo_t *cr, gint x, gint y, gint w, gint h FINISH } +void dtgtk_cairo_paint_clock(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data) +{ + PREAMBLE(1.2, 1.2, 0.5, 0.5) + + static int clock = 0; + + cairo_arc(cr, .0, .0, 0.5, 0, 2 * M_PI); + cairo_stroke(cr); + + for(int i = 0; i < 12; i++) + { + cairo_arc(cr, .0, .35, i % 3 ? .03 : .05, 0, 2 * M_PI); + cairo_fill(cr); + cairo_rotate(cr, M_PI / 6); + } + cairo_rotate(cr, M_PI / 6 * clock++); + cairo_move_to(cr, 0.075, 0.0); + cairo_line_to(cr, 0.0, 0.4); + cairo_line_to(cr, -0.075, 0.0); + cairo_line_to(cr, 0.0, -0.05); + cairo_fill(cr); + + FINISH +} + void dtgtk_cairo_paint_filmstrip(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data) { const double sw = 0.6; diff --git a/src/dtgtk/paint.h b/src/dtgtk/paint.h index ee918b22d261..ca867611a7e0 100644 --- a/src/dtgtk/paint.h +++ b/src/dtgtk/paint.h @@ -231,6 +231,8 @@ void dtgtk_cairo_paint_jzazbz(cairo_t *cr, gint x, gint y, gint w, gint h, gint void dtgtk_cairo_paint_ryb(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data); /** paint color harmony icon */ void dtgtk_cairo_paint_color_harmony(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data); +/** paint moving clock */ +void dtgtk_cairo_paint_clock(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data); /** paint active modulegroup icon */ void dtgtk_cairo_paint_modulegroup_active(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data); diff --git a/src/gui/splash.c b/src/gui/splash.c index 7632d57b88d8..d48417aa651b 100644 --- a/src/gui/splash.c +++ b/src/gui/splash.c @@ -18,6 +18,7 @@ #include "control/conf.h" #include "gui/gtk.h" +#include "dtgtk/button.h" #include "splash.h" #ifdef GDK_WINDOWING_QUARTZ #include "osx/osx.h" @@ -235,21 +236,15 @@ void darktable_splash_screen_create(GtkWindow *parent_window, // and make that the top portion of the splash screen gtk_box_pack_start(content, GTK_WIDGET(main_box), FALSE, FALSE, 0); #endif + GtkWidget *hbar = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_name(hbar, "splashscreen-separator"); gtk_widget_show(hbar); gtk_box_pack_start(content, hbar, FALSE, FALSE, 0); gtk_box_pack_start(content, progress_text, FALSE, FALSE, 0); - GtkWidget *clock; - gchar *clock_file = g_strdup_printf("%s/pixmaps/clock.svg", darktable.datadir); - GdkPixbuf *clock_image = gdk_pixbuf_new_from_file_at_size(clock_file, -1, 20, NULL); - clock = gtk_image_new_from_pixbuf(clock_image); - g_free(clock_file); - g_object_unref(clock_image); - remaining_box = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0)); - gtk_box_pack_start(remaining_box, GTK_WIDGET(clock), FALSE, FALSE, 0); + gtk_box_pack_start(remaining_box, dtgtk_button_new(dtgtk_cairo_paint_clock, 0, 0), FALSE, FALSE, 0); gtk_box_pack_start(remaining_box, remaining_text, FALSE, FALSE, 0); gtk_box_pack_start(content, GTK_WIDGET(remaining_box), FALSE, FALSE, 0); gtk_widget_set_halign(GTK_WIDGET(remaining_box), GTK_ALIGN_CENTER); @@ -296,6 +291,7 @@ void darktable_splash_screen_set_progress_percent(const char *msg, char *rem_text = g_strdup_printf(" %4d:%02d", minutes, seconds); gtk_label_set_text(GTK_LABEL(remaining_text), rem_text); g_free(rem_text); + gtk_widget_queue_draw(GTK_WIDGET(remaining_box)); } else {