summaryrefslogtreecommitdiff
path: root/src/events/EventDirectoryItem.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
commit0537caaf4af94a9ead8b292679f6b34c90b55e06 (patch)
tree6761cfdf959926be7af3147cf770e7f253390fe8 /src/events/EventDirectoryItem.vala
parenteca5837e235a356c8db9416bbbc13577db3e6f76 (diff)
parent5e9f4eea451a77ba3b93db3747841ed2bd969e9f (diff)
Update upstream source from tag 'upstream/0.30.1'
Update to upstream version '0.30.1' with Debian dir dc242531effff8d9c6fab093414edee28b403c6a
Diffstat (limited to 'src/events/EventDirectoryItem.vala')
-rw-r--r--src/events/EventDirectoryItem.vala20
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);