Browse Source

Merge branch 'master' into issues/3089

Jumar Macato 6 years ago
parent
commit
d850f0b072

+ 4 - 4
readme.md

@@ -8,9 +8,9 @@
 
 ## About
 
-**Avalonia** is a WPF/UWP-inspired cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows (.NET Framework, .NET Core), Linux (via Xorg), MacOS and with experimental support for Android and iOS.
+**Avalonia** is a WPF/UWP-inspired cross-platform XAML-based UI framework providing a flexible styling system and supporting a wide range of Operating Systems such as Windows (.NET Framework, .NET Core), Linux (via Xorg), macOS and with experimental support for Android and iOS.
 
-**Avalonia** is ready for **General-Purpose Desktop App Development**. However there may be some bugs and breaking changes as we continue along into this project's development. To see the status for some of our features, please see our [Roadmap here](https://github.com/AvaloniaUI/Avalonia/issues/2239).
+**Avalonia** is ready for **General-Purpose Desktop App Development**. However, there may be some bugs and breaking changes as we continue along into this project's development. To see the status of some of our features, please see our [Roadmap here](https://github.com/AvaloniaUI/Avalonia/issues/2239).
 
 | Control catalog | Desktop platforms | Mobile platforms |
 |---|---|---|
@@ -20,11 +20,11 @@
 
 Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started. After installing it, open "New Project" dialog in Visual Studio, choose "Avalonia" in "Visual C#" section, select "Avalonia .NET Core Application" and press OK (<a href="http://avaloniaui.net/docs/quickstart/images/new-project-dialog.png">screenshot</a>). Now you can write code and markup that will work on multiple platforms!
 
-For those without Visual Studio, starter guide for .NET Core CLI can be found [here](http://avaloniaui.net/docs/quickstart/create-new-project#net-core).
+For those without Visual Studio, a starter guide for .NET Core CLI can be found [here](http://avaloniaui.net/docs/quickstart/create-new-project#net-core).
 
 Avalonia is delivered via <b>NuGet</b> package manager. You can find the packages here: ([stable(ish)](https://www.nuget.org/packages/Avalonia/), [nightly](https://github.com/AvaloniaUI/Avalonia/wiki/Using-nightly-build-feed))
 
-Use these commands in Package Manager console to install Avalonia manually:
+Use these commands in the Package Manager console to install Avalonia manually:
 ```
 Install-Package Avalonia
 Install-Package Avalonia.Desktop

+ 2 - 1
src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs

@@ -273,7 +273,8 @@ namespace Avalonia.Controls.Platform
 
             if (item.IsTopLevel)
             {
-                if (item.Parent.SelectedItem?.IsSubMenuOpen == true)
+                if (item != item.Parent.SelectedItem &&
+                    item.Parent.SelectedItem?.IsSubMenuOpen == true)
                 {
                     item.Parent.SelectedItem.Close();
                     SelectItemAndAncestors(item);

+ 0 - 8
src/Avalonia.Themes.Default/ContextMenu.xaml

@@ -11,19 +11,11 @@
               BorderThickness="{TemplateBinding BorderThickness}"
               Padding="{TemplateBinding Padding}">
           <ScrollViewer>
-            <Panel>
               <ItemsPresenter Name="PART_ItemsPresenter"
                               Items="{TemplateBinding Items}"
                               ItemsPanel="{TemplateBinding ItemsPanel}"
                               ItemTemplate="{TemplateBinding ItemTemplate}"
                               KeyboardNavigation.TabNavigation="Continue"/>
-              <Rectangle Name="iconSeparator"
-                         Fill="{DynamicResource ThemeControlMidBrush}"
-                         HorizontalAlignment="Left"
-                         IsHitTestVisible="False"
-                         Margin="29,2,0,2"
-                         Width="1"/>
-              </Panel>
           </ScrollViewer>
       </Border>
     </ControlTemplate>

+ 7 - 22
src/Avalonia.Themes.Default/MenuItem.xaml

@@ -4,14 +4,14 @@
   <Style Selector="MenuItem">
     <Setter Property="Background" Value="Transparent"/>
     <Setter Property="BorderThickness" Value="1"/>
-    <Setter Property="Padding" Value="6,0"/>
+    <Setter Property="Padding" Value="6 0"/>
     <Setter Property="Template">
       <ControlTemplate>
         <Border Name="root"
                 Background="{TemplateBinding Background}"
                 BorderBrush="{TemplateBinding BorderBrush}"
                 BorderThickness="{TemplateBinding BorderThickness}">
-          <Grid ColumnDefinitions="22,13,*,20">
+          <Grid ColumnDefinitions="20,5,*,20">
             <ContentPresenter Name="icon"
                               Content="{TemplateBinding Icon}"
                               Width="16"
@@ -50,20 +50,12 @@
               <Border Background="{TemplateBinding Background}"
                       BorderBrush="{DynamicResource ThemeBorderMidBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}">
-                <ScrollViewer>
-                  <Panel>
+                <ScrollViewer>                  
                     <ItemsPresenter Name="PART_ItemsPresenter"
                                     Items="{TemplateBinding Items}"
                                     ItemsPanel="{TemplateBinding ItemsPanel}"
                                     ItemTemplate="{TemplateBinding ItemTemplate}"
-                                    Margin="2"/>
-                    <Rectangle Name="iconSeparator"
-                               Fill="{DynamicResource ThemeControlMidBrush}"
-                               HorizontalAlignment="Left"
-                               IsHitTestVisible="False"
-                               Margin="29,2,0,2"
-                               Width="1"/>
-                  </Panel>
+                                    Margin="4 2"/>                                      
                 </ScrollViewer>
               </Border>
             </Popup>
@@ -77,13 +69,14 @@
     <Setter Property="Template">
       <ControlTemplate>
         <Separator Background="{DynamicResource ThemeControlMidBrush}"
-                   Margin="29,1,0,1"
+                   Margin="20,1,0,1"
                    Height="1"/>
       </ControlTemplate>
     </Setter>
   </Style>
 
   <Style Selector="Menu > MenuItem">
+    <Setter Property="Padding" Value="6 0"/>
     <Setter Property="Template">
       <ControlTemplate>
         <Border Name="root"
@@ -108,19 +101,11 @@
                       BorderBrush="{DynamicResource ThemeBorderMidBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}">
                 <ScrollViewer>
-                  <Panel>
-                    <ItemsPresenter Name="PART_ItemsPresenter"
+                  <ItemsPresenter Name="PART_ItemsPresenter"
                                     Items="{TemplateBinding Items}"
                                     ItemsPanel="{TemplateBinding ItemsPanel}"
                                     ItemTemplate="{TemplateBinding ItemTemplate}"
                                     Margin="2"/>
-                    <Rectangle Name="iconSeparator"
-                               Fill="{DynamicResource ThemeControlMidBrush}"
-                               HorizontalAlignment="Left"
-                               IsHitTestVisible="False"
-                               Margin="29,2,0,2"
-                               Width="1"/>
-                  </Panel>
                 </ScrollViewer>
               </Border>
             </Popup>