[banshee: 49/61] [Hyena.Widgets] Vertically center WrapLabel text
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee: 49/61] [Hyena.Widgets] Vertically center WrapLabel text
- Date: Tue, 3 Nov 2009 06:31:57 +0000 (UTC)
commit eeef414bd0b5484acffdf96f8635f0befd872e26
Author: Gabriel Burt <gabriel burt gmail com>
Date: Thu Oct 15 11:03:14 2009 -0700
[Hyena.Widgets] Vertically center WrapLabel text
src/Libraries/Hyena.Gui/Hyena.Widgets/WrapLabel.cs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Widgets/WrapLabel.cs b/src/Libraries/Hyena.Gui/Hyena.Widgets/WrapLabel.cs
index 582a208..a138e87 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Widgets/WrapLabel.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Widgets/WrapLabel.cs
@@ -102,8 +102,13 @@ namespace Hyena.Widgets
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
if (evnt.Window == GdkWindow) {
+ // Center the text vertically
+ int lw, lh;
+ layout.GetPixelSize (out lw, out lh);
+ int y = Allocation.Y + (Allocation.Height - lh) / 2;
+
Gtk.Style.PaintLayout (Style, GdkWindow, State, false,
- evnt.Area, this, null, Allocation.X, Allocation.Y, layout);
+ evnt.Area, this, null, Allocation.X, y, layout);
}
return true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]