Skip to content

Commit

Permalink
1.0.2 - Fix the button icon contrast, re-add picker button bg
Browse files Browse the repository at this point in the history
  • Loading branch information
Lains committed Oct 28, 2021
1 parent f7489e6 commit 029ddbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/chooser.vala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class Colorway.Chooser : Gtk.DrawingArea {
drag = new Gtk.GestureDrag ();
GLib.Signal.connect (drag, "drag-begin", (GLib.Callback) gesture_drag_begin, null);
GLib.Signal.connect (drag, "drag-update", (GLib.Callback) gesture_drag_update, null);
GLib.Signal.connect (drag, "drag-end", (GLib.Callback) gesture_drag_end, null);
this.add_controller (drag);

surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, WIDTH, HEIGHT);
Expand Down Expand Up @@ -165,6 +166,8 @@ public class Colorway.Chooser : Gtk.DrawingArea {
xpos = start_x;
ypos = start_y;

drag.set_state (Gtk.EventSequenceState.CLAIMED);

double new_s, new_v;
xy_to_sv (xpos, ypos, out new_s, out new_v);
instance.on_sv_move (new_s, new_v);
Expand Down Expand Up @@ -196,4 +199,8 @@ public class Colorway.Chooser : Gtk.DrawingArea {
instance.on_sv_move (new_s, new_v);
instance.queue_draw ();
}

private static void gesture_drag_end (double offset_x, double offset_y) {
drag.set_state (Gtk.EventSequenceState.DENIED);
}
}

0 comments on commit 029ddbd

Please sign in to comment.