diff --git a/samples/TestApplication/GalleryStyle.cs b/samples/TestApplication/GalleryStyle.cs index 3497275772..15cbb5749b 100644 --- a/samples/TestApplication/GalleryStyle.cs +++ b/samples/TestApplication/GalleryStyle.cs @@ -27,7 +27,7 @@ namespace TestApplication } }, - new Style(s => s.Class(":container").OfType().Child().Child().Child().Child().OfType()) + new Style(s => s.Class(":container").OfType().Child().Child().Child().Child().Child().OfType()) { Setters = new[] { @@ -35,7 +35,7 @@ namespace TestApplication } }, - new Style(s => s.Class(":container").Child().Child().Child().Child().OfType()) + new Style(s => s.Name("internalStrip").OfType().Child().OfType()) { Setters = new[] { @@ -44,7 +44,7 @@ namespace TestApplication } }, - new Style(s => s.Class(":container").Child().Child().Child().Child().OfType().Class("selected")) + new Style(s => s.Name("internalStrip").OfType().Child().OfType().Class("selected")) { Setters = new[] { @@ -90,15 +90,18 @@ namespace TestApplication { new Border { - Width = 170, - Background = SolidColorBrush.Parse("#373749"), - Child = new TabStrip + Width = 190, + Background = SolidColorBrush.Parse("#1976D2"), + Child = new ScrollViewer { - ItemsPanel = new FuncTemplate(() => new StackPanel { Orientation = Orientation.Vertical, Gap = 4 }), - Margin = new Thickness(0, 10, 0, 0), - Name = "containerTabStrip", - [!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty], - [!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty], + Content = new TabStrip + { + ItemsPanel = new FuncTemplate(() => new StackPanel { Orientation = Orientation.Vertical, Gap = 4 }), + Margin = new Thickness(0, 10, 0, 0), + Name = "internalStrip", + [!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty], + [!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty], + } } }, new Deck diff --git a/samples/TestApplication/Program.cs b/samples/TestApplication/Program.cs index 85d560a1b7..8bab0b157a 100644 --- a/samples/TestApplication/Program.cs +++ b/samples/TestApplication/Program.cs @@ -155,97 +155,67 @@ namespace TestApplication var result = new TabItem { - Header = "Buttons", + Header = "Button", Content = new StackPanel { + Margin = new Thickness(10), Orientation = Orientation.Vertical, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - Gap = 8, - MinWidth = 120, + Gap = 4, Children = new Controls { - (showDialogButton = new Button - { - Content = "Button", - Command = showDialog, - [ToolTip.TipProperty] = "Hello World!", - }), - new Button + new TextBlock { - Content = "Button", - Background = new SolidColorBrush(0xcc119eda), - [ToolTip.TipProperty] = "Goodbye Cruel World!", + Text = "Button", + FontWeight = FontWeight.Medium, + FontSize = 22, + Foreground = SolidColorBrush.Parse("#212121"), }, - (defaultButton = new Button - { - Content = "Default", - IsDefault = true, - }), - new Button + new TextBlock { - Content = "Disabled", - IsEnabled = false, + Text = "A button control", + FontSize = 14, + Foreground = SolidColorBrush.Parse("#727272"), + Margin = new Thickness(0, 0, 0, 10) }, new Button { - Content = "Disabled", - IsEnabled = false, - Background = new SolidColorBrush(0xcc119eda), - }, - new ToggleButton - { - Content = "Toggle", + Width = 150, + Content = "Button" }, - new ToggleButton + new Button { + Width = 150, Content = "Disabled", IsEnabled = false, }, - new CheckBox - { - Content = "Checkbox", - }, - new RadioButton + new TabControl { - Content = "RadioButton 1", - IsChecked = true, - }, - new RadioButton - { - Content = "RadioButton 2", - }, - } - }, - }; - - defaultButton.Click += (s, e) => - { - defaultButton.Content = ((string)defaultButton.Content == "Default") ? "Clicked" : "Default"; - }; - - showDialog.Subscribe(async _ => - { - var close = ReactiveCommand.Create(); + Margin = new Thickness(0, 20, 0, 0), - var dialog = new Window - { - Content = new StackPanel - { - Width = 200, - Height = 200, - Children = new Controls - { - new Button { Content = "Yes", Command = close, CommandParameter = "Yes" }, - new Button { Content = "No", Command = close, CommandParameter = "No" }, + Items = new [] + { + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "CSHARP" }, + Content = new HtmlLabel + { + Text = "CSHRP CODEZ" + } + }, + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "XAML" }, + Content = new HtmlLabel + { + Text = "XAML CODEZ" + } + } + } } } - }; - - close.Subscribe(x => dialog.Close(x)); - - showDialogButton.Content = await dialog.ShowDialog(); - }); + }, + }; + return result; } @@ -257,7 +227,7 @@ namespace TestApplication .ReadToEnd(); return new TabItem { - Header = "Html", + Header = "HTML Label", Content = new ScrollViewer() { Width = 600, @@ -278,50 +248,99 @@ namespace TestApplication { return new TabItem { - Header = "Text", + Header = "Input", Content = new StackPanel { + Margin = new Thickness(10), Orientation = Orientation.Vertical, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - Gap = 8, - Width = 120, + Gap = 4, Children = new Controls { new TextBlock { - Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.", - TextWrapping = TextWrapping.Wrap, - TextAlignment = TextAlignment.Center, + Text = "Check box", + FontWeight = FontWeight.Medium, + FontSize = 22, + Foreground = SolidColorBrush.Parse("#212121"), }, new TextBlock { - Text = "Italic text.", - FontStyle = FontStyle.Italic, - TextAlignment = TextAlignment.Left, + Text = "A check box control", + FontSize = 14, + Foreground = SolidColorBrush.Parse("#373749"), + Margin = new Thickness(0, 0, 0, 10) }, - new TextBlock + new CheckBox { IsChecked = true, Margin = new Thickness(0, 0, 0, 5), Content = "Checked" }, + new CheckBox { IsChecked = false, Content = "Unchecked" }, + new TabControl { - Text = "Bold text.", - FontWeight = FontWeight.Bold, - TextAlignment = TextAlignment.Right, + Margin = new Thickness(0, 20, 0, 0), + + Items = new [] + { + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "CSHARP" }, + Content = new HtmlLabel + { + Text = "CSHRP CODEZ" + } + }, + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "XAML" }, + Content = new HtmlLabel + { + Text = "XAML CODEZ" + } + } + } }, - new TextBox + new TextBlock { - Text = "A non-wrapping text box. Lorem ipsum dolor sit amet.", - TextWrapping = TextWrapping.NoWrap, + Margin = new Thickness(0, 40, 0, 0), + Text = "Radio button", + FontWeight = FontWeight.Medium, + FontSize = 22, + Foreground = SolidColorBrush.Parse("#373749"), }, - new TextBox + new TextBlock { - AcceptsReturn = true, - Text = "A wrapping text box. " + - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt. " + - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.", - TextWrapping = TextWrapping.Wrap, - MaxHeight = 100, + Text = "A radio button control", + FontSize = 14, + Foreground = SolidColorBrush.Parse("#373749"), + Margin = new Thickness(0, 0, 0, 10) }, + + new RadioButton { IsChecked = true, Margin = new Thickness(0, 0, 0, 5), Content = "Option 1" }, + new RadioButton { IsChecked = false, Content = "Option 2" }, + new RadioButton { IsChecked = false, Content = "Option 3" }, + new TabControl + { + Margin = new Thickness(0, 20, 0, 0), + + Items = new [] + { + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "CSHARP" }, + Content = new HtmlLabel + { + Text = "CSHRP CODEZ" + } + }, + new TabItem + { + Header = new TextBlock { FontWeight = FontWeight.Medium, Text = "XAML" }, + Content = new HtmlLabel + { + Text = "XAML CODEZ" + } + } + } + } } - }, + } }; } diff --git a/src/Perspex.Themes.Default/ButtonStyle.cs b/src/Perspex.Themes.Default/ButtonStyle.cs index fc9f9917a8..fb383100e8 100644 --- a/src/Perspex.Themes.Default/ButtonStyle.cs +++ b/src/Perspex.Themes.Default/ButtonStyle.cs @@ -30,8 +30,8 @@ namespace Perspex.Themes.Default { Setters = new[] { - new Setter(TemplatedControl.BackgroundProperty, new SolidColorBrush(0xffdddddd)), - new Setter(TemplatedControl.BorderBrushProperty, new SolidColorBrush(0xff707070)), + new Setter(TemplatedControl.BackgroundProperty, new SolidColorBrush(0xffaaaaaa)), + new Setter(TemplatedControl.BorderBrushProperty, new SolidColorBrush(0xffaaaaaa)), new Setter(TemplatedControl.BorderThicknessProperty, 2), new Setter(TemplatedControl.ForegroundProperty, new SolidColorBrush(0xff000000)), new Setter(Control.FocusAdornerProperty, new FuncTemplate(FocusAdornerTemplate)), @@ -44,22 +44,15 @@ namespace Perspex.Themes.Default { Setters = new[] { - new Setter(TemplatedControl.BackgroundProperty, new SolidColorBrush(0xffbee6fd)), - new Setter(TemplatedControl.BorderBrushProperty, new SolidColorBrush(0xff3c7fb1)), + new Setter(TemplatedControl.BorderBrushProperty, new SolidColorBrush(0xff888888)), }, }, new Style(x => x.OfType