Skip to content

Commit

Permalink
Feat/delegating redesign (#45)
Browse files Browse the repository at this point in the history
* Delegation view refactor;

* Added popup for delegate list item;

* Delegate view Layout done;

* Sorting bakers done;

* CanNextExecute WIP;

* canNextExecute done;

* Delegation confirnation WIP;

* Delegation flow done; Fixed some bugs with usermessages disconnected loop; Components improved;

* Undelegate done;

* Small refactor; Deleted delegationConfirmatioViewModel

* Fix for usermessages; Added TextTrimming to BakerName;

* Updated Avalonia to 0.10.14;

* Bump version to 1.2.11;

* Removed unnecessary file;
  • Loading branch information
k-karuna authored May 16, 2022
1 parent aa0bafd commit d654a69
Show file tree
Hide file tree
Showing 62 changed files with 1,516 additions and 1,309 deletions.
3 changes: 1 addition & 2 deletions App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@
<StyleInclude Source="/Styles/MainWindowStyle.axaml"/>
<StyleInclude Source="/Styles/ChildViewStyle.axaml"/>
<StyleInclude Source="/Styles/ButtonStyle.axaml"/>
<StyleInclude Source="/Styles/RoundedButtonStyle.axaml"/>
<StyleInclude Source="/Controls/RoundedButton.axaml"/>
<StyleInclude Source="/Styles/RadioButtonStyle.axaml"/>
<StyleInclude Source="/Controls/IconButton.axaml"/>
<StyleInclude Source="/Controls/CopyButton.axaml"/>
<StyleInclude Source="/Controls/LinkButton.axaml"/>
<StyleInclude Source="/Controls/SortButton.axaml"/>
<StyleInclude Source="/Styles/CustomComboBoxStyle.axaml"/>
<StyleInclude Source="/Styles/BakersComboBoxStyle.axaml"/>
<StyleInclude Source="/Styles/CustomTextBoxStyle.axaml"/>
<StyleInclude Source="/Styles/AtomexTextBoxStyle.axaml"/>
<StyleInclude Source="/Styles/AmountTextBoxStyle.axaml"/>
Expand Down
21 changes: 9 additions & 12 deletions Atomex.Client.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<UseAppHost>true</UseAppHost>
<ApplicationIcon>Resources/Images/logo_dark_256x256.ico</ApplicationIcon>

<AssemblyVersion>1.2.10</AssemblyVersion>
<Version>1.2.10</Version>
<AssemblyVersion>1.2.11</AssemblyVersion>
<Version>1.2.11</Version>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
Expand All @@ -18,13 +18,13 @@
<AvaloniaResource Include="Resources\Images\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.13" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.13" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.13" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.13" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.13" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.13" />
<PackageReference Include="Avalonia.Svg.Skia" Version="0.10.12" />
<PackageReference Include="Avalonia" Version="0.10.14" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="0.10.14" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.14" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.14" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.14" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.13.3" />
<PackageReference Include="Avalonia.Svg.Skia" Version="0.10.13" />
<PackageReference Include="DialogHost.Avalonia" Version="0.4.0" />
<PackageReference Include="Deadpikle.AvaloniaProgressRing" Version="0.9.0" />
<PackageReference Include="NetSparkleUpdater.SparkleUpdater" Version="2.0.7" />
Expand Down Expand Up @@ -161,9 +161,6 @@
<Compile Update="Views\DelegateView.axaml.cs">
<DependentUpon>DelegateView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\DelegateConfirmationView.axaml.cs">
<DependentUpon>DelegateConfirmationView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\ReceiveView.axaml.cs">
<DependentUpon>ReceiveView.axaml</DependentUpon>
<SubType>Code</SubType>
Expand Down
5 changes: 5 additions & 0 deletions Atomex.Client.Desktop.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Overdelegated/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tezos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tzkt/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=undelegating/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
37 changes: 36 additions & 1 deletion Controls/IconButton.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@

</StackPanel>

<StackPanel Margin="0 25 0 0 " Orientation="Horizontal">
<StackPanel Margin="0 25 0 0 "
Orientation="Horizontal">
<controls:IconButton Classes="Question"
ToolText="Some tooltip text"
Margin="10 0 0 0" />
<controls:IconButton Classes="Question Orange"
ToolText="Some tooltip text"
Margin="10 0 0 0" />
<controls:IconButton Classes="Trash"
ToolText="Remove transaction from list"
Margin="10 0 0 0" />
Expand All @@ -61,6 +65,21 @@
<controls:IconButton Classes="ViewAsset"
Margin="10 0 0 0" />
</StackPanel>

<StackPanel Margin="0 25 0 0 "
Orientation="Horizontal">

<StackPanel Orientation="Horizontal">
<controls:IconButton Classes="Warning NoEffects" />
<TextBlock Text="The transfer amount (including commission) exceeds the amount of available funds!"
MaxWidth="300"
TextWrapping="Wrap"
FontSize="16"
Margin="6 0 0 0"
Foreground="{DynamicResource WarningForegroundBrush}"
VerticalAlignment="Bottom" />
</StackPanel>
</StackPanel>
</StackPanel>

</Border>
Expand Down Expand Up @@ -236,6 +255,13 @@
<Style Selector="controls|IconButton.Question:pointerover /template/ svg|Svg">
<Setter Property="Path" Value="/Resources/Icons/question-light.svg" />
</Style>
<Style Selector="controls|IconButton.Question.Orange /template/ svg|Svg">
<Setter Property="Path" Value="/Resources/Icons/question-orange.svg" />
<Setter Property="Width" Value="12" />
</Style>
<Style Selector="controls|IconButton.Question.Orange:pointerover /template/ svg|Svg">
<Setter Property="Path" Value="/Resources/Icons/question-orange.svg" />
</Style>

<Style Selector="controls|IconButton.Trash">
<Setter Property="Width" Value="28" />
Expand Down Expand Up @@ -374,4 +400,13 @@
<Setter Property="Path" Value="/Resources/Icons/view-asset.svg" />
<Setter Property="Width" Value="22" />
</Style>

<Style Selector="controls|IconButton.Warning">
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
<Style Selector="controls|IconButton.Warning svg|Svg">
<Setter Property="Path" Value="/Resources/Icons/warning.svg" />
<Setter Property="Width" Value="24" />
</Style>
</Styles>
51 changes: 48 additions & 3 deletions Styles/RoundedButtonStyle.axaml → Controls/RoundedButton.axaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
<Styles xmlns='https://github.com/avaloniaui'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
xmlns:controls="clr-namespace:Atomex.Client.Desktop.Controls">
xmlns:controls="clr-namespace:Atomex.Client.Desktop.Controls"
xmlns:svg="clr-namespace:Avalonia.Svg.Skia;assembly=Avalonia.Svg.Skia">

<Design.PreviewWith>
<Border Padding="40 100" Background="#122B50">
<StackPanel Orientation="Vertical"
Width="440">
<controls:RoundedButton Height="52"
FontSize="18"
Content="Disabled Button"
IsEnabled="False" />

<controls:RoundedButton Height="52"
FontSize="18"
Margin="0 10 0 0"
Content="Enabled Button" />

<controls:RoundedButton Height="52"
FontSize="18"
Margin="0 10 0 0"
Classes="Loading"
Content="Loading button" />
</StackPanel>

</Border>
</Design.PreviewWith>

<Style Selector="controls|RoundedButton">
<Setter Property="Background" Value="{DynamicResource RoundedButtonBackgroundBrush}" />
<Setter Property="Foreground" Value="{DynamicResource RoundedButtonForegroundBrush}" />
<Setter Property="FontFamily" Value="{DynamicResource DefaultButtonFontFamily}" />
<Setter Property="FontWeight" Value="{DynamicResource DefaultButtonFontWeight}" />
<Setter Property="FontSize" Value="13" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="CornerRadius" Value="{DynamicResource AtomexCornerRadius}" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Height" Value="52" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:RoundedButton}">
Expand All @@ -27,6 +54,24 @@
</Setter>
</Style>

<Style Selector="controls|RoundedButton.Loading">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:RoundedButton}">
<Border Name="border"
BorderThickness="0"
CornerRadius="{TemplateBinding CornerRadius}"
Background="{DynamicResource RoundedButtonDisabledBrush}"
Padding="{TemplateBinding Padding}">
<svg:Svg Path="/Resources/Icons/in-progress.svg"
Classes="InProgress"
Width="18" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- <Style Selector="controls|RoundedButton:focus"> -->
<!-- <Setter Property="Background" Value="{DynamicResource RoundedButtonMouseOverBrush}" /> -->
<!-- </Style> -->
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions Converters/AddAscToStringConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
using Atomex.Client.Desktop.ViewModels.Abstract;
using Avalonia.Data.Converters;
using Atomex.Client.Desktop.ViewModels.WalletViewModels;

Expand Down
1 change: 1 addition & 0 deletions Converters/AddDescToStringConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Globalization;
using Atomex.Client.Desktop.ViewModels.Abstract;
using Avalonia.Data.Converters;
using Atomex.Client.Desktop.ViewModels.WalletViewModels;

Expand Down
26 changes: 0 additions & 26 deletions Converters/MinTezConverter.cs

This file was deleted.

11 changes: 4 additions & 7 deletions Converters/PercentConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ public class PercentConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is decimal decimalValue && targetType == typeof(string))
{
var percentValue = decimalValue * 100;
if (value is not decimal decimalValue || targetType != typeof(string)) return value;

var percentValue = decimalValue * 100;
return percentValue != 0 ? $"{percentValue:F}%" : "0%";

return percentValue != 0 ? $"{percentValue:F}%" : "0%";
}

return value;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
17 changes: 12 additions & 5 deletions Converters/ShortenedAddressConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Globalization;
using Atomex.Client.Desktop.ViewModels;
using Atomex.Client.Desktop.ViewModels.Abstract;
using Atomex.ViewModels;
using Avalonia;
using Avalonia.Data.Converters;
Expand All @@ -10,12 +12,17 @@ public class ShortenedAddressConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is string address)
{
if (value is not string address) return value;

if (parameter is not AddressTruncateType truncateType)
return address.TruncateAddress(15, 12);
}

return value;

return truncateType switch
{
AddressTruncateType.Short => address.TruncateAddress(6, 4),
_ => address.TruncateAddress(15, 12)
};

}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
26 changes: 0 additions & 26 deletions Converters/TezosDelegationCurrencyFormatConverter.cs

This file was deleted.

3 changes: 3 additions & 0 deletions Resources/Icons/question-orange.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Resources/Icons/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d654a69

Please sign in to comment.