diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:09:20 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:09:20 +0200 |
commit | 5e9f4eea451a77ba3b93db3747841ed2bd969e9f (patch) | |
tree | 75046a38ca68975261d853a2e56ff7bf6b3e1daa /src/events/EventDirectoryItem.vala | |
parent | 18b52c2983a1b3409011f72d27f15de576c5eb1c (diff) |
New upstream version 0.30.1upstream/0.30.1
Diffstat (limited to 'src/events/EventDirectoryItem.vala')
-rw-r--r-- | src/events/EventDirectoryItem.vala | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/events/EventDirectoryItem.vala b/src/events/EventDirectoryItem.vala index f75a8e0..5b177fb 100644 --- a/src/events/EventDirectoryItem.vala +++ b/src/events/EventDirectoryItem.vala @@ -146,6 +146,10 @@ class EventDirectoryItem : CheckerboardItem { protected override void thumbnail_altered() { MediaSource media = event.get_primary_source(); + set_paul_lynde(media); + } + + private void set_paul_lynde(MediaSource media) { // get new center square paul_lynde = get_paul_lynde_rect(media); @@ -158,11 +162,23 @@ class EventDirectoryItem : CheckerboardItem { } else { clear_image(Dimensions.for_rectangle(paul_lynde)); } - + base.thumbnail_altered(); } - protected override void paint_shadow(Cairo.Context ctx, Dimensions dimensions, Gdk.Point origin, + public override void handle_mouse_leave() { + base.handle_mouse_leave(); + set_paul_lynde(event.get_primary_source()); + } + + public override void handle_mouse_motion(int x, int y, int height, int width) { + int steppedX = x - (x % 15); + int element_index = (int) Math.round( (double) steppedX / width * (event.get_media_count() - 1) ); + unowned MediaSource media = event.get_media().to_array()[element_index]; + set_paul_lynde(media); + } + + protected override void paint_shadow(Cairo.Context ctx, Dimensions dimensions, Gdk.Point origin, int radius, float initial_alpha) { Dimensions altered = Dimensions(dimensions.width - 25, dimensions.height - 25); base.paint_shadow(ctx, altered, origin, 36, initial_alpha); |