diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
commit | 0ac947a9070322180e94d1b71e30836cce4d74bc (patch) | |
tree | 4a6f3923c250377536a5004ed203768111a1d27f /src/events/EventDirectoryItem.vala | |
parent | eca5837e235a356c8db9416bbbc13577db3e6f76 (diff) | |
parent | 01b2b5ec9177046f64c6d0a6e73a6ac8a42089a1 (diff) |
Merge branch 'feature/upstream' into develop
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); |