Skip to content

Commit

Permalink
fix: reorganize menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzzerd committed Feb 29, 2024
1 parent 4bf4566 commit 899d46a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
24 changes: 18 additions & 6 deletions MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,41 @@
<DockPanel>
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Command="{Binding NewEmptyItem}" Header="_New" />
<MenuItem Header="_New">
<MenuItem Command="{Binding NewEmptyItem}" Header="Blank Clip" />
<MenuItem Command="{Binding PasteFileMakerClipData}" Header="From Clipboard (copied from FileMaker)" />
</MenuItem>
<Separator />
<MenuItem Command="{Binding OpenFolderPicker}" Header="Open Folder" />
<Separator />
<MenuItem Command="{Binding SaveClipsStorage}" Header="Save All" />
<MenuItem Header="Save">
<MenuItem Command="{Binding SaveClipsStorage}" Header="Save All To Folder" />
<MenuItem Command="{Binding CopySelectedToClip}" Header="Selected clip to Clipboard (to paste into FileMaker)" />
</MenuItem>
<Separator />
<MenuItem Command="{Binding ExitApplication}" Header="_Exit" />
</MenuItem>
<MenuItem Header="_Edit">
<MenuItem Command="{Binding CopySelectedToClip}" Header="Copy as FileMaker Blob" />
<MenuItem Command="{Binding PasteFileMakerClipData}" Header="Paste From FileMaker Blob" />
</MenuItem>
<MenuItem Header="Transform">
<MenuItem Command="{Binding CopyAsClass}" Header="Copy as C# Class" />
</MenuItem>
<MenuItem Header="{Binding Version}" />
</Menu>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="225" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,8">
<TextBox Text="{Binding CurrentPath, Mode=OneWay}" />
</StackPanel>

<ListBox
Grid.Row="1"
Grid.Column="0"
ItemsSource="{Binding FileMakerClips}"
SelectedItem="{Binding SelectedClip}">
Expand All @@ -63,6 +74,7 @@

<AvaloniaEdit:TextEditor
x:Name="avaloniaEditor"
Grid.Row="1"
Grid.Column="1"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
ShowLineNumbers="True"
Expand Down
14 changes: 12 additions & 2 deletions ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public partial class MainWindowViewModel : INotifyPropertyChanged

public event PropertyChangedEventHandler? PropertyChanged;

public string? CurrentPath = null;

private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
Expand Down Expand Up @@ -238,4 +236,16 @@ public ClipViewModel? SelectedClip
NotifyPropertyChanged();
}
}

private string _currentPath;
public string CurrentPath
{
get => _currentPath;
set
{
_currentPath = value;
NotifyPropertyChanged();
}
}

}

0 comments on commit 899d46a

Please sign in to comment.