Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2013-02-04 13:48:07 +0400
committerLluis Sanchez <lluis@xamarin.com>2013-02-04 13:48:07 +0400
commitd45dad34e1aaf74d9b7982c0f79b8991b7e352c0 (patch)
tree193c2be49fdfd0090e99120d0a2f93f0b324be74 /Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs
parentcad936fc7be7c3369904b7fbc3ef8247308de01a (diff)
Ongoing work to improve the Image API
An image can now have multiple versions with different resolutions.
Diffstat (limited to 'Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs')
-rwxr-xr-xXwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs b/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs
index 8e9b1191..73dcdb99 100755
--- a/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs
+++ b/Xwt.Gtk/Xwt.GtkBackend/ButtonBackend.cs
@@ -26,6 +26,7 @@
using System;
using Xwt.Backends;
+using Xwt.Drawing;
namespace Xwt.GtkBackend
@@ -54,13 +55,13 @@ namespace Xwt.GtkBackend
get { return (IButtonEventSink)base.EventSink; }
}
- public void SetContent (string label, object imageBackend, ContentPosition position)
+ public void SetContent (string label, Image image, ContentPosition position)
{
if (label != null && label.Length == 0)
label = null;
Button b = (Button) Frontend;
- if (label != null && imageBackend == null && b.Type == ButtonType.Normal) {
+ if (label != null && image == null && b.Type == ButtonType.Normal) {
Widget.Label = label;
return;
}
@@ -75,9 +76,9 @@ namespace Xwt.GtkBackend
Gtk.Widget contentWidget = null;
Gtk.Widget imageWidget = null;
- if (imageBackend != null)
- imageWidget = new Gtk.Image ((Gdk.Pixbuf)imageBackend);
-
+ if (image != null)
+ imageWidget = new Gtk.Image (image.ToPixbuf (Gtk.IconSize.Button));
+
if (label != null && imageWidget == null) {
contentWidget = new Gtk.Label (label);
}
@@ -137,7 +138,7 @@ namespace Xwt.GtkBackend
public void SetButtonType (ButtonType type)
{
Button b = (Button) Frontend;
- SetContent (b.Label, Toolkit.GetBackend (b.Image), b.ImagePosition);
+ SetContent (b.Label, b.Image, b.ImagePosition);
}
public override void EnableEvent (object eventId)