More UI changes

This commit is contained in:
Nicolò P 2024-01-10 18:09:34 +01:00
parent 8a0232129f
commit 50bbc3f3d1
2 changed files with 17 additions and 5 deletions

View File

@ -26,16 +26,16 @@
<ImageBrush Stretch="Uniform" ImageSource="/copy-icon.png"/>
</Button.OpacityMask>
</Button>
<Menu x:Name="FileMenu" Margin="22,56,607,476" Background="#FF4B4E5D" Visibility="Collapsed">
<Menu x:Name="FileMenu" Margin="22,56,607,476" Background="#FF4B4E5D" LostMouseCapture="FileMenu_LostMouseFocus" Visibility="Collapsed">
<Menu.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Menu.ItemsPanel>
<Label x:Name="MenuExec" Content="Esegui..." Foreground="White" FontSize="14" MouseDown="MenuExec_MouseDown" Cursor="Hand"/>
<Label x:Name="OpenOutputDir" Content="Apri cartella output" Foreground="White" FontSize="14" MouseDown="OpenOutputDir_MouseDown" Cursor="Hand"/>
<Label x:Name="Help" Content="Help" Foreground="White" FontSize="14" MouseDown="Help_MouseDown" Cursor="Hand"/>
<Label x:Name="Exit" Content="Esci..." Foreground="White" FontSize="14" MouseDown="Exit_MouseDown" Cursor="Hand"/>
<Label x:Name="MenuExec" Content="Esegui..." Foreground="White" FontSize="14" MouseDown="MenuExec_MouseDown" Cursor="Hand" Width="158"/>
<Label x:Name="OpenOutputDir" Content="Apri cartella output" Foreground="White" FontSize="14" MouseDown="OpenOutputDir_MouseDown" Cursor="Hand" Width="160"/>
<Label x:Name="Help" Content="Help" Foreground="White" FontSize="14" MouseDown="Help_MouseDown" Cursor="Hand" Width="161"/>
<Label x:Name="Exit" Content="Esci..." Foreground="White" FontSize="14" MouseDown="Exit_MouseDown" Cursor="Hand" Width="163"/>
</Menu>
<Button x:Name="ToggleMenu" Content="" HorizontalAlignment="Left" Margin="12,14,0,0" VerticalAlignment="Top" RenderTransformOrigin="0,0.202" Height="42" Width="47" BorderBrush="{x:Null}" Foreground="{x:Null}" Cursor="Hand" Click="ToggleMenu_Click">
<Button.OpacityMask>

View File

@ -19,12 +19,19 @@ namespace Txt2Bib
OutputDir = $@"{Directory.GetCurrentDirectory()}\bibtex";
Directory.CreateDirectory(OutputDir);
DropArea.AllowDrop = true;
InitialDropText = DropArea.Text;
}
private string OutputDir { get; }
private string InitialDropText { get; }
private void Execute()
{
if (DropArea.Text == InitialDropText)
{
MessageBox.Show("Nessun percorso disponibile...");
return;
}
var txt2bib = new Text2Bib();
var result = txt2bib.Generate(DropArea.Text);
Debug.Text = result;
@ -127,5 +134,10 @@ namespace Txt2Bib
"Il file BibTeX viene generato in una cartella dedicata, che si può aprire selezionando " +
"'Apri cartella output' dal menu.", "Help", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void FileMenu_LostMouseFocus(object sender, RoutedEventArgs e)
{
FileMenu.Visibility = Visibility.Collapsed;
}
}
}