Browse Source

Merge branch 'master' into fixes/787-contentpresenter-updatechild

pull/1032/head
danwalmsley 9 years ago
committed by GitHub
parent
commit
4ec230b0b1
  1. 2
      docs/tutorial/from-wpf.md
  2. 2
      src/Gtk/Avalonia.Gtk3/Interop/GObject.cs
  3. 2
      src/Gtk/Avalonia.Gtk3/Interop/Utf8Buffer.cs
  4. 3
      src/Gtk/Avalonia.Gtk3/SystemDialogs.cs

2
docs/tutorial/from-wpf.md

@ -33,7 +33,7 @@ placed in a `DataTemplates` collection on each control (and on `Application`):
<TextBox Text="{Binding Name}"/> <TextBox Text="{Binding Name}"/>
</Border> </Border>
</DataTemplate> </DataTemplate>
</UserControl.Styles> </UserControl.DataTemplates>
<!-- Assuming that DataContext.Foo is an object of type <!-- Assuming that DataContext.Foo is an object of type
MyApp.ViewModels.FooViewModel then a red border with a corner MyApp.ViewModels.FooViewModel then a red border with a corner
radius of 8 containing a TextBox will be displayed here --> radius of 8 containing a TextBox will be displayed here -->

2
src/Gtk/Avalonia.Gtk3/Interop/GObject.cs

@ -41,7 +41,7 @@ namespace Avalonia.Gtk3.Interop
class GtkWindow : GtkWidget class GtkWindow : GtkWidget
{ {
public static GtkWindow Null { get; } = new GtkWindow();
} }
class GtkImContext : GObject class GtkImContext : GObject

2
src/Gtk/Avalonia.Gtk3/Interop/Utf8Buffer.cs

@ -11,6 +11,8 @@ namespace Avalonia.Gtk3.Interop
public Utf8Buffer(string s) : base(IntPtr.Zero, true) public Utf8Buffer(string s) : base(IntPtr.Zero, true)
{ {
if (s == null)
return;
_data = Encoding.UTF8.GetBytes(s); _data = Encoding.UTF8.GetBytes(s);
_gchandle = GCHandle.Alloc(_data, GCHandleType.Pinned); _gchandle = GCHandle.Alloc(_data, GCHandleType.Pinned);
handle = _gchandle.AddrOfPinnedObject(); handle = _gchandle.AddrOfPinnedObject();

3
src/Gtk/Avalonia.Gtk3/SystemDialogs.cs

@ -18,7 +18,8 @@ namespace Avalonia.Gtk3
bool multiselect, string initialFileName) bool multiselect, string initialFileName)
{ {
GtkFileChooser dlg; GtkFileChooser dlg;
using (var name = title != null ? new Utf8Buffer(title) : null) parent = parent ?? GtkWindow.Null;
using (var name = new Utf8Buffer(title))
dlg = Native.GtkFileChooserDialogNew(name, parent, action, IntPtr.Zero); dlg = Native.GtkFileChooserDialogNew(name, parent, action, IntPtr.Zero);
if (multiselect) if (multiselect)
Native.GtkFileChooserSetSelectMultiple(dlg, true); Native.GtkFileChooserSetSelectMultiple(dlg, true);

Loading…
Cancel
Save