views/month-cell: Unstyle cells when overflow button is focused

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/835>
This commit is contained in:
Hari Rana
2026-09-25 19:13:29 +00:00
committed by Marge Bot
parent 02ad105088
commit bf8e9929e3
3 changed files with 25 additions and 0 deletions
+4
View File
@@ -12,6 +12,10 @@ template $GcalMonthCell: Widget {
receives-default: true;
focusable: true;
EventControllerMotion {
motion => $on_motion_controller_motion_cb(template);
}
Adw.BreakpointBin breakpoint_bin {
width-request: 50;
height-request: 50;
+17
View File
@@ -199,6 +199,22 @@ overflow_button_clicked_cb (GtkWidget *button,
g_signal_emit (self, signals[SHOW_OVERFLOW], 0, button);
}
static void
on_motion_controller_motion_cb (GcalMonthCell *self,
gdouble x,
gdouble y,
GtkEventControllerMotion *controller)
{
GtkStateFlags overflow_button_state_flags;
overflow_button_state_flags = gtk_widget_get_state_flags (self->overflow_button);
if (overflow_button_state_flags & GTK_STATE_FLAG_PRELIGHT)
gtk_widget_add_css_class (GTK_WIDGET (self), "overflow-hovered");
else
gtk_widget_remove_css_class (GTK_WIDGET (self), "overflow-hovered");
}
static void
on_weather_service_weather_changed_cb (GcalWeatherService *weather_service,
GcalMonthCell *self)
@@ -295,6 +311,7 @@ gcal_month_cell_class_init (GcalMonthCellClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalMonthCell, weather_icon);
gtk_widget_class_bind_template_callback (widget_class, overflow_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, on_motion_controller_motion_cb);
gtk_widget_class_set_css_name (widget_class, "monthcell");
+4
View File
@@ -280,6 +280,10 @@ monthcell {
outline-offset: 4px;
}
monthcell.overflow-hovered:hover {
background-color: var(--bg-color);
}
monthcell .overflow {
border-radius: 6px;
}