Skip to content

Commit 2274c2a

Browse files
authored
Merge pull request #17568 from darktable-org/po/filmstrip-sel
change way to interact with filmstrip
2 parents 816cbdd + 74e9c90 commit 2274c2a

File tree

4 files changed

+160
-108
lines changed

4 files changed

+160
-108
lines changed

src/common/selection.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ void dt_selection_select_list(struct dt_selection_t *selection, GList *list);
5151
/** selects a set of images from a list. the list is unaltered */
5252
const struct dt_collection_t *dt_selection_get_collection(struct dt_selection_t *selection);
5353
/** get the list of selected images */
54-
GList *dt_selection_get_list(struct dt_selection_t *selection, const gboolean only_visible,
54+
GList *dt_selection_get_list(struct dt_selection_t *selection,
55+
const gboolean only_visible,
5556
const gboolean ordering);
56-
gchar *dt_selection_get_list_query(struct dt_selection_t *selection, const gboolean only_visible,
57+
gchar *dt_selection_get_list_query(struct dt_selection_t *selection,
58+
const gboolean only_visible,
5759
const gboolean ordering);
5860
// clang-format off
5961
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
6062
// vim: shiftwidth=2 expandtab tabstop=2 cindent
6163
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
6264
// clang-format on
63-

src/dtgtk/thumbnail.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -941,51 +941,13 @@ static gboolean _event_main_motion(GtkWidget *widget,
941941
return FALSE;
942942
}
943943

944-
static gboolean _event_main_press(GtkWidget *widget,
945-
GdkEventButton *event,
946-
gpointer user_data)
947-
{
948-
dt_thumbnail_t *thumb = (dt_thumbnail_t *)user_data;
949-
if(event->button == 1
950-
&& ((event->type == GDK_2BUTTON_PRESS && !thumb->single_click)
951-
|| (event->type == GDK_BUTTON_PRESS
952-
&& dt_modifier_is(event->state, 0) && thumb->single_click)))
953-
{
954-
dt_control_set_mouse_over_id(thumb->imgid);
955-
// to ensure we haven't lost imgid during double-click
956-
}
957-
return FALSE;
958-
}
959-
static gboolean _event_main_release(GtkWidget *widget,
960-
GdkEventButton *event,
961-
gpointer user_data)
962-
{
963-
dt_thumbnail_t *thumb = (dt_thumbnail_t *)user_data;
964-
965-
if(event->button == 1
966-
&& !thumb->moved
967-
&& thumb->sel_mode != DT_THUMBNAIL_SEL_MODE_DISABLED)
968-
{
969-
if(dt_modifier_is(event->state, 0)
970-
&& thumb->sel_mode != DT_THUMBNAIL_SEL_MODE_MOD_ONLY)
971-
dt_selection_select_single(darktable.selection, thumb->imgid);
972-
else if(dt_modifier_is(event->state, GDK_MOD1_MASK))
973-
dt_selection_select_single(darktable.selection, thumb->imgid);
974-
else if(dt_modifier_is(event->state, GDK_CONTROL_MASK)
975-
|| dt_modifier_is(event->state, GDK_MOD2_MASK)) // CMD key on macOS
976-
dt_selection_toggle(darktable.selection, thumb->imgid);
977-
else if(dt_modifier_is(event->state, GDK_SHIFT_MASK))
978-
dt_selection_select_range(darktable.selection, thumb->imgid);
979-
}
980-
return FALSE;
981-
}
982-
983944
static gboolean _event_rating_press(GtkWidget *widget,
984945
GdkEventButton *event,
985946
gpointer user_data)
986947
{
987948
return TRUE;
988949
}
950+
989951
static gboolean _event_rating_release(GtkWidget *widget,
990952
GdkEventButton *event,
991953
gpointer user_data)
@@ -1402,11 +1364,6 @@ GtkWidget *dt_thumbnail_create_widget(dt_thumbnail_t *thumb,
14021364
g_signal_connect(G_OBJECT(thumb->w_main), "drag-motion",
14031365
G_CALLBACK(_event_main_drag_motion), thumb);
14041366

1405-
g_signal_connect(G_OBJECT(thumb->w_main), "button-press-event",
1406-
G_CALLBACK(_event_main_press), thumb);
1407-
g_signal_connect(G_OBJECT(thumb->w_main), "button-release-event",
1408-
G_CALLBACK(_event_main_release), thumb);
1409-
14101367
g_object_set_data(G_OBJECT(thumb->w_main), "thumb", thumb);
14111368
DT_DEBUG_CONTROL_SIGNAL_CONNECT(darktable.signals, DT_SIGNAL_ACTIVE_IMAGES_CHANGE,
14121369
G_CALLBACK(_dt_active_images_callback), thumb);

0 commit comments

Comments
 (0)