Migrated get_icon_margin to gcal-utils.
Moved to use it later on GcalSearchbar.
This commit is contained in:
@@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
struct _GcalToolbarPrivate
|
struct _GcalToolbarPrivate
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
@@ -93,8 +91,6 @@ static void gcal_toolbar_back_clicked (GtkWidget *button,
|
|||||||
static void gcal_toolbar_event_edited (GtkWidget *button,
|
static void gcal_toolbar_event_edited (GtkWidget *button,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
static gint get_icon_margin (void);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GcalToolbar, gcal_toolbar, GTK_CLUTTER_TYPE_ACTOR);
|
G_DEFINE_TYPE (GcalToolbar, gcal_toolbar, GTK_CLUTTER_TYPE_ACTOR);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -621,16 +617,6 @@ gcal_toolbar_event_edited (GtkWidget *button,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
|
||||||
get_icon_margin (void)
|
|
||||||
{
|
|
||||||
gint toolbar_size, menu_size;
|
|
||||||
|
|
||||||
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &menu_size, NULL);
|
|
||||||
gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR, &toolbar_size, NULL);
|
|
||||||
return (gint) floor ((toolbar_size - menu_size) / 2.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Public API */
|
/* Public API */
|
||||||
ClutterActor*
|
ClutterActor*
|
||||||
gcal_toolbar_new (void)
|
gcal_toolbar_new (void)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
static const gint
|
static const gint
|
||||||
ab_day[7] =
|
ab_day[7] =
|
||||||
@@ -278,6 +279,16 @@ gcal_compare_event_widget_by_date (gconstpointer a,
|
|||||||
return icaltime_compare (*a_date, *b_date);
|
return icaltime_compare (*a_date, *b_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gint
|
||||||
|
get_icon_margin (void)
|
||||||
|
{
|
||||||
|
gint toolbar_size, menu_size;
|
||||||
|
|
||||||
|
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &menu_size, NULL);
|
||||||
|
gtk_icon_size_lookup (GTK_ICON_SIZE_LARGE_TOOLBAR, &toolbar_size, NULL);
|
||||||
|
return (gint) floor ((toolbar_size - menu_size) / 2.0);
|
||||||
|
}
|
||||||
|
|
||||||
/* Function to do a last minute fixup of the AM/PM stuff if the locale
|
/* Function to do a last minute fixup of the AM/PM stuff if the locale
|
||||||
* and gettext haven't done it right. Most English speaking countries
|
* and gettext haven't done it right. Most English speaking countries
|
||||||
* except the USA use the 24 hour clock (UK, Australia etc). However
|
* except the USA use the 24 hour clock (UK, Australia etc). However
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ GdkPixbuf* gcal_get_pixbuf_from_color (GdkColor
|
|||||||
gint gcal_compare_event_widget_by_date (gconstpointer a,
|
gint gcal_compare_event_widget_by_date (gconstpointer a,
|
||||||
gconstpointer b);
|
gconstpointer b);
|
||||||
|
|
||||||
|
gint get_icon_margin (void);
|
||||||
|
|
||||||
/* code brought from evolution */
|
/* code brought from evolution */
|
||||||
gsize e_strftime_fix_am_pm (gchar *str,
|
gsize e_strftime_fix_am_pm (gchar *str,
|
||||||
gsize max,
|
gsize max,
|
||||||
|
|||||||
Reference in New Issue
Block a user