Explorar o código

Notes Editor "Add" button is now an overlay, rather than a separate column

Frank van den Bos %!s(int64=2) %!d(string=hai) anos
pai
achega
80b461642d

+ 14 - 6
inabox.wpf/DynamicGrid/Editors/NotesEditor/NotesEditorControl.cs

@@ -6,6 +6,7 @@ using System.Windows.Data;
 using System.Windows.Media;
 using InABox.Clients;
 using InABox.Core;
+using InABox.WPF;
 
 namespace InABox.DynamicGrid
 {
@@ -106,6 +107,7 @@ namespace InABox.DynamicGrid
             Grid = new Grid();
             Grid.VerticalAlignment = VerticalAlignment.Stretch;
             Grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
+            Grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
             Grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
             Grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
 
@@ -119,7 +121,9 @@ namespace InABox.DynamicGrid
                 //Background = new SolidColorBrush(Colors.Yellow)
             };
             Scroll.SetValue(Grid.RowProperty, 0);
+            Scroll.SetValue(Grid.RowSpanProperty, 2);
             Scroll.SetValue(Grid.ColumnProperty, 0);
+            Scroll.SetValue(Grid.ColumnSpanProperty, 2);
 
             Grid.Children.Add(Scroll);
 
@@ -156,21 +160,25 @@ namespace InABox.DynamicGrid
             };
 
             Scroll.Child = History;
-
+            
             Button = new Button
             {
                 VerticalAlignment = VerticalAlignment.Stretch,
                 VerticalContentAlignment = VerticalAlignment.Center,
                 HorizontalAlignment = HorizontalAlignment.Stretch,
                 HorizontalContentAlignment = HorizontalAlignment.Center,
-                Content = "Add",
-                Width = 50
+                BorderThickness = new Thickness(0F),
+                Background = Brushes.Transparent,
+                Content = new Image() { Source = Wpf.Resources.add.AsBitmapImage() },
+                Width = 48,
+                Height=48,
+                Margin=new Thickness(0,0,5,5)
             };
-            Button.SetValue(Grid.RowProperty, 0);
-            Button.SetValue(Grid.ColumnProperty, 1);
             Button.Click += Button_Click;
-            Button.Margin = new Thickness(5, 0, 0, 0);
+            Button.SetValue(Grid.RowProperty, 1);
+            Button.SetValue(Grid.ColumnProperty, 1);
             Grid.Children.Add(Button);
+
             return Grid;
         }