Compare commits
2 Commits
a68a73cf5c
...
1a8c461af2
Author | SHA1 | Date | |
---|---|---|---|
1a8c461af2 | |||
2a73e46315 |
@ -214,13 +214,14 @@ on_mouse(guint state, guint button, gdouble x, gdouble y)
|
||||
|
||||
switch (button) {
|
||||
case GDK_BUTTON_PRIMARY:
|
||||
g.left = MAX(0, (int) (x - 1)) / g.mcu_width * g.mcu_width;
|
||||
g.top = MAX(0, (int) (y - 1)) / g.mcu_height * g.mcu_height;
|
||||
g.left = CLAMP((int) (x - 1), 0, g.right) / g.mcu_width * g.mcu_width;
|
||||
g.top = CLAMP((int) (y - 1), 0, g.bottom) / g.mcu_height * g.mcu_height;
|
||||
update();
|
||||
return TRUE;
|
||||
case GDK_BUTTON_SECONDARY:
|
||||
g.right = MIN(x, g.width); // Inclusive of pointer position.
|
||||
g.bottom = MIN(y, g.height); // Inclusive of pointer position.
|
||||
// Inclusive of pointer position.
|
||||
g.right = CLAMP(x, g.left, g.width);
|
||||
g.bottom = CLAMP(y, g.top, g.height);
|
||||
update();
|
||||
return TRUE;
|
||||
default:
|
||||
|
@ -189,12 +189,9 @@ create_row(FivSidebar *self, GFile *file, const char *icon_name)
|
||||
GTK_REVEALER(revealer), GTK_REVEALER_TRANSITION_TYPE_NONE);
|
||||
gtk_container_add(GTK_CONTAINER(revealer), rowbox);
|
||||
|
||||
GtkTargetList *target_list = gtk_target_list_new(NULL, 0);
|
||||
gtk_target_list_add_uri_targets(target_list, 0);
|
||||
gtk_drag_source_set(revealer, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_LINK);
|
||||
gtk_drag_source_set_target_list(revealer, target_list);
|
||||
gtk_drag_source_add_uri_targets(revealer);
|
||||
gtk_drag_source_set_icon_name(revealer, "inode-directory-symbolic");
|
||||
gtk_target_list_unref(target_list);
|
||||
|
||||
GtkWidget *row = gtk_list_box_row_new();
|
||||
g_object_set_qdata_full(G_OBJECT(row), fiv_sidebar_location_quark(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user