[libchamplain/libchamplain-0-4] Make the licence code work as the scale code
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libchamplain/libchamplain-0-4] Make the licence code work as the scale code
- Date: Fri, 15 Jan 2010 03:25:54 +0000 (UTC)
commit dfa8e91cf244fee3fa57dce6f10ac4061a3f66b5
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Thu Jan 14 16:06:32 2010 -0500
Make the licence code work as the scale code
champlain/champlain-view.c | 37 ++++++++++++++++++++++++-------------
1 files changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 3afdcfe..472b860 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1102,6 +1102,27 @@ champlain_view_class_init (ChamplainViewClass *champlainViewClass)
}
+static void
+create_license (ChamplainView *view)
+{
+ ChamplainViewPrivate *priv = view->priv;
+
+ if (priv->license_actor)
+ {
+ g_object_unref (priv->license_actor);
+ clutter_container_remove_actor (CLUTTER_CONTAINER (priv->stage), priv->license_actor);
+ }
+
+ priv->license_actor = g_object_ref (clutter_text_new ());
+ clutter_text_set_font_name (CLUTTER_TEXT (priv->license_actor), "sans 8");
+ clutter_text_set_line_alignment (CLUTTER_TEXT (priv->license_actor), PANGO_ALIGN_RIGHT);
+ clutter_actor_set_opacity (priv->license_actor, 128);
+ clutter_container_add_actor (CLUTTER_CONTAINER (priv->stage),
+ priv->license_actor);
+ clutter_actor_set_anchor_point_from_gravity (priv->license_actor, CLUTTER_GRAVITY_SOUTH_EAST);
+ clutter_actor_raise_top (priv->license_actor);
+}
+
static gboolean
button_release_cb (ClutterActor *actor,
ClutterEvent *event,
@@ -1358,6 +1379,9 @@ champlain_view_init (ChamplainView *view)
/* Setup scale */
create_scale (view);
+ /* Setup license */
+ create_license (view);
+
/* Setup finger scroll */
priv->finger_scroll = g_object_ref (tidy_finger_scroll_new (priv->scroll_mode));
@@ -1482,25 +1506,12 @@ champlain_view_set_size (ChamplainView *view,
clutter_actor_set_size (CLUTTER_ACTOR (view), width, height);
}
-
static void
update_license (ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
gchar *license;
- if (!priv->license_actor)
- {
- priv->license_actor = g_object_ref (clutter_text_new ());
- clutter_text_set_font_name (CLUTTER_TEXT (priv->license_actor), "sans 8");
- clutter_text_set_line_alignment (CLUTTER_TEXT (priv->license_actor), PANGO_ALIGN_RIGHT);
- clutter_actor_set_opacity (priv->license_actor, 128);
- clutter_container_add_actor (CLUTTER_CONTAINER (priv->stage),
- priv->license_actor);
- clutter_actor_set_anchor_point_from_gravity (priv->license_actor, CLUTTER_GRAVITY_SOUTH_EAST);
- clutter_actor_raise_top (priv->license_actor);
- }
-
if (priv->license_text)
license = g_strjoin ("\n",
priv->license_text,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]