Skip to content

Commit

Permalink
Merge pull request #9 from CassioJhones/dev
Browse files Browse the repository at this point in the history
App Reduction
  • Loading branch information
CassioJhones authored Dec 24, 2024
2 parents d31ee2e + a8bb2c9 commit 6c1f4a6
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 205 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Compilação e Publicação FolderFlex
name: Deploy FolderFlex

on:
push:
Expand Down Expand Up @@ -30,7 +30,7 @@ jobs:
with:
dotnet-version: '8.0.x'

- name: Restaurando as dependencies
- name: Restaurando as dependências
run: dotnet restore FolderFlex.sln

- name: Compilando Tudo
Expand All @@ -39,19 +39,24 @@ jobs:
- name: Publicando FolderFlex
run: dotnet publish FolderFlex/FolderFlex.csproj --configuration ${{ matrix.configuration }} --output ./output/

- name: Compactando tudo em um zip
- name: Criando Pasta para os Arquivos
run: |
powershell Compress-Archive -Path ./output/* -DestinationPath ./output/FolderFlex.zip
mkdir ./output/FolderFlexFiles
Move-Item ./output/* ./output/FolderFlexFiles/ -Force
- name: Criando uma tag para a versão
- name: Compactando Arquivos
run: |
powershell Compress-Archive -Path ./output/FolderFlexFiles/* -DestinationPath ./output/FolderFlex.zip
- name: Criando Tag da versão
id: tag_version
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"
git tag v1.0.${{ github.run_number }}
git push origin v1.0.${{ github.run_number }}
- name: Criando a nova release
- name: Criando Nova Release
id: create_release
uses: actions/create-release@v1
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using FolderFlex.View;
using MahApps.Metro.IconPacks;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Button = System.Windows.Controls.Button;
using Orientation = System.Windows.Controls.Orientation;
using ProgressBar = System.Windows.Controls.ProgressBar;
Expand All @@ -29,12 +29,17 @@ public static class FileComponentFactory
HorizontalAlignment = System.Windows.HorizontalAlignment.Left,
};

public static PackIconPhosphorIcons CreateFileIcon() => new()
public static System.Windows.Controls.Image CreateFileIcon()
{
Kind = PackIconPhosphorIconsKind.FileArrowUpLight,
Margin = new Thickness(0, 2, 7, 0),
Foreground = (System.Windows.Media.Brush)new BrushConverter().ConvertFromString("#1f1446")!
};
System.Windows.Controls.Image image = new()
{
Source = new BitmapImage(new Uri("pack://application:,,,/Recursos/file-up.png")),
Width = 18,
Height = 18,
VerticalAlignment = VerticalAlignment.Center
};
return image;
}

public static TextBlock CreateFileNameTextBlock(string fileName) => new()
{
Expand Down Expand Up @@ -83,19 +88,28 @@ public static class FileComponentFactory
Margin = new Thickness(10, 0, 10, 0),
HorizontalAlignment = System.Windows.HorizontalAlignment.Right
};

public static PackIconGameIcons CreateGameIcon() => new()
public static System.Windows.Controls.Image CreateGameIcon()
{
Kind = PackIconGameIconsKind.Cancel,
Foreground = (System.Windows.Media.Brush)new BrushConverter().ConvertFromString("#AAB8C2")!,
Height = 18
};
System.Windows.Controls.Image image = new()
{
Source = new BitmapImage(new Uri("pack://application:,,,/Recursos/cancel.png")),
Width = 18,
Height = 18,
VerticalAlignment = VerticalAlignment.Center
};
return image;
}

public static PackIconLucide CreateFileSearchIcon() => new()
public static System.Windows.Controls.Image CreateFileSearchIcon()
{
Kind = PackIconLucideKind.FileSearch,
Foreground = (System.Windows.Media.Brush)new BrushConverter().ConvertFromString("#AAB8C2")!,
Height = 18,
Visibility = Visibility.Collapsed
};
System.Windows.Controls.Image image = new()
{
Source = new BitmapImage(new Uri("pack://application:,,,/Recursos/file-search.png")),
Width = 18,
Height = 18,
VerticalAlignment = VerticalAlignment.Center
};
return image;
}
}
42 changes: 34 additions & 8 deletions FolderFlex/FolderFlex.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,58 @@
<ApplicationIcon>Recursos\pasta.ico</ApplicationIcon>
<StartupObject></StartupObject>
</PropertyGroup>


<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
</PropertyGroup>

<PropertyGroup>
<AssemblyVersion>5.0.21.0</AssemblyVersion>
<FileVersion>5.0.21.0</FileVersion>
<Title>FolderFlex</Title>
<Authors>$(AssemblyName),CassioJhones</Authors>
<Company>$(Authors),MySefl</Company>
<Product>$(AssemblyName)</Product>
<Authors>CassioJhones</Authors>
<Company>CassioJhones</Company>
<Product>CassioJhones</Product>
<PackageProjectUrl>https://github.com/CassioJhones/FolderFlex</PackageProjectUrl>
<RepositoryUrl>https://github.com/CassioJhones/FolderFlex</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<None Remove="Recursos\cancel.png" />
<None Remove="Recursos\cancel.svg" />
<None Remove="Recursos\file-search.png" />
<None Remove="Recursos\file-search.svg" />
<None Remove="Recursos\file-up.png" />
<None Remove="Recursos\file-up.svg" />
<None Remove="Recursos\git.ico" />
<None Remove="Recursos\github.png" />
<None Remove="Recursos\github.svg" />
<None Remove="Recursos\x.png" />
<None Remove="Recursos\x.svg" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MahApps.Metro.IconPacks" Version="5.1.0" />
</ItemGroup>

<ItemGroup>
<Resource Include="Recursos\cancel.png" />
<Resource Include="Recursos\cancel.svg" />
<Resource Include="Recursos\file-search.png" />
<Resource Include="Recursos\file-search.svg" />
<Resource Include="Recursos\file-up.png" />
<Resource Include="Recursos\file-up.svg" />
<Resource Include="Recursos\github.png" />
<Resource Include="Recursos\github.svg" />
<Resource Include="Recursos\pasta.ico" />
<Resource Include="Recursos\x.png" />
<Resource Include="Recursos\x.svg" />
</ItemGroup>

<ItemGroup>
<Resource Include="Recursos\git.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FolderFlexCommon\FolderFlexCommon.csproj" />
</ItemGroup>
Expand Down
Binary file added FolderFlex/Recursos/cancel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FolderFlex/Recursos/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FolderFlex/Recursos/file-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FolderFlex/Recursos/file-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FolderFlex/Recursos/file-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FolderFlex/Recursos/file-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed FolderFlex/Recursos/git.ico
Binary file not shown.
Binary file added FolderFlex/Recursos/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FolderFlex/Recursos/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FolderFlex/Recursos/x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions FolderFlex/Recursos/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 14 additions & 27 deletions FolderFlex/View/FolderFlexMain.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
WindowStyle="None"
BorderBrush="Transparent"
Background="Transparent"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:language="clr-namespace:FolderFlex.ViewModel"
d:DataContext="{d:DesignInstance Type=language:FolderFlexViewModel}"
DataContext="{StaticResource FolderFlexMessageProviderViewModel}"
Expand Down Expand Up @@ -39,7 +38,7 @@
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
<Button x:Name="CloseButton" Style="{StaticResource TransparentButton}" Margin="10,0" Click="CloseButton_Click">
<iconPacks:PackIconEvaIcons Kind="Close" Foreground="#AAB8C2" />
<Image Source="pack://application:,,,/Recursos/x.png" Width="18" Height="18" />
</Button>
</StackPanel>
</Grid>
Expand Down Expand Up @@ -81,13 +80,11 @@
</StackPanel>
<StackPanel HorizontalAlignment="Center" Margin="0,-12,0,0">
<Label Margin="0 10 0 0" HorizontalAlignment="Center" Foreground="#399fa1"
FontWeight="bold" FontSize="13"
Visibility="{Binding AllDoneLabel, Converter={StaticResource StringToVisibilityConverter}}"
Content="{Binding AllDoneLabel, Source={StaticResource FolderFlexMessageProviderViewModel}}"/>

FontWeight="bold" FontSize="13"
Visibility="{Binding AllDoneLabel, Converter={StaticResource StringToVisibilityConverter}}"
Content="{Binding AllDoneLabel, Source={StaticResource FolderFlexMessageProviderViewModel}}"/>
</StackPanel>


</StackPanel>

</StackPanel>
Expand All @@ -98,31 +95,21 @@
<ScrollViewer x:Name="ScrollViewerContainer" VerticalScrollBarVisibility="Auto" Margin="10,10" Style="{StaticResource {x:Type ScrollViewer}}">
<StackPanel x:Name="StackContainer">

<!--<Border Background="White" BorderBrush="#EBECF4" BorderThickness="1" CornerRadius="10" Height="60" Margin="0,0,14,0">
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
<iconPacks:PackIconPhosphorIcons Kind="FileArrowUpLight" Margin="0,2,7,0" Foreground="#1f1446" />
<TextBlock Text="World-of-Warcraft(2016).mkv" VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold" Margin="0,0,0,2" Foreground="#1f1446"/>
</StackPanel>
<ProgressBar Style="{StaticResource RoundedProgressBar}" Value="100" Height="10" Width="340" VerticalAlignment="Center" Margin="10,40,0,0" HorizontalAlignment="Left"/>
<TextBlock Text="1,5 GB" FontWeight="SemiBold" Foreground="#A0A3BD" HorizontalAlignment="Right" Margin="0,0,50,0" VerticalAlignment="Center" FontSize="12"/>
<Button Style="{StaticResource TransparentButton}" Margin="10,0" HorizontalAlignment="Right">
<iconPacks:PackIconLucide Kind="FileSearch" Foreground="#AAB8C2" Height="18" />
<iconPacks:PackIconGameIcons Kind="Cancel" Foreground="#AAB8C2" Height="18" />
</Button>
</Grid>
</Border>-->

</StackPanel>
</ScrollViewer>
</Grid>
<DockPanel Grid.Row="3" VerticalAlignment="Center">
<Button Style="{StaticResource TransparentButton}" Click="ButtonGithub_Click" HorizontalAlignment="Left" ToolTip="Pagina do Projeto">
<iconPacks:PackIconFontisto Kind="Github" Margin="10,4,0,5" Foreground="#272727"/>
<Button Style="{StaticResource TransparentButton}" Click="ButtonGithub_Click"
HorizontalAlignment="Left" ToolTip="Pagina do Projeto">
<!--<iconPacks:PackIconFontisto Kind="Github" Margin="10,4,0,5" Foreground="#272727"/>-->
<Image Source="pack://application:,,,/Recursos/github.png" Width="35" Height="20" />
</Button>
<ComboBox Style="{StaticResource ComboBoxRoundedStyle}" Foreground="#A0A3BD" Background="WhiteSmoke" x:Name="LanguageCombo"
SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding LanguageOptions, Source={StaticResource FolderFlexMessageProviderViewModel}}" HorizontalAlignment="Right" Width="90" Height="20" Margin="0,0,10,0">
<ComboBox Style="{StaticResource ComboBoxRoundedStyle}" Foreground="#A0A3BD"
Background="WhiteSmoke" x:Name="LanguageCombo"
SelectionChanged="ComboBox_SelectionChanged"
ItemsSource="{Binding LanguageOptions, Source={StaticResource FolderFlexMessageProviderViewModel}}"
HorizontalAlignment="Right" Width="90" Height="20"
Margin="0,0,10,0">
</ComboBox>
</DockPanel>
</Grid>
Expand Down
12 changes: 5 additions & 7 deletions FolderFlex/ViewModel/FolderFlexViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using FolderFlex.Services.ErrorManager;
using FolderFlex.View;
using FolderFlexCommon.Messages;
using MahApps.Metro.IconPacks;
using System.Buffers;
using System.ComponentModel;
using System.Diagnostics;
Expand All @@ -13,7 +12,6 @@
using System.Windows.Controls;
using System.Windows.Threading;
using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control;
using MessageBox = System.Windows.MessageBox;
using ProgressBar = System.Windows.Controls.ProgressBar;

Expand Down Expand Up @@ -313,7 +311,7 @@ private async Task ProcessFilesOrFolders(string[] lista, string destino, Cancell

StackPanel stackPanel = FileComponentFactory.CreateStackPanel();

PackIconPhosphorIcons fileIcon = FileComponentFactory.CreateFileIcon();
System.Windows.Controls.Image fileIcon = FileComponentFactory.CreateFileIcon();

stackPanel.Children.Add(fileIcon);

Expand Down Expand Up @@ -345,15 +343,15 @@ private async Task ProcessFilesOrFolders(string[] lista, string destino, Cancell

Button actionButton = FileComponentFactory.CreateActionButton(_mainWindow);

PackIconGameIcons cancelIcon = FileComponentFactory.CreateGameIcon();
System.Windows.Controls.Image cancelIcon = FileComponentFactory.CreateGameIcon();

cancelIcon.Name = $"CancelIcon{index}";

_mainWindow.RegisterName(cancelIcon.Name, cancelIcon);

namesRegistered.Add(cancelIcon.Name);

PackIconLucide fileSearchIcon = FileComponentFactory.CreateFileSearchIcon();
System.Windows.Controls.Image fileSearchIcon = FileComponentFactory.CreateFileSearchIcon();

fileSearchIcon.Name = $"SearchIcon{index}";

Expand Down Expand Up @@ -437,8 +435,8 @@ private async Task MoveCopy
{
int index = fileComponents.IndexOf(arquivo);

Control? searchIcon = (Control)_mainWindow.FindName($"SearchIcon{index}");
Control? cancelIcon = (Control)_mainWindow.FindName($"CancelIcon{index}");
FrameworkElement? searchIcon = (FrameworkElement)_mainWindow.FindName($"SearchIcon{index}");
FrameworkElement? cancelIcon = (FrameworkElement)_mainWindow.FindName($"CancelIcon{index}");

searchIcon!.Visibility = Visibility.Visible;
cancelIcon!.Visibility = Visibility.Collapsed;
Expand Down
31 changes: 20 additions & 11 deletions FolderFlexCommon/FolderFlexCommon.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Messages\Resources\messages.json" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Messages\Resources\messages.json" />
</ItemGroup>
</Project>
Loading

0 comments on commit 6c1f4a6

Please sign in to comment.