[gnome-calendar] event-widget: update style
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: update style
- Date: Thu, 14 Sep 2017 16:32:04 +0000 (UTC)
commit b3cfbe3d3115f47c1f0a6e208b73674c8dca92eb
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Sep 11 23:55:35 2017 -0300
event-widget: update style
src/gcal-event-widget.c | 70 ++++++++++++++++++++++++++---------------------
1 files changed, 39 insertions(+), 31 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index 9070ee3..bee13f2 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -31,23 +31,23 @@
struct _GcalEventWidget
{
- GtkWidget parent;
+ GtkWidget parent;
/* properties */
- GDateTime *dt_start;
- GDateTime *dt_end;
+ GDateTime *dt_start;
+ GDateTime *dt_end;
/* internal data */
- gboolean clock_format_24h : 1;
- gboolean read_only : 1;
- gchar *css_class;
+ gboolean clock_format_24h : 1;
+ gboolean read_only : 1;
+ gchar *css_class;
- GcalEvent *event;
+ GcalEvent *event;
- GtkOrientation orientation;
+ GtkOrientation orientation;
- GdkWindow *event_window;
- gboolean button_pressed;
+ GdkWindow *event_window;
+ gboolean button_pressed;
};
enum
@@ -71,6 +71,10 @@ static guint signals[NUM_SIGNALS] = { 0, };
G_DEFINE_TYPE_WITH_CODE (GcalEventWidget, gcal_event_widget, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL));
+/*
+ * Auxiliary methods
+ */
+
static gchar*
get_visible_text (GtkWidget *widget,
GtkOrientation orientation)
@@ -432,27 +436,10 @@ gcal_event_widget_set_event_internal (GcalEventWidget *self,
gcal_event_widget_set_event_tooltip (self, event);
}
-static void
-gcal_event_widget_init (GcalEventWidget *self)
-{
- GtkWidget *widget;
-
- widget = GTK_WIDGET (self);
- self->clock_format_24h = is_clock_format_24h ();
- self->orientation = GTK_ORIENTATION_HORIZONTAL;
-
- gtk_widget_set_has_window (widget, FALSE);
- gtk_widget_set_can_focus (widget, TRUE);
-
- /* Setup the event widget as a drag source */
- gtk_drag_source_set (widget,
- GDK_BUTTON1_MASK,
- NULL,
- 0,
- GDK_ACTION_MOVE);
- gtk_drag_source_add_text_targets (widget);
-}
+/*
+ * GObject overrides
+ */
static void
gcal_event_widget_set_property (GObject *object,
@@ -857,7 +844,7 @@ gcal_event_widget_draw (GtkWidget *widget,
g_object_unref (layout);
g_free (display_text);
- return FALSE;
+ return GTK_WIDGET_CLASS (gcal_event_widget_parent_class)->draw (widget, cr);
}
static gboolean
@@ -1025,6 +1012,27 @@ gcal_event_widget_class_init(GcalEventWidgetClass *klass)
gtk_widget_class_set_css_name (widget_class, "event-widget");
}
+static void
+gcal_event_widget_init (GcalEventWidget *self)
+{
+ GtkWidget *widget;
+
+ widget = GTK_WIDGET (self);
+ self->clock_format_24h = is_clock_format_24h ();
+ self->orientation = GTK_ORIENTATION_HORIZONTAL;
+
+ gtk_widget_set_has_window (widget, FALSE);
+ gtk_widget_set_can_focus (widget, TRUE);
+
+ /* Setup the event widget as a drag source */
+ gtk_drag_source_set (widget,
+ GDK_BUTTON1_MASK,
+ NULL,
+ 0,
+ GDK_ACTION_MOVE);
+
+ gtk_drag_source_add_text_targets (widget);
+}
GtkWidget*
gcal_event_widget_new (GcalEvent *event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]