Skip to content

Commit

Permalink
GUI: cleanup About-Window
Browse files Browse the repository at this point in the history
  • Loading branch information
linderd committed Feb 20, 2024
1 parent 091e61d commit 20f5630
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 753 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions QuIDE/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<Version>2.1</Version>
<FileVersion>2.1</FileVersion>
<InformationalVersion>2.1-dev</InformationalVersion>
</PropertyGroup>
</Project>
25 changes: 21 additions & 4 deletions QuIDE/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

686 changes: 6 additions & 680 deletions QuIDE/Properties/Resources.resx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion QuIDE/QuIDE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<!-- for Parser.cs we need an unsafe block for a pointer to get the assemblies in a single-file-app -->
Expand Down
36 changes: 8 additions & 28 deletions QuIDE/ViewModels/Helpers/QubitViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace QuIDE.ViewModels.Helpers;

public class QubitViewModel : ViewModelBase
{
#region Constructor

public QubitViewModel(ComputerModel model, int registerIndex, int rowIndex, DialogManager dialogManager)
{
_model = model;
Expand All @@ -29,20 +27,12 @@ public QubitViewModel(ComputerModel model, int registerIndex, int rowIndex, Dial
_dialogManager = dialogManager;
}

#endregion // Constructor


#region Private Helpers

private void _model_CurrentStepChanged(object sender, EventArgs eventArgs)
{
OnPropertyChanged(nameof(IsEnabled));
}

#endregion // Private Helpers

#region Fields

private readonly ComputerModel _model;

private int _registerIndex;
Expand All @@ -58,10 +48,6 @@ private void _model_CurrentStepChanged(object sender, EventArgs eventArgs)

private readonly DialogManager _dialogManager;

#endregion // Fields


#region Properties

public ICommand ChangeValueCommand
{
Expand Down Expand Up @@ -179,34 +165,30 @@ public VisualBrush QubitImage

public bool IsEnabled => _model.CurrentStep == 0;

#endregion // Properties


#region Public Methods

public void Refresh()
{
OnPropertyChanged(nameof(QubitImage));
}

public void ChangeValue(object parameter)
private void ChangeValue(object parameter)
{
var old = Value;
_model.Registers[_registerIndex].ResetQubit(Index, old);
Value = old == QubitModel.Zero ? QubitModel.One : QubitModel.Zero;
}

public void InsertQubitAbove(object parameter)
private void InsertQubitAbove(object parameter)
{
_model.InsertQubitAbove(_registerIndex, Index);
}

public void InsertQubitBelow(object parameter)
private void InsertQubitBelow(object parameter)
{
_model.InsertQubitBelow(_registerIndex, Index);
}

public async void EditRegister(object parameter)
private async void EditRegister(object parameter)
{
var vm = new NewRegisterInputViewModel();
var input = new NewRegisterInput(vm);
Expand Down Expand Up @@ -237,7 +219,7 @@ await _dialogManager.ShowDialogAsync(input, () =>
});
}

public async void InsertRegisterAbove(object parameter)
private async void InsertRegisterAbove(object parameter)
{
var vm = new NewRegisterInputViewModel();
var input = new NewRegisterInput(vm);
Expand All @@ -249,7 +231,7 @@ await _dialogManager.ShowDialogAsync(input, () =>
});
}

public async void InsertRegisterBelow(object parameter)
private async void InsertRegisterBelow(object parameter)
{
var vm = new NewRegisterInputViewModel();
var input = new NewRegisterInput(vm);
Expand All @@ -261,12 +243,12 @@ await _dialogManager.ShowDialogAsync(input, () =>
});
}

public void DeleteQubit(object parameter)
private void DeleteQubit(object parameter)
{
_model.DeleteQubit(_registerIndex, Index);
}

public void DeleteRegister(object parameter)
private void DeleteRegister(object parameter)
{
_model.DeleteRegister(_registerIndex);
}
Expand Down Expand Up @@ -295,6 +277,4 @@ public void UpdateDeleteQubitCommand(bool canExecute)
_deleteQubit = new DelegateCommand(DeleteQubit, x => canExecute);
OnPropertyChanged(nameof(DeleteQubitCommand));
}

#endregion // Public Methods
}
4 changes: 2 additions & 2 deletions QuIDE/Views/Controls/CircuitGrid.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<Grid x:Name="LayoutRoot" Background="White" PointerWheelChanged="LayoutRoot_PreviewMouseWheel">
<Border Background="White" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1">
<Grid x:Name="mainGrid" Background="White" ColumnDefinitions="Auto,*">
<Grid x:Name="MainGrid" Background="White" ColumnDefinitions="Auto,*">

<ScrollViewer x:Name="RegisterScroll"
HorizontalScrollBarVisibility="Disabled"
Expand All @@ -28,7 +28,7 @@

<!-- Qubit view -->
<StackPanel Orientation="Vertical">
<ItemsControl x:Name="registerItemsControl" Background="White"
<ItemsControl x:Name="RegisterItemsControl" Background="White"
ItemsSource="{Binding Registers}"
Margin="0,0,0,0"
RenderTransformOrigin="0,0">
Expand Down
24 changes: 4 additions & 20 deletions QuIDE/Views/Dialog/AboutWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,13 @@
Title="AboutWindow"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner">
<!-- Icon="/Assets/avalonia-logo.ico"> -->
<!--<UserControl.Resources>
<Style x:Key="DefaultButton" Selector="Button" />
<Style x:Key="FlatButton" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Selector="Button" />
</UserControl.Resources>-->

<DockPanel>
<TextBlock DockPanel.Dock="Top" Text="{x:Static p:Resources.AboutText}" Margin="10" />
<TextBlock DockPanel.Dock="Top" Text="{x:Static p:Resources.Name}" Margin="10" />
<TextBlock DockPanel.Dock="Top" Text="{x:Static p:Resources.Version}" Margin="10" />
<TextBlock DockPanel.Dock="Top" Text="{x:Static p:Resources.Copyright}" Margin="10" />
<TextBlock DockPanel.Dock="Top"
Text="{x:Static p:Resources.Authors}" Margin="10" />
<DockPanel
VerticalAlignment="Stretch"
Margin="10">
<TextBlock DockPanel.Dock="Top" Text="{x:Static p:Resources.License}" Margin="0 5" />
<Border
Background="White"
BorderBrush="DimGray"
BorderThickness="1" Padding="0">
<ScrollViewer Height="700">
<TextBlock
Text="{x:Static p:Resources.GPLText}" Margin="10" />
</ScrollViewer>
</Border>
</DockPanel>
<TextBlock Text="{x:Static p:Resources.GPLText}" Margin="10" />
</DockPanel>
</Window>
18 changes: 0 additions & 18 deletions QuIDE/app.manifest

This file was deleted.

0 comments on commit 20f5630

Please sign in to comment.