month-view: fix DnD highlight

https://bugzilla.gnome.org/show_bug.cgi?id=771115
This commit is contained in:
Georges Basile Stavracas Neto
2016-09-14 14:01:37 -03:00
parent f25c3675cd
commit 7104c95ffb
2 changed files with 9 additions and 5 deletions
-4
View File
@@ -32,10 +32,6 @@ calendar-view.current {
background-color: alpha(@theme_selected_bg_color, 0.3);
}
calendar-view.current:drop(active) {
background-color: black;
}
calendar-view:selected {
color: @theme_selected_bg_color;
font-weight: bold;
+9 -1
View File
@@ -1776,12 +1776,20 @@ gcal_month_view_draw (GtkWidget *widget,
if (priv->date->year == priv->current_date->year && priv->date->month == priv->current_date->month &&
j == priv->current_date->day)
{
PangoLayout *clayout;
PangoFontDescription *cfont_desc;
PangoLayout *clayout;
gtk_style_context_save (context);
gtk_style_context_add_class (context, "current");
/*
* If the current day is not under a DnD, it's actually not possible
* to *not* show the DnD indicator using only CSS. So we have to fake
* the "I'm not under DnD" state.
*/
if (j != priv->dnd_cell)
gtk_style_context_set_state (context, state & ~GTK_STATE_FLAG_DROP_ACTIVE);
clayout = gtk_widget_create_pango_layout (widget, nr_day);
gtk_style_context_get (context, state, "font", &cfont_desc, NULL);
pango_layout_set_font_description (clayout, cfont_desc);