[evolution/gnome-40] I#1474 - Calendar: All day event tooltip shown only above Summary text



commit 0cdf1473199e9b7a2464d32b18fe9b67ea326c57
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 27 11:40:13 2021 +0200

    I#1474 - Calendar: All day event tooltip shown only above Summary text
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1474

 src/calendar/gui/e-day-view-top-item.c | 6 ++++--
 src/calendar/gui/e-day-view.c          | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/gui/e-day-view-top-item.c b/src/calendar/gui/e-day-view-top-item.c
index b545df82a2..7658c032b2 100644
--- a/src/calendar/gui/e-day-view-top-item.c
+++ b/src/calendar/gui/e-day-view-top-item.c
@@ -150,7 +150,7 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item,
        PangoLayout *layout;
        GdkRGBA bg_rgba, rgba;
        cairo_pattern_t *pat;
-       gdouble x0, y0, rect_height, rect_width, radius;
+       gdouble x0, y0, rect_height, rect_width, radius, x_offset = 0.0;
        gboolean draw_flat_events;
 
        day_view = e_day_view_top_item_get_day_view (top_item);
@@ -301,10 +301,12 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item,
                return;
        }
 
+       g_object_get (G_OBJECT (event->canvas_item), "x_offset", &x_offset, NULL);
+
        /* Determine the position of the label, so we know where to place the
         * icons. Note that since the top canvas never scrolls we don't need
         * to take the scroll offset into account. It will always be 0. */
-       text_x = event->canvas_item->x1;
+       text_x = event->canvas_item->x1 + x_offset;
 
        /* Draw the start & end times, if necessary. */
        min_end_time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x;
diff --git a/src/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
index ed25f45d22..893303ea3a 100644
--- a/src/calendar/gui/e-day-view.c
+++ b/src/calendar/gui/e-day-view.c
@@ -6142,12 +6142,13 @@ e_day_view_reshape_long_event (EDayView *day_view,
        text_w = MAX (text_w, 0);
        gnome_canvas_item_set (
                event->canvas_item,
-               "clip_width", (gdouble) text_w,
+               "x_offset", (gdouble) MAX (0, text_x - item_x),
+               "clip_width", (gdouble) MAX (0, item_w - (E_DAY_VIEW_LONG_EVENT_TIME_X_PAD * 2)),
                "clip_height", (gdouble) item_h,
                NULL);
        e_canvas_item_move_absolute (
                event->canvas_item,
-               text_x, item_y);
+               item_x, item_y);
 
        g_object_unref (layout);
        g_object_unref (comp);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]