[gnome-contacts] Add HoverImage widgets



commit db4072c6f03086dc1e67cbfb42124711f9b3f92d
Author: Alexander Larsson <alexl redhat com>
Date:   Wed May 18 15:13:16 2011 +0200

    Add HoverImage widgets
    
    Its a GtkImage that is only visible in prelight and active states.

 src/Makefile.am               |    3 ++-
 src/contacts-hover-image.vala |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2a6ed28..f41d8ad 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-NULL = 
+NULL =
 
 AM_CPPFLAGS = \
 	-include config.h \
@@ -19,6 +19,7 @@ gnome_contacts_SOURCES = \
 	contacts-app.vala \
 	contacts-contact.vala \
 	contacts-starred-button.vala \
+	contacts-hover-image.vala \
 	contacts-clickable.vala \
 	main.vala \
 	$(NULL)
diff --git a/src/contacts-hover-image.vala b/src/contacts-hover-image.vala
new file mode 100644
index 0000000..405ae55
--- /dev/null
+++ b/src/contacts-hover-image.vala
@@ -0,0 +1,33 @@
+/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
+/*
+ * Copyright (C) 2011 Alexander Larsson <alexl redhat com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+using Gtk;
+
+public class Contacts.HoverImage : Image  {
+
+  public HoverImage () {
+  }
+
+  public override bool draw (Cairo.Context cr) {
+    var state = get_state_flags ();
+    if ((state & (StateFlags.PRELIGHT | StateFlags.ACTIVE)) != 0)
+      base.draw (cr);
+    return false;
+  }
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]