Skip to content

Commit

Permalink
Upgrade to AppSuite 3.0.0.302-dev.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster620 committed Mar 2, 2024
1 parent fc21a64 commit 53df8d6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
15 changes: 4 additions & 11 deletions PixelViewer/Controls/ApplicationOptionsDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@
</asControls:DialogItem>
<Separator Classes="Dialog_Item_Separator"/>

<!-- Enable blurry background -->
<asControls:DialogItem>
<TextBlock Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptions.EnableBlurryBackground}"/>
<ToggleSwitch Classes="Dialog_Item_ToggleSwitch" IsChecked="{Binding EnableBlurryBackground, Mode=TwoWay}"/>
</asControls:DialogItem>
<Separator Classes="Dialog_Item_Separator"/>

<!-- Culture -->
<asControls:DialogItem>
<TextBlock Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptions.Culture}"/>
Expand Down Expand Up @@ -363,10 +356,10 @@
<Separator Classes="Dialog_Item_Separator"/>

<!-- Enable color space management -->
<asControls:DialogItem>
<asControls:DialogItem Name="enableColorSpaceManagementItem">
<StackPanel Classes="Dialog_Item_Text_Container">
<WrapPanel>
<TextBlock Name="enableColorSpaceManagementLabel" Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptionsDialog.EnableColorSpaceManagement}"/>
<TextBlock Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptionsDialog.EnableColorSpaceManagement}"/>
<Button Classes="Dialog_Info_Button" Command="{x:Static cs:PlatformCommands.OpenLinkCommand}" CommandParameter="https://en.wikipedia.org/wiki/Color_management" ToolTip.Tip="{DynamicResource String/Common.Help}">
<Image Classes="Icon" Source="{DynamicResource Image/Icon.Question.Outline}"/>
</Button>
Expand Down Expand Up @@ -572,8 +565,8 @@
<Separator Classes="Dialog_Item_Separator"/>

<!-- Max rendered images memory usage -->
<asControls:DialogItem>
<TextBlock Name="maxRenderedImagesMemoryUsageLabel" Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptionsDialog.MaxRenderedImagesMemoryUsage}"/>
<asControls:DialogItem Name="maxRenderedImagesMemoryUsageItem">
<TextBlock Classes="Dialog_TextBlock_Label" Text="{DynamicResource String/ApplicationOptionsDialog.MaxRenderedImagesMemoryUsage}"/>
<abControls:IntegerTextBox Name="maxRenderedImageMemoryUsageTextBox" Classes="Dialog_Item_TextBox" IsNullValueAllowed="False" Minimum="128" Value="{Binding MaxRenderedImagesMemoryUsageMB, Mode=TwoWay}"/>
</asControls:DialogItem>

Expand Down
14 changes: 6 additions & 8 deletions PixelViewer/Controls/ApplicationOptionsDialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System;
using System.IO;
using System.Windows.Input;
using TextBlock = Avalonia.Controls.TextBlock;

namespace Carina.PixelViewer.Controls;

Expand Down Expand Up @@ -241,19 +240,18 @@ protected override void OnOpened(EventArgs e)
this.Application.StringsUpdated += this.OnAppStringsUpdated;

// scroll to focused section
var header = this.InitialFocusedSection switch
var initialItem = this.InitialFocusedSection switch
{
ApplicationOptionsDialogSection.ColorSpaceManagement => this.Get<Control>("enableColorSpaceManagementLabel"),
ApplicationOptionsDialogSection.MaxRenderedImagesMemoryUsage => this.Get<Control>("maxRenderedImagesMemoryUsageLabel"),
ApplicationOptionsDialogSection.ColorSpaceManagement => this.Get<Control>("enableColorSpaceManagementItem"),
ApplicationOptionsDialogSection.MaxRenderedImagesMemoryUsage => this.Get<Control>("maxRenderedImagesMemoryUsageItem"),
_ => null,
};
if (header is not null)
if (initialItem is not null)
{
this.SynchronizationContext.Post(() =>
{
this.contentScrollViewer.ScrollIntoView(header, true);
if (header is TextBlock textBlock)
this.AnimateTextBlock(textBlock);
this.contentScrollViewer.ScrollIntoView(initialItem, true);
this.AnimateItem(initialItem);
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions PixelViewer/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@
<asControls:TabControl Name="tabControl" DragDrop.AllowDrop="True" DragLeaveItem="OnDragLeaveTabItem" DragOverItem="OnDragOverTabItem" DropOnItem="OnDropOnTabItem" ItemDragged="OnTabItemDragged" Padding="0">

<!-- New tab -->
<TabItem Classes="Empty">
<asControls:TabItem Classes="Empty">
<TabItem.Header>
<Button Classes="AddTabItem" Command="{Binding $parent[Window].CreateMainTabItem}">
<Image Classes="Icon" Source="{DynamicResource Image/Icon.Add}"/>
</Button>
</TabItem.Header>
</TabItem>
</asControls:TabItem>

</asControls:TabControl>
</Border>
Expand Down
1 change: 1 addition & 0 deletions PixelViewer/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Windows.Input;

using AsTabControl = CarinaStudio.AppSuite.Controls.TabControl;
using TabItem = CarinaStudio.AppSuite.Controls.TabItem;

namespace Carina.PixelViewer
{
Expand Down
2 changes: 1 addition & 1 deletion PixelViewer/PixelViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<Configurations>Debug;Release;Debug-Windows;Release-Windows</Configurations>
<AvaloniaNameGeneratorFilterByNamespace>Dummy</AvaloniaNameGeneratorFilterByNamespace> <!-- Prevent generating InitializeComponents() and fields -->
<AppSuiteVersion>3.0.0.210-dev</AppSuiteVersion>
<AppSuiteVersion>3.0.0.302-dev</AppSuiteVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down

0 comments on commit 53df8d6

Please sign in to comment.