Skip to content

Commit

Permalink
Merge pull request #26 from atticus-lv/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
atticus-lv authored Dec 4, 2024
2 parents 8fd121c + cf27ce3 commit e9c9d6d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 30 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

on:
push:
branches: [ "master" ]
paths-ignore:
- 'README.md'
tags:
- 'v*.*.*'


jobs:
Expand Down
2 changes: 1 addition & 1 deletion src/VirtualStreetSnap/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class MainWindowViewModel : ViewModelBase
private PagesModel? _currentPage;

[ObservableProperty]
private bool _isPaneOpen;
private bool _isPaneOpen = true;

[RelayCommand]
public void TogglePane() => IsPaneOpen = !IsPaneOpen;
Expand Down
11 changes: 7 additions & 4 deletions src/VirtualStreetSnap/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace VirtualStreetSnap.ViewModels;

public partial class SettingsViewModel : ViewModelBase
{

[ObservableProperty]
private AppConfig _config = ConfigService.Instance;

Expand Down Expand Up @@ -53,6 +52,7 @@ partial void OnSelectedLanguageChanged(LanguageModel value)

public async Task ChangeDir(string parmName)
{
var oldValue = SaveDirectory;
var task = parmName switch
{
"SaveDirectory" => this.ChangeDirectory(value => SaveDirectory = value,
Expand All @@ -61,8 +61,11 @@ public async Task ChangeDir(string parmName)
};
await task;
// save the config
Config.Settings.SaveDirectory = SaveDirectory;
NotifyHelper.Notify(this, Localizer.Localizer.Instance["ConfigChanged"],
SaveDirectory);
if (oldValue != SaveDirectory)
{
Config.Settings.SaveDirectory = SaveDirectory;
NotifyHelper.Notify(this, Localizer.Localizer.Instance["ConfigChanged"],
SaveDirectory);
}
}
}
44 changes: 24 additions & 20 deletions src/VirtualStreetSnap/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Style Selector="Button#CloseWindowButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Firebrick" />
</Style>
<!-- footer -->
<Style Selector="StackPanel#Footer">
<Setter Property="Transitions">
<Transitions>
Expand All @@ -53,7 +54,7 @@
<ListBox Width="40"
ItemsSource="{Binding Pages}"
SelectedItem="{Binding CurrentPage}"
CornerRadius="4">
CornerRadius="10">

<ListBox.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -62,7 +63,8 @@
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type vm:PagesModel}">
<StackPanel Spacing="5" ToolTip.Tip="{Binding Name,
<StackPanel Spacing="5"
ToolTip.Tip="{Binding Name,
Converter={StaticResource LocalizeConverter}}">
<PathIcon Data="{Binding ItemIcon}">
</PathIcon>
Expand Down Expand Up @@ -92,26 +94,28 @@
</SplitView.Pane>

<SplitView.Content>
<Panel>
<!-- <Rectangle Fill="Red" Width="25" HorizontalAlignment="Right"></Rectangle> -->
<TransitioningContentControl Content="{Binding CurrentPage.Page}">
<TransitioningContentControl.PageTransition>
<PageSlide Orientation="Vertical" Duration="0:00:00.2" />
</TransitioningContentControl.PageTransition>
</TransitioningContentControl>
<Button Name="TogglePaneButton" Content=">" HorizontalAlignment="Right" Height="120" Width="20"
VerticalContentAlignment="Center" Margin="10" CornerRadius="10"
Command="{Binding TogglePane}">
</Button>
</Panel>
<!-- <Rectangle Fill="Red" Width="25" HorizontalAlignment="Right"></Rectangle> -->
<TransitioningContentControl Content="{Binding CurrentPage.Page}">
<TransitioningContentControl.PageTransition>
<PageSlide Orientation="Vertical" Duration="0:00:00.2" />
</TransitioningContentControl.PageTransition>
</TransitioningContentControl>
</SplitView.Content>
</SplitView>
<Button Name="CloseWindowButton" VerticalAlignment="Top" HorizontalAlignment="Right"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Background="Transparent" Width="40" Height="40" Margin="0 5 5 0 "
Command="{Binding OnCloseButtonClick}">
<TextBlock Text="X" FontSize="16" />
</Button>

<StackPanel VerticalAlignment="Top" HorizontalAlignment="Right">
<Button Name="CloseWindowButton"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
Background="Transparent" Width="40" Height="40" Margin="0 5 5 0 "
Command="{Binding OnCloseButtonClick}">
<TextBlock Text="X" FontSize="16" />
</Button>
<ToggleButton Name="ToggleTopMost" Width="40" Height="40" CornerRadius="10"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Click="ToggleTopMost_OnClick">
<PathIcon Data="{StaticResource PinRegular}"></PathIcon>
</ToggleButton>
</StackPanel>


</Panel>
</Window>
6 changes: 6 additions & 0 deletions src/VirtualStreetSnap/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;

namespace VirtualStreetSnap.Views;

Expand All @@ -21,4 +22,9 @@ private void DragMoveWindow_PointerPressed(object? sender, PointerPressedEventAr
if (!Equals(e.Source, ToolBar)) return;
BeginMoveDrag(e);
}

private void ToggleTopMost_OnClick(object? sender, RoutedEventArgs e)
{
Topmost = !Topmost;
}
}
2 changes: 1 addition & 1 deletion src/VirtualStreetSnap/Views/SnapShotView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<Rectangle Name="CaptureArea"></Rectangle>
</Border>

<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="20" Spacing="10"
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0 0 20 20" Spacing="10"
Orientation="Horizontal">

<Button Background="Transparent">
Expand Down
2 changes: 1 addition & 1 deletion src/VirtualStreetSnap/VirtualStreetSnap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<Version>0.1.2</Version>
<Version>0.1.3</Version>
<Authors>Atticus</Authors>
<Description>A simple screen shot tool design for VirtualStreetSnap</Description>
</PropertyGroup>
Expand Down

0 comments on commit e9c9d6d

Please sign in to comment.