[ease/themes] [welcomewindow] Added border to WelcomeActor
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/themes] [welcomewindow] Added border to WelcomeActor
- Date: Thu, 22 Jul 2010 20:15:16 +0000 (UTC)
commit b29460c2daff6913936a493c6ff7b251cac46542
Author: Nate Stedman <natesm gmail com>
Date: Thu Jul 22 16:14:00 2010 -0400
[welcomewindow] Added border to WelcomeActor
- Makes the "black" theme visible on the background.
src/ease-slide-button-panel.vala | 8 +-
src/ease-slide-button.vala | 134 --------------------------------------
src/ease-welcome-actor.vala | 30 ++++++---
3 files changed, 23 insertions(+), 149 deletions(-)
---
diff --git a/src/ease-slide-button-panel.vala b/src/ease-slide-button-panel.vala
index d75a751..a7e3614 100644
--- a/src/ease-slide-button-panel.vala
+++ b/src/ease-slide-button-panel.vala
@@ -158,12 +158,12 @@ public class Ease.SlideButtonPanel : Gtk.ScrolledWindow
}
// render a black rectangle around the slide
- /*context.rectangle(0, 0, width, height);
- context.set_source_rgb(0, 0, 0);
- context.stroke();*/
-
context.restore();
+ context.rectangle(0, 0, width, height);
+ context.set_source_rgb(0, 0, 0);
+ context.stroke();
+
// HACK: write it to a PNG, load it and return
path = Path.build_filename(temp_dir,
(temp_count++).to_string() + ".png");
diff --git a/src/ease-welcome-actor.vala b/src/ease-welcome-actor.vala
index 65bed68..0368bb6 100644
--- a/src/ease-welcome-actor.vala
+++ b/src/ease-welcome-actor.vala
@@ -50,6 +50,7 @@ public class Ease.WelcomeActor : Clutter.Group
private const string FONT_NAME = "Sans 8";
private const float TEXT_OFFSET = 5;
private const float TEXT_HEIGHT = 12;
+ private const Clutter.Color TEXT_COLOR = {255, 255, 255, 255};
private Clutter.Text text;
// fade constants
@@ -58,6 +59,11 @@ public class Ease.WelcomeActor : Clutter.Group
private const int FADE_EASE = Clutter.AnimationMode.EASE_IN_OUT_SINE;
private const int FADE_OPACITY = 150;
+ // rectangle appearance
+ private const Clutter.Color RECT_BG = {0, 0, 0, 255};
+ private const Clutter.Color RECT_B_C = {150, 150, 150, 255};
+ private const int RECT_B_W = 1;
+
/**
* The slide identifier to display as a preview.
*/
@@ -85,13 +91,15 @@ public class Ease.WelcomeActor : Clutter.Group
// create the background rectangle actor
rect = new Clutter.Rectangle();
- rect.color = {0, 0, 0, 255};
+ rect.color = RECT_BG;
+ rect.border_color = RECT_B_C;
+ rect.border_width = RECT_B_W;
+ rect.x = -RECT_B_W;
+ rect.y = -RECT_B_W;
add_actor(rect);
// create the theme title actor
- text = new Clutter.Text.full (FONT_NAME,
- theme.title,
- {255, 255, 255, 255});
+ text = new Clutter.Text.full(FONT_NAME, theme.title, TEXT_COLOR);
text.height = TEXT_HEIGHT;
text.line_alignment = Pango.Alignment.RIGHT;
add_actor(text);
@@ -148,16 +156,16 @@ public class Ease.WelcomeActor : Clutter.Group
*/
public void set_actor_size(float w, float h)
{
- rect.width = w;
- rect.height = h;
+ rect.width = roundd(w) + RECT_B_W * 2;
+ rect.height = roundd(h) + RECT_B_W * 2;
- text.x = roundd(rect.width / 2 - text.width / 2);
+ text.x = roundd(w / 2 - text.width / 2);
text.y = roundd(h + TEXT_OFFSET);
if (slide_actor != null)
{
- slide_actor.width = rect.width;
- slide_actor.height = rect.height;
+ slide_actor.width = roundd(w);
+ slide_actor.height = roundd(h);
}
}
@@ -167,7 +175,7 @@ public class Ease.WelcomeActor : Clutter.Group
public void fade()
{
is_selected = false;
- animate(FADE_EASE, FADE_TIME, "opacity", FADE_OPACITY);
+ slide_actor.animate(FADE_EASE, FADE_TIME, "opacity", FADE_OPACITY);
}
/**
@@ -176,7 +184,7 @@ public class Ease.WelcomeActor : Clutter.Group
public void unfade()
{
is_selected = true;
- animate(FADE_EASE, FADE_TIME, "opacity", 255);
+ slide_actor.animate(FADE_EASE, FADE_TIME, "opacity", 255);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]