Skip to content

Commit

Permalink
Merge pull request #36 from SP-SoftFuzz/SCRUM-51-Finishing-Touches
Browse files Browse the repository at this point in the history
Proper fullscreen fix
  • Loading branch information
RespectMathias authored May 16, 2024
2 parents 2a50b3f + e1e0f15 commit 8990af5
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 74 deletions.
20 changes: 14 additions & 6 deletions src/ProfHeat.AUI/Views/DataVisualizerView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
xmlns:vm="using:ProfHeat.AUI.ViewModels"
xmlns:v="using:ProfHeat.AUI.Views"
xmlns:m="using:ProfHeat.Core.Models"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="400" Width="800" Height="400"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="400"
x:Class="ProfHeat.AUI.Views.DataVisualizerView"
x:DataType="vm:DataVisualizerViewModel"
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia">
<DockPanel>
<TabControl DockPanel.Dock="Top" TabStripPlacement="Left" MinHeight="350">
<Grid>
<!-- Define rows in the grid -->
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<!-- TabControl that will take up remaining space -->
<TabControl Grid.Row="0" TabStripPlacement="Left">
<TabItem Header="Costs">
<lvc:CartesianChart Series="{Binding Costs}"
TooltipPosition="Top"
Expand Down Expand Up @@ -62,7 +69,9 @@
DrawMarginFrame="{Binding DrawMarginFrame}"/>
</TabItem>
</TabControl>
<Grid DockPanel.Dock="Bottom" ColumnDefinitions="Auto,Auto,Auto"

<!-- Bottom panel for ComboBox and Buttons -->
<Grid Grid.Row="1" ColumnDefinitions="Auto,Auto,Auto" Margin="0,0,0,10"
VerticalAlignment="Bottom"
HorizontalAlignment="Center">
<ComboBox Grid.Column="0"
Expand All @@ -89,6 +98,5 @@
MinWidth="200"
Margin="10"/>
</Grid>
</DockPanel>
</Grid>
</UserControl>

51 changes: 26 additions & 25 deletions src/ProfHeat.AUI/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:v="using:ProfHeat.AUI.Views"
xmlns:m="using:ProfHeat.Core.Models"
xmlns:ui="using:FluentAvalonia.UI.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Width="800" Height="450"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="ProfHeat.AUI.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
WindowStartupLocation="CenterOwner"
Expand All @@ -15,13 +15,14 @@
Background="Transparent"
PointerPressed="DragWindow_PointerPressed"
Icon="/Assets/Images/Icon.ico"
Title="ProfHeat">
Title="ProfHeat"
Width="800" Height="450">

<Design.DataContext>
<vm:MainWindowViewModel/>
</Design.DataContext>

<Panel>
<Grid>
<ExperimentalAcrylicBorder IsHitTestVisible="False">
<ExperimentalAcrylicBorder.Material>
<ExperimentalAcrylicMaterial
Expand All @@ -31,27 +32,27 @@
MaterialOpacity="0.40" />
</ExperimentalAcrylicBorder.Material>
</ExperimentalAcrylicBorder>

<!-- Tabs -->
<ui:TabView HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsAddTabButtonVisible="False"
CanDragTabs="False"
CanReorderTabs="False"
AllowDropTabs="False"
SelectedIndex="{Binding SelectedTabIndex}">
<!-- OptimizerView -->
<ui:TabViewItem Header="Optimizer"
IsClosable="False">
<v:OptimizerView DataContext="{Binding Optimizer}"/>
</ui:TabViewItem>

<!-- DataVisualizerView -->
<ui:TabViewItem Header="Data Visualizer"
IsClosable="False">
<v:DataVisualizerView DataContext="{Binding DataVisualizer}"/>
</ui:TabViewItem>
</ui:TabView>

</Panel>
<!-- Tabs -->
<ui:TabView HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsAddTabButtonVisible="False"
CanDragTabs="False"
CanReorderTabs="False"
AllowDropTabs="False"
SelectedIndex="{Binding SelectedTabIndex}">
<!-- OptimizerView -->
<ui:TabViewItem Header="Optimizer"
IsClosable="False">
<v:OptimizerView DataContext="{Binding Optimizer}"/>
</ui:TabViewItem>

<!-- DataVisualizerView -->
<ui:TabViewItem Header="Data Visualizer"
IsClosable="False">
<v:DataVisualizerView DataContext="{Binding DataVisualizer}"/>
</ui:TabViewItem>
</ui:TabView>
</Grid>
</Window>

83 changes: 40 additions & 43 deletions src/ProfHeat.AUI/Views/OptimizerView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
xmlns:v="using:ProfHeat.AUI.Views"
xmlns:m="using:ProfHeat.Core.Models"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
Width="800" Height="450"
x:Class="ProfHeat.AUI.Views.OptimizerView"
x:DataType="vm:OptimizerViewModel">

<Grid ColumnDefinitions="Auto, Auto">

<Grid ColumnDefinitions="Auto, *" RowDefinitions="*, Auto">
<!-- Left side panel -->
<StackPanel Grid.Column="0"
Width="200"
Expand All @@ -25,58 +23,57 @@
Content="Import Data"
Command="{Binding ImportDataCommand}" />
<!-- Check Box Items Control -->
<ItemsControl ItemsSource="{Binding CheckBoxItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- Check Box Items-->
<Grid ColumnDefinitions=" Auto, *">
<CheckBox Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Height="45"
Margin="0,20,0,0"
IsChecked="{Binding IsChecked}"
Content="{Binding Name}"/>
<!-- Check Box Image Items -->
<Svg Grid.Column="1"
HorizontalAlignment="Right"
Width="50" Height="50"
Path="{Binding ImagePath}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding CheckBoxItems}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- Check Box Items-->
<Grid ColumnDefinitions="Auto, *">
<CheckBox Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Height="45"
Margin="0,20,0,0"
IsChecked="{Binding IsChecked}"
Content="{Binding Name}"/>
<!-- Check Box Image Items -->
<Svg Grid.Column="1"
HorizontalAlignment="Right"
Width="50" Height="50"
Path="{Binding ImagePath}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>

<!-- Right side panel -->
<Grid Grid.Column="1"
Width="500"
RowDefinitions="Auto, Auto, Auto">
<Grid Grid.Column="1" Margin="10"
RowDefinitions="Auto, *, Auto"
HorizontalAlignment="Right">

<!-- Grid Name Text Block -->
<TextBlock Grid.Row="0"
HorizontalAlignment="Center"
Text="{Binding GridName}"
FontSize="20"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="130,30,0,10" />
Margin="0,30,0,10" />

<!-- Grid Image Image path -->
<Svg Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="300" Width="320"
Margin="0,0,20,0"
Path="{Binding GridImagePath}" />

<!-- Optimize Button -->
<StackPanel Grid.Row="2"
Height="30">
<Button CornerRadius="5"
Margin="0,0,20,30"
Width="140" Height="40"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Content="Optimize"
Command="{Binding OptimizeCommand}" />
</StackPanel>
<Button CornerRadius="5"
HorizontalAlignment="Right"
Grid.Row="2"
Margin="0,20,20,20"
Width="140" Height="40"
Content="Optimize"
Command="{Binding OptimizeCommand}" />
</Grid>
</Grid>
</UserControl>

0 comments on commit 8990af5

Please sign in to comment.