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:
@@ -12,6 +12,10 @@ template $GcalMonthCell: Widget {
|
|||||||
receives-default: true;
|
receives-default: true;
|
||||||
focusable: true;
|
focusable: true;
|
||||||
|
|
||||||
|
EventControllerMotion {
|
||||||
|
motion => $on_motion_controller_motion_cb(template);
|
||||||
|
}
|
||||||
|
|
||||||
Adw.BreakpointBin breakpoint_bin {
|
Adw.BreakpointBin breakpoint_bin {
|
||||||
width-request: 50;
|
width-request: 50;
|
||||||
height-request: 50;
|
height-request: 50;
|
||||||
|
|||||||
@@ -199,6 +199,22 @@ overflow_button_clicked_cb (GtkWidget *button,
|
|||||||
g_signal_emit (self, signals[SHOW_OVERFLOW], 0, 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
|
static void
|
||||||
on_weather_service_weather_changed_cb (GcalWeatherService *weather_service,
|
on_weather_service_weather_changed_cb (GcalWeatherService *weather_service,
|
||||||
GcalMonthCell *self)
|
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_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, 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");
|
gtk_widget_class_set_css_name (widget_class, "monthcell");
|
||||||
|
|
||||||
|
|||||||
@@ -280,6 +280,10 @@ monthcell {
|
|||||||
outline-offset: 4px;
|
outline-offset: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
monthcell.overflow-hovered:hover {
|
||||||
|
background-color: var(--bg-color);
|
||||||
|
}
|
||||||
|
|
||||||
monthcell .overflow {
|
monthcell .overflow {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user