Skip to content

Commit

Permalink
Add top menu border, Add tray icon doubleclick
Browse files Browse the repository at this point in the history
  • Loading branch information
popcatalin81 committed May 7, 2020
1 parent 5ba885c commit 97c2c6a
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 181 deletions.
2 changes: 2 additions & 0 deletions QBTracker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
ContextMenu="{StaticResource TrayMenu}"
MenuActivation="LeftOrRightClick"
PopupActivation="DoubleClick"
DoubleClickCommand="{x:Static SystemCommands.RestoreWindowCommand}"
DoubleClickCommandTarget="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
LeftClickCommand="{x:Static SystemCommands.RestoreWindowCommand}"
LeftClickCommandTarget="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
/>
Expand Down
81 changes: 43 additions & 38 deletions QBTracker/Views/ExportView.xaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
<UserControl x:Class="QBTracker.Views.ExportView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:QBTracker.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:viewModels="clr-namespace:QBTracker.ViewModels"
xmlns:converters="clr-namespace:QBTracker.Converters"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="694" d:DesignWidth="410">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="60"/>
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
<RowDefinition Height="60"/>
<RowDefinition Height="*"/>
<RowDefinition Height="60" />
<RowDefinition Height="60" />
<RowDefinition Height="42" />
<RowDefinition Height="42" />
<RowDefinition Height="60" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Button
Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
Command="{Binding GoBack}"
VerticalAlignment="Center" HorizontalAlignment="Left"
IsCancel="True"
Margin="10">
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Margin="60,0" Foreground="{StaticResource MaterialDesignBody}"
Style="{StaticResource MaterialDesignSubtitle1TextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center">
Export to Excel
</TextBlock>
<Button Grid.Row="0" Grid.Column="1"
Margin="10"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
ToolTip="Export to Excel"
Command="{Binding ExportCommand}" >
<materialDesign:PackIcon Kind="TableExport" Width="22" Height="22"/>
</Button>
<Border Grid.Row="0" Grid.Column="0" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button
Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
Command="{Binding GoBack}"
VerticalAlignment="Center" HorizontalAlignment="Left"
IsCancel="True"
Margin="10">
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Margin="60,0" Foreground="{StaticResource MaterialDesignBody}"
Style="{StaticResource MaterialDesignSubtitle1TextBlock}" VerticalAlignment="Center"
HorizontalAlignment="Center">
Export to Excel
</TextBlock>
<Button Grid.Row="0" Grid.Column="1"
Margin="10"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
ToolTip="Export to Excel"
Command="{Binding ExportCommand}">
<materialDesign:PackIcon Kind="TableExport" Width="22" Height="22" />
</Button>
</Grid>
</Border>
<DatePicker Grid.Row="1" Grid.Column="0" Margin="10,0,0,0"
Width="140"
HorizontalAlignment="Left"
Expand All @@ -58,7 +63,7 @@
SelectedDate="{Binding EndDate}"
Style="{StaticResource MaterialDesignFloatingHintDatePicker}" />
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
Orientation="Horizontal">
Orientation="Horizontal">
<RadioButton
Style="{StaticResource MaterialDesignDarkRadioButton}"
Margin="10"
Expand All @@ -76,7 +81,7 @@
Content="Round to 30 min" />
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
Orientation="Horizontal"
Orientation="Horizontal"
IsEnabled="{Binding ExportSettings.NoRounding, Converter={StaticResource InverterConverter}}">
<RadioButton
Style="{StaticResource MaterialDesignDarkRadioButton}"
Expand All @@ -90,4 +95,4 @@
Content="Ceiling Rounding" />
</StackPanel>
</Grid>
</UserControl>
</UserControl>
65 changes: 30 additions & 35 deletions QBTracker/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,61 +17,56 @@
<RowDefinition Height="80" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100*" />
</Grid.ColumnDefinitions>
<Grid
Grid.Row="0"
Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
<Border Grid.Row="0" Grid.Column="0" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Select today"
Command="{Binding SelectToday}">
<materialDesign:PackIcon Kind="CalendarToday" />
</Button>
<Button Grid.Column="1"
<materialDesign:PackIcon Kind="CalendarToday" />
</Button>
<Button Grid.Column="1"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Select previous day"
Command="{Binding DateStepBack}">
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<DatePicker Grid.Column="2"
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<DatePicker Grid.Column="2"
SelectedDate="{Binding SelectedDate}"
Width="120"
materialDesign:HintAssist.Hint="Pick Date"
Style="{StaticResource MaterialDesignFloatingHintDatePicker}" VerticalAlignment="Center"
HorizontalAlignment="Center" Height="35" />
<Button Grid.Column="3"
<Button Grid.Column="3"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Select next day"
Command="{Binding DateStepForward}">
<materialDesign:PackIcon Kind="StepForward" />
</Button>
<Button Grid.Column="6"
<materialDesign:PackIcon Kind="StepForward" />
</Button>
<Button Grid.Column="6"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Export to Excel"
Command="{Binding ExportCommand}" HorizontalAlignment="Right">
<materialDesign:PackIcon Kind="TableExport" />
</Button>
<Button Grid.Column="7"
<materialDesign:PackIcon Kind="TableExport" />
</Button>
<Button Grid.Column="7"
Style="{StaticResource MaterialDesignIconButton}"
ToolTip="Settings"
Command="{Binding SettingsCommand}" HorizontalAlignment="Right">
<materialDesign:PackIcon Kind="Settings" />
</Button>
</Grid>
</Grid>
<materialDesign:PackIcon Kind="Settings" />
</Button>
</Grid>
</Border>

<ItemsControl
Grid.Row="1"
Expand Down
42 changes: 24 additions & 18 deletions QBTracker/Views/ProjectView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@
<RowDefinition Height="60" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button
Grid.Row="0"
Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
Command="{Binding GoBack}"
IsCancel="True"
VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="10">
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<TextBlock Grid.Row="0" Grid.Column="0"
Margin="60,0" Foreground="{StaticResource MaterialDesignBody}"
Style="{StaticResource MaterialDesignSubtitle1TextBlock}" VerticalAlignment="Center" HorizontalAlignment="Center">
Manage projects
</TextBlock>
<Border Grid.Row="0" Grid.Column="0" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="0 0 0 1">
<Grid>
<Button
Grid.Row="0"
Style="{DynamicResource MaterialDesignFloatingActionMiniButton}"
Command="{Binding GoBack}"
IsCancel="True"
VerticalAlignment="Center" HorizontalAlignment="Left"
Margin="10">
<materialDesign:PackIcon Kind="StepBackward" />
</Button>
<TextBlock Grid.Row="0" Grid.Column="0"
Margin="60,0" Foreground="{StaticResource MaterialDesignBody}"
Style="{StaticResource MaterialDesignSubtitle1TextBlock}" VerticalAlignment="Center"
HorizontalAlignment="Center">
Manage projects
</TextBlock>
</Grid>
</Border>
<TextBox
Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
Grid.Row="1"
Expand Down Expand Up @@ -66,14 +71,14 @@
<ColumnDefinition SharedSizeGroup="DeleteButton" Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel HorizontalAlignment="Stretch"
Margin="8 0 0 0"
Grid.Column="0">
Margin="8 0 0 0"
Grid.Column="0">
<TextBlock FontWeight="Bold" Text="{Binding Name}" />
<TextBlock Text="{Binding Stats}" />
</StackPanel>
<Button Grid.Column="1" Margin="1" Width="20" Height="20"
Style="{StaticResource MaterialDesignFloatingActionMiniAccentButton}"
ToolTip="Delete Project"
ToolTip="Delete Project"
Command="{Binding DeleteCommand}">
<materialDesign:PackIcon
Kind="Delete"
Expand All @@ -86,7 +91,8 @@
</ItemsControl.ItemTemplate>
<ItemsControl.Template>
<ControlTemplate>
<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="Auto">
<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}"
VerticalScrollBarVisibility="Auto">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
Expand Down
Loading

0 comments on commit 97c2c6a

Please sign in to comment.