Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

animated clock for remaining_text on splash_screen #17819

Closed
wants to merge 1 commit into from

Conversation

esq4
Copy link
Contributor

@esq4 esq4 commented Nov 11, 2024

animated alternative to #17749 (clock on splash screen on windows 10 #17730)

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes proposed.

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have the following error when starting dt and as soon as the splash screen appears:

(darktable:1369493): GLib-GObject-CRITICAL **: 17:33:07.275: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Also, I don't see the clock... Maybe related.

@esq4
Copy link
Contributor Author

esq4 commented Nov 16, 2024

I still have the following error when starting dt and as soon as the splash screen appears:

(darktable:1369493): GLib-GObject-CRITICAL **: 17:33:07.275: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Also, I don't see the clock... Maybe related.

I added a check for "g_object_unref" and updated 'CMakeLists.txt".

@dterrahe
Copy link
Member

dterrahe commented Nov 18, 2024

Instead of introducing 1700+ lines of svg, why not stick with the standard of using cairo painted icons?

Add the following to dtgtk/paint.c (and corresponding declaration to the header file)

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_rotate(cr, M_PI / 6);
    cairo_arc(cr, .0, .35, .02, 0, 2 * M_PI);
    cairo_stroke(cr);
  }
  cairo_rotate(cr, M_PI / 6 * clock++);
  cairo_move_to(cr, 0.0, 0.0);
  cairo_line_to(cr, 0.0, 0.3);
  cairo_stroke(cr);

  FINISH
}

and you can add the icon (in darktable_splash_screen_create) using

gtk_box_pack_start(remaining_box, dtgtk_button_new(dtgtk_cairo_paint_clock, 0, 0), FALSE, FALSE, 0);

(no need to save in static variable but you need to #include "dtgtk/button.h") and refresh it (in darktable_splash_screen_set_progress_percent) using

gtk_widget_queue_draw(GTK_WIDGET(remaining_box));

(no need for darktable_splash_screen_set_remaining_clock or clock_count either)

@dterrahe
Copy link
Member

I've committed the simpler approach to my fork if you want to cherry-pick to test or merge.

@dterrahe dterrahe requested a review from TurboGit November 19, 2024 16:00
@TurboGit
Copy link
Member

@dterrahe : Thanks, I'll review after 5.0, it is now too late for new features.

@TurboGit TurboGit added this to the 5.2 milestone Nov 19, 2024
@TurboGit
Copy link
Member

Closing this as supersede by #17874.

@TurboGit TurboGit closed this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants