Skip to content
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

style: improve UserControls design #1324

Open
wants to merge 4 commits 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
2 changes: 1 addition & 1 deletion src/Notepads/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<ResourceDictionary Source="Notepads.Controls/Themes/Generic.xaml" />
<ResourceDictionary Source="Controls/TextEditor/TextEditorCore.xaml" />
<ResourceDictionary Source="Controls/FindAndReplace/FindAndReplacePlaceholder.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/DismissButtonStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/TransparentButtonStyle.xaml" />
<ResourceDictionary Source="Resource/TransparentTextBoxStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/CustomSplitViewStyle.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resource/InAppNotificationNoDismissButton.xaml"></ResourceDictionary>
Expand Down
124 changes: 52 additions & 72 deletions src/Notepads/Controls/DiffViewer/SideBySideDiffViewer.xaml
Original file line number Diff line number Diff line change
@@ -1,116 +1,96 @@
<UserControl
x:Class="Notepads.Controls.DiffViewer.SideBySideDiffViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource SystemControlForegroundTransparentBrush}">
<UserControl x:Class="Notepads.Controls.DiffViewer.SideBySideDiffViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
Opacity="0.25"
Color="White"/>
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
Opacity="0.35"
Color="LightGray"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
Opacity="0.15"
Color="Black"/>
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
Opacity="0.2"
Color="Black"/>
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{StaticResource SystemAltHighColor}" Opacity="0.2" />
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{StaticResource SystemAltHighColor}" Opacity="0.15" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{StaticResource SystemBaseHighColor}" Opacity="0.05" />
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{StaticResource SystemAltHighColor}" Opacity="0.25" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush"
Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush"
Color="{ThemeResource SystemColorHighlightColor}"/>
<SolidColorBrush x:Key="HeaderBackgroundThemeBrush" Color="{ThemeResource SystemColorWindowColor}" />
<SolidColorBrush x:Key="RightBoxBackgroundThemeBrush" Color="{ThemeResource SystemColorWindowColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>

</UserControl.Resources>

<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Grid Column="0">

<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto" MinHeight="24" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
<TextBlock Grid.Row="0"
x:Uid="DiffViewer_Header_OldTextTittle"
FontStyle="Italic"
HorizontalAlignment="Center"
VerticalAlignment="Center">
</TextBlock>
<Grid Grid.Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
<Button x:Name="DismissButton"
VerticalAlignment="Center"
HorizontalAlignment="Left"
IsTabStop="False"
x:Uid="FindAndReplace_DismissButton"
Style="{StaticResource TransparentButtonStyle}"
Width="42"
Padding="0"
Height="25"
Width="32"
FontSize="12"
Style="{StaticResource DismissButtonStyle}"
Content="&#xE894;"
FontFamily="Segoe MDL2 Assets">
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
IsTabStop="False">
<FontIcon FontSize="12" Glyph="&#xE894;" />
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="Escape"/>
<KeyboardAccelerator Key="Escape" />
</Button.KeyboardAccelerators>
</Button>
<TextBlock x:Uid="DiffViewer_Header_OldTextTittle"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontStyle="Italic"
d:Text="Before your changes" />
</Grid>

<ScrollViewer Name="LeftScroller"
Grid.Row="1"
IsTabStop="False"
Padding="6, 0, 8, 6"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
Grid.Row="1"
Padding="6,0,8,6"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"
IsTabStop="False">
<Border Name="LeftTextBlockBorder" Background="Transparent">
<RichTextBlock Name="LeftTextBlock"
FontFamily="Consolas"/>
<RichTextBlock Name="LeftTextBlock" FontFamily="Consolas" />
</Border>
</ScrollViewer>
</Grid>

<Grid Column="1" Background="{ThemeResource RightBoxBackgroundThemeBrush}">

<Grid Grid.Column="1" Background="{ThemeResource RightBoxBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto" MinHeight="24" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Grid Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
<TextBlock Grid.Row="0"
x:Uid="DiffViewer_Header_NewTextTittle"
FontStyle="Italic"
<Grid Grid.Row="0" Background="{ThemeResource HeaderBackgroundThemeBrush}">
<TextBlock x:Uid="DiffViewer_Header_NewTextTittle"
HorizontalAlignment="Center"
VerticalAlignment="Center">
</TextBlock>
VerticalAlignment="Center"
FontStyle="Italic"
d:Text="After your changes" />
</Grid>

<ScrollViewer Name="RightScroller"
Grid.Row="1"
IsTabStop="False"
Padding="6, 0, 8, 6"
Padding="6,0,8,6"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
VerticalScrollBarVisibility="Auto"
IsTabStop="False">
<Border Name="RightTextBlockBorder" Background="Transparent">
<RichTextBlock Name="RightTextBlock"
FontFamily="Consolas"/>
<RichTextBlock Name="RightTextBlock" FontFamily="Consolas" />
</Border>
</ScrollViewer>
</Grid>
Expand Down
Loading
Loading