Skip to content

Commit

Permalink
Added Icon
Browse files Browse the repository at this point in the history
Another minor UI fixes + second pre-release candidate
  • Loading branch information
AndyFilter committed Jan 23, 2022
1 parent 5dd3d84 commit bf8aef6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,5 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd
*.ai
13 changes: 13 additions & 0 deletions FunnySounds/FunnySounds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationIcon>Media\FunnySoundsIco.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<None Remove="Media\FunnySoundsIco.ai" />
</ItemGroup>

<ItemGroup>
<Resource Include="Media\FunnySoundsIco.ico" />
</ItemGroup>

<ItemGroup>
<Resource Include="Media\FunnySoundsIco.png" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions FunnySounds/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:FunnySounds"
mc:Ignorable="d"
ResizeMode="NoResize"
Title="Funny Sounds" Height="450" Width="580">
Title="Funny Sounds" Height="460" Width="580" WindowStyle="SingleBorderWindow" Icon="/Media/FunnySoundsIco.png">
<Grid Margin="8,8,8,8">
<StackPanel>
<Grid>
Expand Down Expand Up @@ -48,7 +48,7 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Content="Link:" Margin="0,0,5,0"/>
<Label Content="Link (url):" Margin="0,0,5,0"/>
<TextBox x:Name="linkTextBox" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Grid.Column="1" Margin="0,0,5,0" ToolTip="Link should end with any audio extension, cannot be a redirect"/>
<TextBlock IsHitTestVisible="False" Text="Link" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,0,0,0" Foreground="DarkGray" Grid.Column="1">
<TextBlock.Style>
Expand Down Expand Up @@ -86,7 +86,7 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Content="Local File:" Margin="0,0,5,0"/>
<Label Content="Local File:"/>
<TextBox x:Name="fileTextBox" Text="Drop file here" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Grid.Column="1" Margin="0,0,5,0" AllowDrop="True" Focusable="False" Drop="FileDropped" PreviewDragOver="TextBox_PreviewDragOver"/>
<TextBox x:Name="fileSoundNameBox" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Grid.Column="2" Margin="0,0,5,0"/>
<TextBlock IsHitTestVisible="False" Text="Name" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,0,0,0" Foreground="DarkGray" Grid.Column="2">
Expand Down
7 changes: 6 additions & 1 deletion FunnySounds/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private void CopyDraggedFilesClicked(object sender, RoutedEventArgs e)
catch (Exception)
{
MessageBox.Show("The issue persists, it might be caused by the file, its localization, or my lack of programming skills");
fileTextBox.Text = "Drop file here";
return;
}
}
Expand All @@ -314,6 +315,7 @@ private void CopyDraggedFilesClicked(object sender, RoutedEventArgs e)
catch (Exception)
{
MessageBox.Show("There was an error while copying the file");
fileTextBox.Text = "Drop file here";
return;
}
newSound.path = Path.Combine(Structs.dataDir, Path.GetFileName(droppedSoundFile.path));
Expand All @@ -326,6 +328,7 @@ private void CopyDraggedFilesClicked(object sender, RoutedEventArgs e)

var soundControl = new Controls.SoundControl(newSound);
soundsPanel.Children.Add(soundControl);
fileTextBox.Text = "Drop file here";
//foreach (var child in soundsPanel.Children)
//{
// var dataContext = (child as Controls.SoundControl).DataContext as Structs.Sound;
Expand Down Expand Up @@ -359,12 +362,13 @@ private void LinkDraggedFilesClicked(object sender, RoutedEventArgs e)
if (droppedSoundFile == null) return;
if (fileSoundNameBox.Text == null || fileSoundNameBox.Text.Length <= 0)
{
MessageBox.Show("Please put in the name/link");
MessageBox.Show("Please put in the name/file");
return;
}
if (userData.sounds.Any(sound => sound.name == droppedSoundFile.name))
{
MessageBox.Show("Sound with this name already exists");
fileTextBox.Text = "Drop file here";
return;
}
droppedSoundFile.name = fileSoundNameBox.Text;
Expand All @@ -373,6 +377,7 @@ private void LinkDraggedFilesClicked(object sender, RoutedEventArgs e)

var soundControl = new Controls.SoundControl(droppedSoundFile);
soundsPanel.Children.Add(soundControl);
fileTextBox.Text = "Drop file here";

Utils.SaveUserData(userData);

Expand Down
Binary file added FunnySounds/Media/FunnySoundsIco.ico
Binary file not shown.
Binary file added FunnySounds/Media/FunnySoundsIco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf8aef6

Please sign in to comment.