Skip to content

Fix added styles #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/UrhoSharp.Editor/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/View/Styles/Dark.xaml"/>
<ResourceDictionary Source="pack://application:,,,/View/Styles/WinStyle/WinStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
5 changes: 5 additions & 0 deletions src/UrhoSharp.Editor/UrhoSharp.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\Styles\WinStyle\WinStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
Expand Down Expand Up @@ -337,6 +341,7 @@
<EmbeddedResource Include="Icons\unknown.png" />
<EmbeddedResource Include="Icons\xml.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\UrhoSharp.1.9.67\build\net45\UrhoSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
2 changes: 1 addition & 1 deletion src/UrhoSharp.Editor/View/EditorWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<MenuItem Header="Styles" x:Name="MenuStyles"/>
</MenuItem>
</Menu>
<ToolBar Grid.Row="1" />
<ToolBar Grid.Row="1" Background="{DynamicResource MainBGcolor}"/>
<Grid Grid.Row="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
Expand Down
10 changes: 6 additions & 4 deletions src/UrhoSharp.Editor/View/EditorWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ public EditorWindow()
MenuStyles.Click += SetStyle;
}

ResourceDictionary mainStyle = new ResourceDictionary() {Source = new Uri(@"View\Styles\WinStyle\WinStyle.xaml", UriKind.Relative) };
private void SetStyle(object sender, RoutedEventArgs e) {
if( e.OriginalSource is System.Windows.Controls.MenuItem mi) {
ResourceDictionary dir = new ResourceDictionary() {
Source = new Uri(@"View\Styles\" + mi.Header.ToString()+".xaml",UriKind.Relative)
ResourceDictionary dir = new ResourceDictionary() {
Source = new Uri(@"View\Styles\" + mi.Header.ToString() + ".xaml", UriKind.Relative)
};

System.Windows.Application.Current.Resources.MergedDictionaries.Clear();
System.Windows.Application.Current.Resources.Clear();
//System.Windows.Application.Current.Resources.Remove(System.Windows.Application.Current.Resources.MergedDictionaries[0]);
System.Windows.Application.Current.Resources.MergedDictionaries.Add(dir);
System.Windows.Application.Current.Resources.MergedDictionaries.Add(mainStyle);

}

Expand Down
2 changes: 1 addition & 1 deletion src/UrhoSharp.Editor/View/HierarchyView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type viewModel:NodeViewModel}"
ItemsSource="{Binding Path=Children}">
<TextBlock Text="{Binding Name}">
<TextBlock Text="{Binding Name}" Foreground="{DynamicResource FontColor}">
<TextBlock.ContextMenu>
<ContextMenu>
<!--<MenuItem Header="Open Folder in File Explorer"
Expand Down
4 changes: 2 additions & 2 deletions src/UrhoSharp.Editor/View/PropertiesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ColumnDefinition Width="3px"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Name}" Foreground="{DynamicResource FontColor}"/>
<CheckBox Grid.Column="3" MinWidth="100" IsChecked="{Binding Value}" Grid.Row="{Binding Index}" />
</Grid>
</DataTemplate>
Expand All @@ -48,7 +48,7 @@
<ColumnDefinition Width="3px"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Name}" Foreground="{DynamicResource FontColor}"/>
<TextBox Grid.Column="2" MinWidth="100" Text="{Binding Value}" Grid.Row="{Binding Index}" />
</Grid>
</DataTemplate>
Expand Down
19 changes: 8 additions & 11 deletions src/UrhoSharp.Editor/View/Styles/Dark.xaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UrhoSharp.Editor.View.Styles">
<ResourceDictionary x:Name="Dark" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="MainBGcolor" Color="Black"/>
<SolidColorBrush x:Key="FontColor" Color="#FFDEDFE0"/>
<SolidColorBrush x:Key="TittleBarcolor" Color="#FF181819"/>
<SolidColorBrush x:Key="MainBGcolor" Color="#FF181819"/>
<SolidColorBrush x:Key="FontColor" Color="#FFEDF8FF"/>
<SolidColorBrush x:Key="StatuSBarColor" Color="#007ACC"/>
<SolidColorBrush x:Key="SplitterColor" Color="#FF2B3A7C"/>


<Style TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="#FF0C4F7C"/>
</Style>




</ResourceDictionary>
11 changes: 5 additions & 6 deletions src/UrhoSharp.Editor/View/Styles/Gray.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UrhoSharp.Editor.View.Styles">
<ResourceDictionary x:Name="Gray" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="TittleBarcolor" Color="#FF181819"/>
<SolidColorBrush x:Key="MainBGcolor" Color="Gray"/>
<SolidColorBrush x:Key="FontColor" Color="DarkBlue"/>
<SolidColorBrush x:Key="StatuSBarColor" Color="Black"/>
<SolidColorBrush x:Key="SplitterColor" Color="Black"/>


<Style TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="Black"/>
</Style>

</ResourceDictionary>
10 changes: 4 additions & 6 deletions src/UrhoSharp.Editor/View/Styles/White.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UrhoSharp.Editor.View.Styles">
<ResourceDictionary x:Name="White" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<SolidColorBrush x:Key="TittleBarcolor" Color="#FF181819"/>
<SolidColorBrush x:Key="MainBGcolor" Color="White"/>
<SolidColorBrush x:Key="FontColor" Color="Black"/>
<SolidColorBrush x:Key="StatuSBarColor" Color="Gray"/>
<SolidColorBrush x:Key="SplitterColor" Color="Black"/>

<Style TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="Black"/>

</Style>
</ResourceDictionary>
123 changes: 123 additions & 0 deletions src/UrhoSharp.Editor/View/Styles/WinStyle/WinStyle.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<ResourceDictionary
x:Class="WinStyles.DarkdWindow.DarkStyle"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


<Style TargetType="{x:Type MenuItem}">
<Setter Property="Foreground" Value="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Menu}}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="Col0" MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
<ColumnDefinition x:Name="Col3" Width="14"/>
</Grid.ColumnDefinitions>

<ContentPresenter Grid.Column="0" Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>

<Grid Grid.Column="0" Visibility="Hidden" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center">
<Path x:Name="GlyphPanelpath" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z" FlowDirection="LeftToRight"/>
</Grid>

<ContentPresenter Grid.Column="1" Margin="{TemplateBinding Padding}"
x:Name="HeaderHost" RecognizesAccessKey="True"
ContentSource="Header"/>

<ContentPresenter Grid.Column="2" Margin="8,1,8,1"
x:Name="IGTHost" ContentSource="InputGestureText"
VerticalAlignment="Center"/>

<Grid Grid.Column="3" Margin="4,0,6,0" x:Name="ArrowPanel" VerticalAlignment="Center">
<Path x:Name="ArrowPanelPath" HorizontalAlignment="Right" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,0 L0,8 L4,4 z"/>
</Grid>

<Popup IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" x:Name="SubMenuPopup" Focusable="false" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
<Border x:Name="SubMenuBorder" BorderBrush="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Menu}}}" BorderThickness="1" Padding="2,2,2,2">
<Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Grid>
</Border>
</Popup>
</Grid>
</Border>

<ControlTemplate.Triggers>
<Trigger Property="Role" Value="TopLevelHeader">
<Setter Property="Padding" Value="6,1,6,1"/>
<Setter Property="Placement" Value="Bottom" TargetName="SubMenuPopup"/>
<Setter Property="MinWidth" Value="0" TargetName="Col0"/>
<Setter Property="Width" Value="Auto" TargetName="Col3"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="GlyphPanel"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="IGTHost"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>

<Trigger Property="Role" Value="TopLevelItem">
<Setter Property="Padding" Value="6,1,6,1"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>

<Trigger Property="Role" Value="SubmenuHeader">
<Setter Property="DockPanel.Dock" Value="Top"/>
<Setter Property="Padding" Value="0,2,0,2"/>
</Trigger>

<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="DockPanel.Dock" Value="Top"/>
<Setter Property="Padding" Value="0,2,0,2"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
<Setter Property="PopupAnimation" Value="None" TargetName="SubMenuPopup"/>
</Trigger>

<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
</Trigger>

<Trigger Property="IsChecked" Value="true">
<Setter Property="Visibility" Value="Visible" TargetName="GlyphPanel"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
</Trigger>

<Trigger Property="IsHighlighted" Value="true">
<Setter Property="Background" Value="#FF606680" TargetName="Border"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>

<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="LightGray"/>
</Trigger>

</ControlTemplate.Triggers>
</ControlTemplate>

</Setter.Value>
</Setter>
</Style>

<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{DynamicResource TittleBarcolor}"/>
<Setter Property="Foreground" Value="White"/>
</Style>

<Style TargetType="{x:Type GridSplitter}">
<Setter Property="Background" Value="{DynamicResource SplitterColor}"/>
</Style>

<!--<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background" Value="{DynamicResource MainBGcolor}"/>
<Setter Property="Foreground" Value="{DynamicResource FontColor}"/>
</Style>-->


</ResourceDictionary>