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

icon for snapshots restore button #17885

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/dtgtk/paint.c
Original file line number Diff line number Diff line change
Expand Up @@ -3449,6 +3449,22 @@ void dtgtk_cairo_paint_filtering_menu(cairo_t *cr, gint x, gint y, gint w, gint
FINISH
}

void dtgtk_cairo_paint_snapshots_restore(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)
{
PREAMBLE(1, 1, 0, 0)

cairo_move_to(cr, 0.5, 0.05);
cairo_line_to(cr, 0.5, 0.95);
cairo_move_to(cr, 0.3, 0.6);
cairo_line_to(cr, 0.5, 0.95);
cairo_line_to(cr, 0.7, 0.6);
cairo_move_to(cr, 0.2, 0.95);
cairo_line_to(cr, 0.8, 0.95);
cairo_stroke(cr);

FINISH
}

// clang-format off
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
// vim: shiftwidth=2 expandtab tabstop=2 cindent
Expand Down
3 changes: 3 additions & 0 deletions src/dtgtk/paint.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ void dtgtk_cairo_paint_pin(cairo_t *cr, gint x, gint y, gint w, gint h, gint fla
/** Paint a menu icon for filtering in topbar */
void dtgtk_cairo_paint_filtering_menu(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data);

/** Paint an icon for snapshots restore button */
void dtgtk_cairo_paint_snapshots_restore(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data);

#ifdef __cplusplus
} // extern "C"
#endif /* __cplusplus */
Expand Down
2 changes: 1 addition & 1 deletion src/libs/snapshots.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ static void _init_snapshot_entry(dt_lib_module_t *self, dt_lib_snapshot_t *s)
g_signal_connect(G_OBJECT(s->entry), "activate",
G_CALLBACK(_entry_activated_callback), self);

s->restore_button = gtk_button_new_with_label("⤓");
s->restore_button = dtgtk_togglebutton_new(dtgtk_cairo_paint_snapshots_restore, 0, NULL);
gtk_widget_set_tooltip_text(s->restore_button,
_("restore snapshot into current history"));
g_signal_connect(G_OBJECT(s->restore_button), "clicked",
Expand Down
Loading