[longomatch] Load cursors through files instead of resources.
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Load cursors through files instead of resources.
- Date: Mon, 27 Apr 2015 22:21:52 +0000 (UTC)
commit b6945ea6cf851f48872ffb64501ca1c5b0b335b6
Author: Julien Moutte <julien fluendo com>
Date: Fri Apr 24 15:20:41 2015 +0200
Load cursors through files instead of resources.
LongoMatch.Drawing.Cairo/WidgetWrapper.cs | 6 ++-
images/cursors/angle | 38 ---------------
images/cursors/arrow | 38 ---------------
images/cursors/cross | Bin 113 -> 0 bytes
images/cursors/ellipse | 38 ---------------
images/cursors/eraser | Bin 751 -> 0 bytes
images/cursors/freehand | 38 ---------------
images/cursors/hand_closed | 18 -------
images/cursors/hand_opened | 17 -------
images/cursors/hand_select | 19 -------
images/cursors/number | 38 ---------------
images/cursors/player | 75 -----------------------------
images/cursors/rect | 38 ---------------
images/cursors/text | 38 ---------------
images/cursors/zoom | 69 --------------------------
15 files changed, 4 insertions(+), 466 deletions(-)
---
diff --git a/LongoMatch.Drawing.Cairo/WidgetWrapper.cs b/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
index df5a6c3..f57ac07 100644
--- a/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
+++ b/LongoMatch.Drawing.Cairo/WidgetWrapper.cs
@@ -16,6 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
using System;
+using System.IO;
using Gtk;
using Gdk;
using LongoMatch.Core.Common;
@@ -25,6 +26,7 @@ using Rectangle = Gdk.Rectangle;
using Point = LongoMatch.Core.Common.Point;
using CursorType = LongoMatch.Core.Common.CursorType;
using GCursorType = Gdk.CursorType;
+using Image = LongoMatch.Core.Common.Image;
namespace LongoMatch.Drawing.Cairo
{
@@ -211,8 +213,8 @@ namespace LongoMatch.Drawing.Cairo
if (cursorStr == null) {
widget.GdkWindow.Cursor = cursor;
} else {
- Cursor c = new Cursor (widget.Display,
- Gdk.Pixbuf.LoadFromResource (cursorStr), 0, 0);
+ Image img = Image.LoadFromFile (Path.Combine (Config.ImagesDir, "cursors",
cursorStr));
+ Cursor c = new Cursor (widget.Display, img.Value, 0, 0);
widget.GdkWindow.Cursor = c;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]