Skip to content

Portable Tool for an Ideal Windows Setup

upd. redesign import window layout deb v5.5.5

Greedeks8bdbb2388ffc
diff --git a/.Source/GTweak/Languages/en/Localize.xaml b/.Source/GTweak/Languages/en/Localize.xaml
index 3582471a..c22541da 100644
--- a/.Source/GTweak/Languages/en/Localize.xaml
+++ b/.Source/GTweak/Languages/en/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Importing tweaks</v:String>
- <v:String x:Key="wait_import">It takes some time</v:String>
- <v:String x:Key="warn_import">It is not necessary to close the window forcibly</v:String>
<v:String x:Key="file_import">File</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/fr/Localize.xaml b/.Source/GTweak/Languages/fr/Localize.xaml
index cd03357d..d169919a 100644
--- a/.Source/GTweak/Languages/fr/Localize.xaml
+++ b/.Source/GTweak/Languages/fr/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Importation des réglages</v:String>
- <v:String x:Key="wait_import">Cela prendra un certain temps</v:String>
- <v:String x:Key="warn_import">Il n’est pas nécessaire de fermer la fenêtre de force</v:String>
<v:String x:Key="file_import">Fichier</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/he/Localize.xaml b/.Source/GTweak/Languages/he/Localize.xaml
index 9b75f607..2d060baa 100644
--- a/.Source/GTweak/Languages/he/Localize.xaml
+++ b/.Source/GTweak/Languages/he/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">ייבוא טוויקים</v:String>
- <v:String x:Key="wait_import">פעולה זו לוקחת זמן מה</v:String>
- <v:String x:Key="warn_import">אין צורך לסגור את החלון בכוח</v:String>
<v:String x:Key="file_import">קובץ</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/hu/Localize.xaml b/.Source/GTweak/Languages/hu/Localize.xaml
index 2d4c6f14..e34d1446 100644
--- a/.Source/GTweak/Languages/hu/Localize.xaml
+++ b/.Source/GTweak/Languages/hu/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Módosítások importálása</v:String>
- <v:String x:Key="wait_import">Ez időbe telik</v:String>
- <v:String x:Key="warn_import">Nem szükséges erőszakkal bezárni az ablakot</v:String>
<v:String x:Key="file_import">Fájl</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/it/Localize.xaml b/.Source/GTweak/Languages/it/Localize.xaml
index bcf5de3e..e21414fa 100644
--- a/.Source/GTweak/Languages/it/Localize.xaml
+++ b/.Source/GTweak/Languages/it/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Importazione delle modifiche</v:String>
- <v:String x:Key="wait_import">Ci vorrà un po' di tempo</v:String>
- <v:String x:Key="warn_import">Non è necessario chiudere forzatamente la finestra</v:String>
<v:String x:Key="file_import">File</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/ko/Localize.xaml b/.Source/GTweak/Languages/ko/Localize.xaml
index b444cf28..da3f2737 100644
--- a/.Source/GTweak/Languages/ko/Localize.xaml
+++ b/.Source/GTweak/Languages/ko/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">조정 가져오기</v:String>
- <v:String x:Key="wait_import">시간이 좀 걸립니다</v:String>
- <v:String x:Key="warn_import">창을 강제로 닫을 필요는 없습니다</v:String>
<v:String x:Key="file_import">파일</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/pl/Localize.xaml b/.Source/GTweak/Languages/pl/Localize.xaml
index 73006acb..e9a99bdf 100644
--- a/.Source/GTweak/Languages/pl/Localize.xaml
+++ b/.Source/GTweak/Languages/pl/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Importowanie poprawek</v:String>
- <v:String x:Key="wait_import">To zajmuje chwilę</v:String>
- <v:String x:Key="warn_import">Nie ma potrzeby zamykać okna na siłę</v:String>
<v:String x:Key="file_import">Plik</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/pt-BR/Localize.xaml b/.Source/GTweak/Languages/pt-BR/Localize.xaml
index 6e41ed41..c0f72ea2 100644
--- a/.Source/GTweak/Languages/pt-BR/Localize.xaml
+++ b/.Source/GTweak/Languages/pt-BR/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Importando ajustes</v:String>
- <v:String x:Key="wait_import">Leva algum tempo</v:String>
- <v:String x:Key="warn_import">Não é necessário fechar a janela à força</v:String>
<v:String x:Key="file_import">Arquivo</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/ru/Localize.xaml b/.Source/GTweak/Languages/ru/Localize.xaml
index c6fc19d2..858a3189 100644
--- a/.Source/GTweak/Languages/ru/Localize.xaml
+++ b/.Source/GTweak/Languages/ru/Localize.xaml
@@ -103,16 +103,17 @@
<!--#region Export Window -->
<v:String x:Key="title_export">Экспорт твиков</v:String>
<v:String x:Key="label_total_export">Общее количество:</v:String>
- <v:String x:Key="title_empty_export">Нечего экспортировать</v:String>
<v:String x:Key="title_loading_export">Чтение конфигурации</v:String>
+ <v:String x:Key="title_empty_export">Нечего экспортировать</v:String>
<v:String x:Key="desc_empty_export">Примените нужные твики в утилите. Все изменения будут сохранены здесь вплоть до самоудаления, и вы сможете экспортировать их в любой момент</v:String>
<!--#endregion-->
<!--#region Import Window -->
<v:String x:Key="title_import">Импорт твиков</v:String>
- <v:String x:Key="wait_import">Это занимает некоторое время</v:String>
- <v:String x:Key="warn_import">Принудительно закрывать окно нет необходимости</v:String>
<v:String x:Key="file_import">Файл</v:String>
+ <v:String x:Key="warn_hint_import">Не закрывайте окно до завершения</v:String>
+ <v:String x:Key="done_import">Импорт завершён</v:String>
+ <v:String x:Key="done_hint_import">Окно закроется автоматически</v:String>
<!--#endregion-->
<!--#region Update Window -->
@@ -227,7 +228,7 @@
<v:String x:Key="chk_IconControlPanel_intf">Панель управления</v:String>
<v:String x:Key="chk_IconUserFiles_intf">Файлы пользователя</v:String>
<v:String x:Key="chk_IconOneDrive_intf">OneDrive</v:String>
-
+
<v:String x:Key="exblock_ThisPCFolders_intf">Отображение папок в «Этом компьютере»:</v:String>
<v:String x:Key="chk_FolderObjects3D_intf">Объемные объекты</v:String>
<v:String x:Key="chk_FolderDesktop_intf">Рабочий стол</v:String>
@@ -236,7 +237,7 @@
<v:String x:Key="chk_FolderPictures_intf">Изображения</v:String>
<v:String x:Key="chk_FolderMusic_intf">Музыка</v:String>
<v:String x:Key="chk_FolderVideo_intf">Видео</v:String>
-
+
<v:String x:Key="tgl_SystemButtonSize_intf">Стандартный размер системных кнопок</v:String>
<v:String x:Key="tgl_CursorFlickerFrequency_intf">Стандартная частота мерцания курсора</v:String>
<v:String x:Key="tgl_ScrollbarSize_intf">Стандартный размер полосы прокрутки</v:String>
@@ -304,7 +305,7 @@
<v:String x:Key="warn_part1_pkg">Приложения удаляются</v:String>
<v:String x:Key="warn_part2_pkg">навсегда,</v:String>
<v:String x:Key="warn_part3_pkg">но OneDrive можно восстановить, нажав на его иконку</v:String>
-
+
<v:String x:Key="OneDrive_pkg">OneDrive</v:String>
<v:String x:Key="MicrosoftStore_pkg">Microsoft Store</v:String>
<v:String x:Key="Xbox_pkg">Microsoft Xbox</v:String>
diff --git a/.Source/GTweak/Languages/sl-SI/Localize.xaml b/.Source/GTweak/Languages/sl-SI/Localize.xaml
index 042e2c6b..91c64b10 100644
--- a/.Source/GTweak/Languages/sl-SI/Localize.xaml
+++ b/.Source/GTweak/Languages/sl-SI/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Uvažanje popravkov</v:String>
- <v:String x:Key="wait_import">To traja nekaj časa</v:String>
- <v:String x:Key="warn_import">Okna ni treba prisilno zapreti</v:String>
<v:String x:Key="file_import">Datoteka</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/th/Localize.xaml b/.Source/GTweak/Languages/th/Localize.xaml
index 23fe0262..33246368 100644
--- a/.Source/GTweak/Languages/th/Localize.xaml
+++ b/.Source/GTweak/Languages/th/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">กำลังนำเข้าการปรับแต่ง</v:String>
- <v:String x:Key="wait_import">อาจใช้เวลาสักครู่</v:String>
- <v:String x:Key="warn_import">ไม่จำเป็นต้องบังคับปิดหน้าต่าง</v:String>
<v:String x:Key="file_import">ไฟล์</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/tr/Localize.xaml b/.Source/GTweak/Languages/tr/Localize.xaml
index 0b7eb3cd..9d1a77ca 100644
--- a/.Source/GTweak/Languages/tr/Localize.xaml
+++ b/.Source/GTweak/Languages/tr/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Ayarlar içe aktarılıyor</v:String>
- <v:String x:Key="wait_import">Bu biraz zaman alabilir</v:String>
- <v:String x:Key="warn_import">Lütfen pencereyi zorla kapatmayın</v:String>
<v:String x:Key="file_import">Dosya</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/uk/Localize.xaml b/.Source/GTweak/Languages/uk/Localize.xaml
index 77fcc577..0b4d9a27 100644
--- a/.Source/GTweak/Languages/uk/Localize.xaml
+++ b/.Source/GTweak/Languages/uk/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">Імпорт налаштувань</v:String>
- <v:String x:Key="wait_import">На це потрібен деякий час</v:String>
- <v:String x:Key="warn_import">Немає потреби примусово закривати вікно</v:String>
<v:String x:Key="file_import">Файл</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/zh-CN/Localize.xaml b/.Source/GTweak/Languages/zh-CN/Localize.xaml
index 657e6fde..2c85f481 100644
--- a/.Source/GTweak/Languages/zh-CN/Localize.xaml
+++ b/.Source/GTweak/Languages/zh-CN/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">正在导入配置</v:String>
- <v:String x:Key="wait_import">这需要一些时间</v:String>
- <v:String x:Key="warn_import">请勿强行关闭此窗口</v:String>
<v:String x:Key="file_import">文件</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Languages/zh-TW/Localize.xaml b/.Source/GTweak/Languages/zh-TW/Localize.xaml
index 9e64ab74..3e33648b 100644
--- a/.Source/GTweak/Languages/zh-TW/Localize.xaml
+++ b/.Source/GTweak/Languages/zh-TW/Localize.xaml
@@ -110,9 +110,10 @@
<!--#region Import Window -->
<v:String x:Key="title_import">匯入調整項目</v:String>
- <v:String x:Key="wait_import">需要一些時間</v:String>
- <v:String x:Key="warn_import">無需強制關閉視窗</v:String>
<v:String x:Key="file_import">檔案</v:String>
+ <v:String x:Key="warn_hint_import">Do not close the window until finished</v:String>
+ <v:String x:Key="done_import">Import completed</v:String>
+ <v:String x:Key="done_hint_import">The window will close automatically</v:String>
<!--#endregion-->
<!--#region Update Window -->
diff --git a/.Source/GTweak/Properties/AssemblyInfo.cs b/.Source/GTweak/Properties/AssemblyInfo.cs
index ffff74cc..c8820301 100644
--- a/.Source/GTweak/Properties/AssemblyInfo.cs
+++ b/.Source/GTweak/Properties/AssemblyInfo.cs
@@ -5,11 +5,11 @@ using System.Windows;
[assembly: AssemblyTitle("GTweak")]
[assembly: AssemblyDescription("Portable Tool for an Ideal Windows Setup")]
[assembly: AssemblyProduct("GTweak")]
-[assembly: AssemblyCopyright("© 2024-2026 Greedeks")]
+[assembly: AssemblyCopyright("� 2024-2026 Greedeks")]
[assembly: AssemblyTrademark("Greedeks")]
-[assembly: AssemblyInformationalVersion("Build: 5.5.4")]
-[assembly: AssemblyVersion("5.5.56.281")]
-[assembly: AssemblyFileVersion("5.5.56.281")]
+[assembly: AssemblyInformationalVersion("Build: 5.5.5")]
+[assembly: AssemblyVersion("5.5.32.111")]
+[assembly: AssemblyFileVersion("5.5.32.111")]
[assembly: ComVisible(false)]
diff --git a/.Source/GTweak/Properties/AssemblyInfo.tt b/.Source/GTweak/Properties/AssemblyInfo.tt
index b1f14df1..6a74b2fd 100644
--- a/.Source/GTweak/Properties/AssemblyInfo.tt
+++ b/.Source/GTweak/Properties/AssemblyInfo.tt
@@ -22,7 +22,7 @@ using System.Windows;
[assembly: AssemblyMetadata("RepositoryType", "git")]
<#+
- private const string majorVersion = "Build: 5.5.3";
+ private const string majorVersion = "Build: 5.5.5";
private string GenerateVersion()
{
diff --git a/.Source/GTweak/Windows/ImportWindow.xaml b/.Source/GTweak/Windows/ImportWindow.xaml
index d0b28509..50268dc6 100644
--- a/.Source/GTweak/Windows/ImportWindow.xaml
+++ b/.Source/GTweak/Windows/ImportWindow.xaml
@@ -1,57 +1,143 @@
-<ui:FluentWindow x:Class="GTweak.Windows.ImportWindow"
+<ui:FluentWindow x:Class="GTweak.Windows.ImportWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
+ xmlns:anim="clr-namespace:GTweak.Animations"
+ xmlns:manager="clr-namespace:GTweak.Modules.Managers"
xmlns:local="clr-namespace:GTweak.Windows"
- mc:Ignorable="d" Icon="/GTweak.ico"
- Background="Transparent" WindowStyle="None" IsTabStop="False" SnapsToDevicePixels="True" UseLayoutRounding="True" ShowInTaskbar="False" KeyboardNavigation.TabNavigation="None"
- ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica" SizeToContent="Width" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
- Title="GTweak" Topmost="True" MinHeight="135" MinWidth="310" MaxHeight="135" MaxWidth="380" ContentRendered="Window_ContentRendered">
+ mc:Ignorable="d" Icon="/GTweak.ico" Title="{DynamicResource title_import}" Background="Transparent" WindowStyle="None" IsTabStop="False"
+ SnapsToDevicePixels="True" UseLayoutRounding="True" ShowInTaskbar="False" KeyboardNavigation.TabNavigation="None" ExtendsContentIntoTitleBar="True"
+ WindowBackdropType="Mica" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
+ Topmost="True" SizeToContent="Width" MinHeight="170" MaxHeight="170" MinWidth="360" MaxWidth="520" ContentRendered="Window_ContentRendered">
<Grid Background="{StaticResource Brush_Background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
- <Grid x:Name="TitleBar" Grid.Row="0" MouseDown="TitleBar_MouseDown" Background="Transparent">
- <DockPanel VerticalAlignment="Center" HorizontalAlignment="Left" LastChildFill="True" Height="48">
- <ui:SymbolIcon Symbol="DocumentArrowDown16" FontSize="20px" Foreground="{StaticResource Brush_Accent}" Margin="10,5,0,0" HorizontalAlignment="Center"/>
- <Viewbox Stretch="None">
- <TextBlock Text="{DynamicResource title_import}" Style="{StaticResource TextDefault}" FontSize="18px" Margin="5,0,50,0"/>
- </Viewbox>
+ <Grid x:Name="TitleBar" Grid.Row="0" Height="38" MouseDown="TitleBar_MouseDown" Background="Transparent">
+ <DockPanel HorizontalAlignment="Left" LastChildFill="True" VerticalAlignment="Center" Margin="14,0,14,0">
+ <ui:SymbolIcon Symbol="DocumentArrowDown20" FontSize="16" Foreground="{StaticResource Brush_Accent}" VerticalAlignment="Center"/>
+ <TextBlock Text="{DynamicResource title_import}" Style="{StaticResource TextDefault}" FontSize="14" Margin="8,0,0,0" VerticalAlignment="Center"/>
</DockPanel>
</Grid>
- <Grid Grid.Row="1" Margin="0,0,0,10">
- <StackPanel Orientation="Vertical">
- <TextBlock Text="{DynamicResource warn_import}" Foreground="{StaticResource Brush_Inactive}" Height="auto" Width="auto" FontFamily="{StaticResource Jura}" FontSize="13px" HorizontalAlignment="Left" TextAlignment="Center" Margin="10,0,10,0"/>
- <StackPanel Orientation="Horizontal">
- <ui:ProgressRing Margin="10,10,0,0" Width="25" Height="25" Foreground="{StaticResource Brush_Accent}" IsIndeterminate="True"/>
- <TextBlock Foreground="{StaticResource Brush_Highlighted}" Height="auto" Width="auto" FontFamily="{StaticResource Jura}" FontSize="13px" Margin="10,10,0,0" HorizontalAlignment="Left" TextAlignment="Center" VerticalAlignment="Center">
- <Run Text="{DynamicResource wait_import}" /><Run x:Name="DotRun" Text="" />
- <TextBlock.Triggers>
- <EventTrigger RoutedEvent="FrameworkElement.Loaded">
- <BeginStoryboard>
- <Storyboard Timeline.DesiredFrameRate="60" RepeatBehavior="Forever" Duration="0:0:0.8">
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DotRun" Storyboard.TargetProperty="Text">
- <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="" />
- <DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="." />
- <DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value=".." />
- <DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="..." />
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </TextBlock.Triggers>
+ <Border Grid.Row="0" Height="1" VerticalAlignment="Bottom" Background="{StaticResource Brush_Separator}" Opacity="0.4"/>
+
+ <Grid Grid.Row="1">
+ <Grid x:Name="PanelProgress" Margin="15,12,15,15">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+
+ <Grid Grid.Row="0" Margin="0,0,0,8">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Grid.Column="0" Text="{DynamicResource file_import}" Foreground="{StaticResource Brush_Inactive}" FontFamily="{StaticResource Jura}" FontSize="11" VerticalAlignment="Center" Margin="0,0,8,0"/>
+
+ <Border Grid.Column="1" Background="{StaticResource Brush_Background_Card}" BorderBrush="{StaticResource Brush_Separator}" BorderThickness="1" CornerRadius="6" Padding="7,3">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <ui:SymbolIcon Grid.Column="0" Symbol="DocumentCheckmark20" FontSize="12" Foreground="{StaticResource Brush_Accent}" Margin="0,0,5,0" VerticalAlignment="Center"/>
+ <TextBlock Grid.Column="1" x:Name="ImportedFile" FontFamily="{StaticResource Jura}" FontSize="11" FontWeight="Medium" Foreground="{StaticResource Brush_Accent}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" VerticalAlignment="Center" MaxWidth="260"/>
+ </Grid>
+ </Border>
+ </Grid>
+
+ <Grid Grid.Row="1" Margin="0,0,0,6">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+
+ <TextBlock x:Name="SectionLabel" Grid.Column="0" VerticalAlignment="Bottom" FontFamily="{StaticResource Jura}" FontSize="12" FontWeight="Medium" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,10,0">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding CurrentSection, RelativeSource={RelativeSource AncestorType=local:ImportWindow}}" Value="{x:Static manager:JsonConfigManager+Section.Confidentiality}">
+ <Setter Property="Text" Value="{DynamicResource rbtn_conf_main}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding CurrentSection, RelativeSource={RelativeSource AncestorType=local:ImportWindow}}" Value="{x:Static manager:JsonConfigManager+Section.Interface}">
+ <Setter Property="Text" Value="{DynamicResource rbtn_int_main}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding CurrentSection, RelativeSource={RelativeSource AncestorType=local:ImportWindow}}" Value="{x:Static manager:JsonConfigManager+Section.Packages}">
+ <Setter Property="Text" Value="{DynamicResource rbtn_app_main}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding CurrentSection, RelativeSource={RelativeSource AncestorType=local:ImportWindow}}" Value="{x:Static manager:JsonConfigManager+Section.Services}">
+ <Setter Property="Text" Value="{DynamicResource rbtn_svc_main}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding CurrentSection, RelativeSource={RelativeSource AncestorType=local:ImportWindow}}" Value="{x:Static manager:JsonConfigManager+Section.System}">
+ <Setter Property="Text" Value="{DynamicResource rbtn_sys_main}"/>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
</TextBlock>
- </StackPanel>
- <TextBlock Foreground="{StaticResource Brush_Inactive}" Height="auto" Width="auto" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" FontFamily="{StaticResource Jura}" FontSize="12px" HorizontalAlignment="Left" TextAlignment="Center" Margin="10,10,0,0">
- <Run Text="{DynamicResource file_import}"/>
- <Run Text="“"/><Run x:Name="ImportedFile" Text="The imported file" Foreground="{StaticResource Brush_Accent}"/><Run Text="”"/>
- </TextBlock>
+
+ <Grid Grid.Column="1" VerticalAlignment="Bottom">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <TextBlock Grid.Column="0" x:Name="PercentLabel" anim:NumberAnimation.Value="0" FontFamily="{StaticResource Jura}" FontSize="15" FontWeight="Medium" Foreground="{StaticResource Brush_Accent}"/>
+ <TextBlock Grid.Column="1" Text="%" FontFamily="{StaticResource Jura}" FontSize="15" FontWeight="Medium" Foreground="{StaticResource Brush_Accent}" VerticalAlignment="Bottom" Margin="1,0,0,1"/>
+ </Grid>
+ </Grid>
+
+ <Grid Grid.Row="2" x:Name="ProgressTrack" Height="3" Margin="0,0,0,6">
+ <Border Background="{StaticResource Brush_Separator}" CornerRadius="1.5"/>
+ <Border x:Name="ProgressFill" HorizontalAlignment="Left" CornerRadius="1.5" Width="0" Background="{StaticResource Brush_Accent}"/>
+ </Grid>
+
+ <Grid Grid.Row="3" x:Name="SegmentsGrid" Margin="0,0,0,20">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="4"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="4"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="4"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="4"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+
+ <Border Grid.Column="0" Height="2" CornerRadius="1" Background="{StaticResource Brush_Accent}"/>
+ <Border Grid.Column="2" Height="2" CornerRadius="1" Background="{StaticResource Brush_Separator}"/>
+ <Border Grid.Column="4" Height="2" CornerRadius="1" Background="{StaticResource Brush_Separator}"/>
+ <Border Grid.Column="6" Height="2" CornerRadius="1" Background="{StaticResource Brush_Separator}"/>
+ <Border Grid.Column="8" Height="2" CornerRadius="1" Background="{StaticResource Brush_Separator}"/>
+ </Grid>
+
+ <Grid Grid.Row="4">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <ui:SymbolIcon Grid.Column="0" Symbol="Info16" FontSize="12" Foreground="{StaticResource Brush_Inactive}" Margin="0,0,5,0" VerticalAlignment="Center"/>
+ <TextBlock Grid.Column="1" Text="{DynamicResource warn_hint_import}" Foreground="{StaticResource Brush_Inactive}" FontFamily="{StaticResource Jura}" FontSize="11" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"/>
+ </Grid>
+ </Grid>
+
+ <StackPanel x:Name="PanelDone" Visibility="Collapsed" Opacity="0" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20">
+ <Border Width="38" Height="38" CornerRadius="19" BorderBrush="{StaticResource Brush_Accent}" BorderThickness="1.5" HorizontalAlignment="Center" Margin="0,0,0,10">
+ <ui:SymbolIcon Symbol="Checkmark16" FontSize="16" Foreground="{StaticResource Brush_Accent}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+ </Border>
+ <TextBlock Text="{DynamicResource done_import}" FontFamily="{StaticResource Jura}" FontSize="14" FontWeight="Medium" Foreground="{StaticResource Brush_Highlighted}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Center" Margin="0,0,0,4"/>
+ <TextBlock Text="{DynamicResource done_hint_import}" FontFamily="{StaticResource Jura}" FontSize="11" Foreground="{StaticResource Brush_Inactive}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Grid>
-</ui:FluentWindow>
+</ui:FluentWindow>
\ No newline at end of file
diff --git a/.Source/GTweak/Windows/ImportWindow.xaml.cs b/.Source/GTweak/Windows/ImportWindow.xaml.cs
index 870d6018..c2f52d10 100644
--- a/.Source/GTweak/Windows/ImportWindow.xaml.cs
+++ b/.Source/GTweak/Windows/ImportWindow.xaml.cs
@@ -3,7 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
using System.Windows.Input;
+using System.Windows.Media;
+using GTweak.Animations;
using GTweak.Modules.Common;
using GTweak.Modules.Extensions;
using GTweak.Modules.Managers;
@@ -16,6 +20,15 @@ namespace GTweak.Windows
{
public partial class ImportWindow : FluentWindow, IDisposable
{
+ internal static readonly DependencyProperty CurrentSectionProperty =
+ DependencyProperty.Register(nameof(CurrentSection), typeof(JsonConfigManager.Section), typeof(ImportWindow), new PropertyMetadata(JsonConfigManager.Section.Confidentiality, OnCurrentSectionChanged));
+
+ internal JsonConfigManager.Section CurrentSection
+ {
+ get => (JsonConfigManager.Section)GetValue(CurrentSectionProperty);
+ set => SetValue(CurrentSectionProperty, value);
+ }
+
private readonly ConfidentialityTweaks _confTweaks = new ConfidentialityTweaks();
private readonly InterfaceTweaks _intfTweaks = new InterfaceTweaks();
private readonly ServicesTweaks _svcTweaks = new ServicesTweaks();
@@ -24,8 +37,14 @@ namespace GTweak.Windows
private readonly BackgroundQueueManager _backgroundQueue = new BackgroundQueueManager();
private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
private readonly HashSet<NotificationManager.AlertType> _pendingAlerts = new HashSet<NotificationManager.AlertType>();
+ private readonly object _shellLock = new object();
private ExplorerManager.ShellType _shellType = ExplorerManager.ShellType.None;
- private bool _defenderDisabled = false;
+ private bool _defenderDisabled = false, _isCompleted = false;
+
+ private Brush BrushDone => (Brush)FindResource("Brush_Background_Labels");
+ private Brush BrushActive => (Brush)FindResource("Brush_Accent");
+ private Brush BrushInactive => (Brush)FindResource("Brush_Separator");
+
public ImportWindow(in string importedFile)
{
@@ -33,50 +52,43 @@ namespace GTweak.Windows
ImportedFile.Text = importedFile;
}
- private void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
+ private static void OnCurrentSectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
- if (e?.LeftButton == MouseButtonState.Pressed)
+ if (d is ImportWindow window && e.NewValue is JsonConfigManager.Section section)
{
- DragMove();
+ window.ActivateSegment((int)section);
}
}
private async void Window_ContentRendered(object sender, EventArgs e)
{
Progress<byte> progress = new Progress<byte>(ReportProgress);
- try
- {
- await ApplyTweaksWithProgress(_cancellationTokenSource.Token, progress);
- }
- catch (Exception ex)
- {
- ErrorLogger.LogDebug(ex);
- }
+ try { await ApplyTweaksWithProgress(_cancellationTokenSource.Token, progress); }
+ catch (Exception ex) { ErrorLogger.LogDebug(ex); }
}
- private void ReportProgress(byte valueProgress)
+ private void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
{
- if (valueProgress == 100)
+ if (e?.LeftButton == MouseButtonState.Pressed)
{
- if (_defenderDisabled)
- {
- NotificationManager.Warn("warn_wd_noty").Perform();
- }
- else
- {
- ExplorerManager.Handle(_shellType);
+ DragMove();
+ }
+ }
- if (_pendingAlerts.Count != 0)
- {
- NotificationManager.Default().Perform(_pendingAlerts.Max());
- }
- }
+ private async void ReportProgress(byte valueProgress)
+ {
+ AnimateProgressBar(valueProgress);
+ NumberAnimation.SetValue(PercentLabel, valueProgress);
- App.UpdateImport();
- Close();
+ if (valueProgress >= 100 && !_isCompleted)
+ {
+ _isCompleted = true;
+ await ShowDoneState();
}
}
+ private void ReportSection(JsonConfigManager.Section section) => Dispatcher.Invoke(() => CurrentSection = section);
+
private async Task ApplyTweaksWithProgress(CancellationToken token, IProgress<byte> progress)
{
JObject configRoot = JsonConfigManager.Load(string.IsNullOrWhiteSpace(PathTargets.Files.Config) ? PathTargets.Files.BackupConfig : PathTargets.Files.Config);
@@ -88,21 +100,16 @@ namespace GTweak.Windows
}
bool shouldRemoveWebView = false;
- if (configRoot[JsonConfigManager.Section.Packages.ToString()] is JObject packages)
+ if (configRoot[JsonConfigManager.Section.Packages.ToString()] is JObject packages && packages["EdgeWebView"] is JValue jvalue && jvalue.Type == JTokenType.Boolean)
{
- if (packages["EdgeWebView"] is JValue jvalue && jvalue.Type == JTokenType.Boolean)
- {
- shouldRemoveWebView = (bool)jvalue;
- }
+ shouldRemoveWebView = (bool)jvalue;
}
var tweaksToApply = new List<(JsonConfigManager.Section Section, string Tweak, string Value)>();
(JsonConfigManager.Section Section, string Tweak, string Value)? defenderEntry = null;
- JsonConfigManager.Section[] sections = (JsonConfigManager.Section[])Enum.GetValues(typeof(JsonConfigManager.Section));
- for (int i = 0; i < sections.Length; i++)
+ foreach (JsonConfigManager.Section section in (JsonConfigManager.Section[])Enum.GetValues(typeof(JsonConfigManager.Section)))
{
- JsonConfigManager.Section section = sections[i];
if (configRoot[section.ToString()] is JObject sectionObj && sectionObj.HasValues)
{
foreach (JProperty prop in sectionObj.Properties())
@@ -130,19 +137,30 @@ namespace GTweak.Windows
}
int totalTweaks = tweaksToApply.Count;
- int appliedTweaks = 0;
-
if (totalTweaks == 0)
{
progress.Report(100);
return;
}
+ int appliedTweaks = 0;
+
+ void ReportStep()
+ {
+ int current = Interlocked.Increment(ref appliedTweaks);
+ progress.Report((byte)Math.Min(98, (int)((double)current / totalTweaks * 100)));
+ }
+
for (int i = 0; i < tweaksToApply.Count; i++)
{
token.ThrowIfCancellationRequested();
- (JsonConfigManager.Section section, string tweak, string value) = tweaksToApply[i];
+ var (section, tweak, value) = tweaksToApply[i];
+
+ if (i == 0 || tweaksToApply[i - 1].Section != section)
+ {
+ ReportSection(section);
+ }
try
{
@@ -150,6 +168,9 @@ namespace GTweak.Windows
{
_confTweaks.Apply(tweak, Convert.ToBoolean(value));
AddPostAction(tweak.GetPostAction(typeof(ConfidentialityTweaks.Toggle)));
+
+ ReportStep();
+ await Task.Delay(200, token);
}
else if (section == JsonConfigManager.Section.Interface)
{
@@ -167,21 +188,61 @@ namespace GTweak.Windows
_intfTweaks.Apply(tweak, Convert.ToBoolean(value));
AddPostAction(tweak.GetPostAction(typeof(InterfaceTweaks.Toggle)));
}
+
+ ReportStep();
+ await Task.Delay(200, token);
+ }
+ else if (section == JsonConfigManager.Section.Packages)
+ {
+ bool packageState = Convert.ToBoolean(value);
+
+ if (tweak == "OneDrive")
+ {
+ if (packageState)
+ {
+ await AppxPackageHandler.RemoveAppxPackage("OneDrive");
+ }
+ else
+ {
+ await AppxPackageHandler.RestoreOneDriveFolder();
+ }
+ }
+ else if (tweak == "Edge")
+ {
+ if (packageState)
+ {
+ await AppxPackageHandler.RemoveAppxPackage("Edge", shouldRemoveWebView);
+ }
+ }
+ else if (packageState)
+ {
+ await AppxPackageHandler.RemoveAppxPackage(tweak);
+ }
+
+ if (PackageStorage.PackagesDetails.TryGetValue(tweak, out var details))
+ {
+ if (details.ShellType > _shellType)
+ {
+ _shellType = details.ShellType;
+ }
+ }
+
+ ReportStep();
}
else if (section == JsonConfigManager.Section.Services)
{
_svcTweaks.Apply(tweak, Convert.ToBoolean(value));
_pendingAlerts.Add(NotificationManager.AlertType.Restart);
+
+ ReportStep();
+ await Task.Delay(200, token);
}
else if (section == JsonConfigManager.Section.System)
{
if (tweak == nameof(SystemTweaks.Toggle.WindowsDefender))
{
- await _backgroundQueue.QueueTask(delegate
- {
- _sysTweaks.Apply(tweak, Convert.ToBoolean(value), false);
- });
_defenderDisabled = !Convert.ToBoolean(value);
+ await Task.Run(() => _sysTweaks.Apply(tweak, Convert.ToBoolean(value), false), token);
}
else if (Enum.TryParse<SystemTweaks.Slider>(tweak, out _))
{
@@ -192,54 +253,22 @@ namespace GTweak.Windows
_sysTweaks.Apply(tweak, Convert.ToBoolean(value));
AddPostAction(tweak.GetPostAction(typeof(SystemTweaks.Toggle)));
}
- }
- else if (section == JsonConfigManager.Section.Packages)
- {
- bool packageState = Convert.ToBoolean(value);
-
- await _backgroundQueue.QueueTask(async () =>
- {
- if (tweak == "OneDrive")
- {
- if (packageState)
- {
- await AppxPackageHandler.RemoveAppxPackage("OneDrive");
- }
- else
- {
- await AppxPackageHandler.RestoreOneDriveFolder();
- }
- }
- else if (tweak == "Edge")
- {
- if (packageState)
- {
- await AppxPackageHandler.RemoveAppxPackage("Edge", shouldRemoveWebView);
- }
- }
- else if (packageState)
- {
- await AppxPackageHandler.RemoveAppxPackage(tweak);
- }
- });
- if (PackageStorage.PackagesDetails.TryGetValue(tweak, out var details) && details.ShellType > _shellType)
- {
- _shellType = details.ShellType;
- }
+ ReportStep();
+ await Task.Delay(200, token);
}
}
catch (Exception ex)
{
ErrorLogger.LogDebug(ex);
+ ReportStep();
}
-
- appliedTweaks++;
- progress.Report((byte)((double)appliedTweaks / totalTweaks * 100));
- await Task.Delay(700, token);
}
- await _backgroundQueue.WaitForCompletion();
+ if (tweaksToApply.Any(t => t.Section == JsonConfigManager.Section.Packages))
+ {
+ await Task.Run(() => new AppxPackageHandler().GetInstalledPackages());
+ }
progress.Report(100);
}
@@ -262,6 +291,71 @@ namespace GTweak.Windows
}
}
+ private void ActivateSegment(int activeIndex)
+ {
+ int index = 0;
+ foreach (Border seg in SegmentsGrid.Children.OfType<Border>())
+ {
+ Brush targetBrush = index < activeIndex ? BrushDone : (index == activeIndex ? BrushActive : BrushInactive);
+
+ if (!Equals(seg.Background, targetBrush))
+ {
+ seg.BeginAnimation(Border.BackgroundProperty, new BrushAnimation
+ {
+ From = seg.Background,
+ To = targetBrush,
+ Duration = TimeSpan.FromMilliseconds(250)
+ });
+ }
+
+ index++;
+ }
+ }
+
+ private void AnimateProgressBar(double targetPercent)
+ {
+ double trackWidth = ProgressTrack.ActualWidth > 0 ? ProgressTrack.ActualWidth : 340;
+ ProgressFill.BeginAnimation(WidthProperty, AnimationFactory.CreateIn(ProgressFill.ActualWidth, (double)Math.Min(trackWidth, trackWidth * (targetPercent / 100.0)), 0.45, useCubicEase: true));
+ }
+
+ private async Task ShowDoneState()
+ {
+ ActivateSegment(int.MaxValue);
+
+ await Task.Delay(550);
+
+ TaskCompletionSource<bool> fadeOutTcs = new TaskCompletionSource<bool>();
+ PanelProgress.BeginAnimation(UIElement.OpacityProperty, AnimationFactory.CreateIn(1.0, 0.0, 0.25, () => fadeOutTcs.TrySetResult(true)));
+ await fadeOutTcs.Task;
+
+ PanelProgress.Visibility = Visibility.Collapsed;
+ PanelDone.Opacity = 0.0;
+ PanelDone.Visibility = Visibility.Visible;
+
+ TaskCompletionSource<bool> fadeInTcs = new TaskCompletionSource<bool>();
+ PanelDone.BeginAnimation(UIElement.OpacityProperty, AnimationFactory.CreateIn(0.0, 1.0, 0.3, () => fadeInTcs.TrySetResult(true)));
+ await fadeInTcs.Task;
+
+ await Task.Delay(2000);
+
+ if (_defenderDisabled)
+ {
+ NotificationManager.Warn("warn_wd_noty").Perform();
+ }
+ else
+ {
+ ExplorerManager.Handle(_shellType);
+
+ if (_pendingAlerts.Count != 0)
+ {
+ NotificationManager.Default().Perform(_pendingAlerts.Max());
+ }
+ }
+
+ App.UpdateImport();
+ Close();
+ }
+
public void Dispose()
{
_cancellationTokenSource.Cancel();