Skip to content

Commit

Permalink
App Icon Upload UX improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsen9026 committed Oct 3, 2024
1 parent cdf9b4b commit 9562764
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>1.0.3</AssemblyVersion>
<Version>2024.10.03.0223</Version>
<Version>2024.10.03.2256</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down
11 changes: 8 additions & 3 deletions BLAZAMGui/UI/Outputs/Base64Image.razor
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
@inherits MudImage
@{
var base64 = "";
if(Data!=null)
if (Data != null)
base64 = Convert.ToBase64String(Data);

}
<MudImage Elevation="@Elevation" Class="@Class" Style="@Style" Src=@("data:image/png;base64,"+@base64)/>
<MudImage Width="@Width"
Height="@Height"
Elevation="@Elevation"
Class="@Class"
Style="@Style"
Src=@("data:image/png;base64,"+@base64) />

@code{
@code {
/// <summary>
/// The raw byte array of the image to be displayed.
/// </summary>
Expand Down
11 changes: 7 additions & 4 deletions BLAZAMGui/UI/Settings/ApplicationSettings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@

@if (settings != null && settings.AppIcon != null && settings.AppIcon.Length > 0)
{
<MudImage Class="app-icon" Src="@StaticAssets.ApplicationIconUri" />
@* <MudImage Class="app-icon" Src="@StaticAssets.ApplicationIconUri" /> *@
<Base64Image Width=100 Data="@settings.AppIcon" />
@* <MudImage Class="app-icon" Src="@Convert.ToBase64String(settings.AppIcon)" /> *@
<AppTooltip Text="Remove custom icon">
<AppCloseButton OnClick="@(()=>{settings.AppIcon=null;})" />
</AppTooltip>
Expand All @@ -63,10 +65,11 @@
Variant="Variant.Filled"
Color="Color.Primary"
StartIcon="@Icons.Material.Filled.CloudUpload">
@AppLocalization["Upload Icon"]
@AppLocalization["Upload Icon"]
</MudButton>
</ActivatorContent>
</MudFileUpload>
<MudAlert Severity="Severity.Info">@AppLocalization["Changes may take up to 24 hrs to take effect"]</MudAlert>
</SettingsField>


Expand Down Expand Up @@ -110,8 +113,8 @@
</AppModal> *@
<SettingsField>
<MudButton Disabled="SaveDisabled"
ButtonType="ButtonType.Submit"
Color="Color.Success">
ButtonType="ButtonType.Submit"
Color="Color.Success">
@AppLocalization["Save Changes"]
</MudButton>
</SettingsField>
Expand Down

0 comments on commit 9562764

Please sign in to comment.