Skip to content
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
62 changes: 43 additions & 19 deletions AxialSqlTools/Commands/Dialogs/ExcelExportSuccessDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,62 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
Title="Export Complete"
Height="220"
SizeToContent="Height"
Width="560"
MinHeight="220"
MinHeight="240"
MinWidth="560"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
ShowInTaskbar="False">
<Grid Margin="16">
ShowInTaskbar="False"
Background="{DynamicResource AxialThemeBackgroundBrush}"
Foreground="{DynamicResource AxialThemeForegroundBrush}">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AxialSqlTools;component/Themes/SharedToolWindowTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Grid Background="{DynamicResource AxialThemeBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock FontSize="14" FontWeight="SemiBold" Text="The data has been successfully exported." TextWrapping="Wrap" />
<Border Grid.Row="0" Background="{DynamicResource AxialThemeHeaderBackgroundBrush}" Padding="10,8">
<TextBlock FontSize="14" FontWeight="SemiBold" Text="The data has been successfully exported." TextWrapping="Wrap" />
</Border>

<Grid Grid.Row="1" Margin="16,12,16,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock Grid.Row="1" Margin="0,10,0,0" Text="Saved file:" FontWeight="SemiBold" />
<TextBlock Grid.Row="0" Text="Saved file:" FontWeight="SemiBold" />

<Border Grid.Row="2" Margin="0,6,0,0" Padding="10" BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="4" Background="#FAFAFA">
<TextBox x:Name="FilePathText"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
MinHeight="58" />
</Border>
<Border Grid.Row="1" Margin="0,6,0,0" Padding="10"
BorderBrush="{DynamicResource AxialThemeSubtleBorderBrush}"
BorderThickness="1"
CornerRadius="4"
Background="{DynamicResource AxialThemeButtonBackgroundBrush}">
<TextBox x:Name="FilePathText"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
MinHeight="58" />
</Border>

<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,14,0,0">
<Button Width="95" Margin="0,0,8,0" Click="OpenInExcelButton_Click">Open in Excel</Button>
<Button Width="75" Click="OkButton_Click">OK</Button>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,14,0,0">
<Button Width="110" Margin="0,0,8,0" Click="OpenInExcelButton_Click" IsDefault="True" Style="{DynamicResource AxialPrimaryButtonStyle}">Open in Excel</Button>
<Button Width="75" Click="OkButton_Click" IsCancel="True">OK</Button>
</StackPanel>
</Grid>
</Grid>
</Window>
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,24 @@ namespace AxialSqlTools
{
public partial class ExcelExportSuccessDialog : Window
{
private readonly ToolWindowThemeController _themeController;
private readonly string filePath;

public ExcelExportSuccessDialog(string filePath)
{
InitializeComponent();

_themeController = new ToolWindowThemeController(this, ApplyThemeBrushResources);

this.filePath = filePath ?? string.Empty;
FilePathText.Text = this.filePath;
}

private void ApplyThemeBrushResources()
{
ToolWindowThemeResources.ApplySharedTheme(this);
}

private void OpenInExcelButton_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))
Expand Down
49 changes: 38 additions & 11 deletions AxialSqlTools/GridToEmail/ToolWindowGridToEmailControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
mc:Ignorable="d"
Name="MyToolWindow"
FontSize="14">
<Grid >
Background="{DynamicResource AxialThemeBackgroundBrush}"
Foreground="{DynamicResource AxialThemeForegroundBrush}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AxialSqlTools;component/Themes/SharedToolWindowTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid Background="{DynamicResource AxialThemeBackgroundBrush}">
<StackPanel Orientation="Vertical" >
<StackPanel Orientation="Horizontal" Background="#FFB4B4B4">
<StackPanel Orientation="Horizontal" Background="{DynamicResource AxialThemeHeaderBackgroundBrush}">
<TextBlock Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="18">Export the grid to a file and send it via email</TextBlock>
<TextBlock Margin="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Run Text="Feature description in"/>
<Hyperlink
NavigateUri="https://github.com/Axial-SQL/AxialSqlTools/wiki/Export-Grid-to-Email"
RequestNavigate="buttonWikiPage_Click">
<Run Text="Wiki"/>
</Hyperlink>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Margin="5">
Expand All @@ -24,7 +40,17 @@
<StackPanel Orientation="Horizontal" Margin="5,5,5,5">
<Label Content="From:" Width="80" />

<ComboBox x:Name="EmailServerOptions" FontWeight="Bold">
<ComboBox x:Name="EmailServerOptions" FontWeight="Bold" Foreground="{DynamicResource AxialThemeForegroundBrush}">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource AxialThemeTabHeaderSelectedBrush}" />
<Setter Property="Foreground" Value="{DynamicResource AxialThemeForegroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
<CheckBox Name="CheckBox_CCMyself" VerticalAlignment="Center" HorizontalAlignment="Center" Content="CC myself" Margin="10,0,0,0"/>
</StackPanel>
Expand Down Expand Up @@ -65,14 +91,15 @@
Padding="1"
UseLayoutRounding="False"
Width="94.591"
FontWeight="Bold">
FontWeight="Bold"
Style="{DynamicResource AxialPrimaryButtonStyle}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image
Source="pack://application:,,,/AxialSqlTools;component/Resources/send.png"
Width="16"
Height="16"
Margin="0,0,4,0"/>
<TextBlock Text="Send" VerticalAlignment="Center"/>
<Rectangle Width="16" Height="16" Margin="0,0,4,0" Fill="{DynamicResource AxialThemePrimaryButtonForegroundBrush}">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="pack://application:,,,/AxialSqlTools;component/Resources/send.png" Stretch="Uniform" />
</Rectangle.OpacityMask>
</Rectangle>
<TextBlock Text="Send" VerticalAlignment="Center" Foreground="{DynamicResource AxialThemePrimaryButtonForegroundBrush}"/>
</StackPanel>
</Button>

Expand Down
13 changes: 13 additions & 0 deletions AxialSqlTools/GridToEmail/ToolWindowGridToEmailControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Navigation;
using static AxialSqlTools.AxialSqlToolsPackage;


Expand All @@ -22,6 +23,7 @@
/// </summary>
public partial class ToolWindowGridToEmailControl : UserControl
{
private readonly ToolWindowThemeController _themeController;

private ScriptFactoryAccess.ConnectionInfo connectionInfo;
private string exportedFilename;
Expand Down Expand Up @@ -140,6 +142,12 @@ public override string ToString()
public ToolWindowGridToEmailControl()
{
this.InitializeComponent();
_themeController = new ToolWindowThemeController(this, ApplyThemeBrushResources);
}

private void ApplyThemeBrushResources()
{
ToolWindowThemeResources.ApplySharedTheme(this);
}

public void PrepareFormParameters()
Expand Down Expand Up @@ -542,6 +550,11 @@ private void RecipientAddressOptions_SelectionChanged(object sender, SelectionCh

}

private void buttonWikiPage_Click(object sender, RequestNavigateEventArgs e)
{
ToolWindowNavigation.HandleRequestNavigate(e);
}


}
}
33 changes: 26 additions & 7 deletions AxialSqlTools/Themes/SharedToolWindowTheme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

<Style TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="{DynamicResource AxialThemeForegroundBrush}" />
<Setter Property="Background" Value="{DynamicResource AxialThemeBackgroundBrush}" />
<Setter Property="Background" Value="{DynamicResource AxialThemeButtonBackgroundBrush}" />
<Setter Property="Padding" Value="6,3" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
Expand All @@ -139,16 +139,19 @@
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="ItemBorder"
Background="{TemplateBinding Background}"
TextElement.Foreground="{TemplateBinding Foreground}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource AxialThemeButtonHoverBrush}" />
<Setter Property="Foreground" Value="{DynamicResource AxialThemeForegroundBrush}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="{DynamicResource AxialThemeTabHeaderSelectedBrush}" />
<Setter Property="Foreground" Value="{DynamicResource AxialThemeForegroundBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -158,9 +161,10 @@

<Style TargetType="ComboBox">
<Setter Property="BorderBrush" Value="{DynamicResource AxialThemeBorderBrush}" />
<Setter Property="Background" Value="{DynamicResource AxialThemeBackgroundBrush}" />
<Setter Property="Background" Value="{DynamicResource AxialThemeButtonBackgroundBrush}" />
<Setter Property="Foreground" Value="{DynamicResource AxialThemeForegroundBrush}" />
<Setter Property="Padding" Value="4,2" />
<Setter Property="MaxDropDownHeight" Value="300" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
Expand All @@ -178,12 +182,13 @@
<ContentPresenter Margin="6,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
IsHitTestVisible="False"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" />

<Border Grid.Column="1"
Background="{DynamicResource AxialThemeBackgroundBrush}"
Background="{DynamicResource AxialThemeButtonBackgroundBrush}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1,0,0,0">
<Path HorizontalAlignment="Center"
Expand All @@ -194,17 +199,31 @@
</Grid>
</Border>

<ToggleButton Grid.ColumnSpan="2"
Focusable="False"
Background="Transparent"
BorderThickness="0"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent" BorderThickness="0" />
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>

<Popup x:Name="PART_Popup"
Placement="Bottom"
PlacementTarget="{Binding ElementName=ComboBorder}"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Slide">
<Border Background="{DynamicResource AxialThemeBackgroundBrush}"
<Border Background="{DynamicResource AxialThemeButtonBackgroundBrush}"
BorderBrush="{DynamicResource AxialThemeBorderBrush}"
BorderThickness="1">
<ScrollViewer>
<ItemsPresenter />
BorderThickness="1"
MinWidth="{Binding ActualWidth, ElementName=ComboBorder}">
<ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Border>
</Popup>
Expand Down