Skip to content

Commit 38d7a5c

Browse files
committed
Add option to hide package illustrations
1 parent 124cb9b commit 38d7a5c

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎src/Languages/lang_en.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@
487487
"Close UniGetUI to the system tray": "Close UniGetUI to the system tray",
488488
"Manage UniGetUI autostart behaviour": "Manage UniGetUI autostart behaviour",
489489
"Show package icons on package lists": "Show package icons on package lists",
490+
"Show illustrations on package lists": "Show illustrations on package lists",
490491
"Clear cache": "Clear cache",
491492
"Select upgradable packages by default": "Select upgradable packages by default",
492493
"Light": "Light",

‎src/UniGetUI.Avalonia/ViewModels/SoftwarePages/PackagesPageViewModel.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ partial void OnIsFilterPaneOpenChanged(bool value)
138138
private readonly string _noPackagesSubtitleBase;
139139
private readonly string _stillLoadingSubtitle;
140140
private readonly bool _showLastCheckedTime;
141+
private readonly bool _showPackageIllustrations;
141142
private DateTime _lastLoadTime = DateTime.Now;
142143

143144
protected AbstractPackageLoader Loader;
@@ -219,9 +220,10 @@ public PackagesPageViewModel(PackagesPageData data)
219220
DisableReload = data.DisableReload;
220221
LoadsOnStart = !data.DisableAutomaticPackageLoadOnStart;
221222
_showLastCheckedTime = data.ShowLastLoadTime;
223+
_showPackageIllustrations = !Settings.Get(Settings.K.DisablePackageIllustrations);
222224
NoPackagesText = data.NoPackages_BackgroundText;
223225
NoMatchesText = data.NoMatches_BackgroundText;
224-
if (!string.IsNullOrEmpty(data.NoPackages_ImagePath))
226+
if (_showPackageIllustrations && !string.IsNullOrEmpty(data.NoPackages_ImagePath))
225227
{
226228
using var stream = AssetLoader.Open(new Uri(data.NoPackages_ImagePath));
227229
NoPackagesImage = new Bitmap(stream);
@@ -561,7 +563,7 @@ public void FilterPackages(bool fromQuery = false)
561563
{
562564
BackgroundText = _stillLoadingSubtitle;
563565
BackgroundTextVisible = true;
564-
LoadingImageVisible = true;
566+
LoadingImageVisible = _showPackageIllustrations;
565567
NoPackagesImageVisible = false;
566568
}
567569
else if (FilteredPackages.Count == 0)

‎src/UniGetUI.Avalonia/Views/Pages/SettingsPages/Interface_P.axaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@
8080
StateChangedCommand="{Binding ShowRestartRequiredCommand}"
8181
CornerRadius="8,8,0,0"/>
8282

83+
<settings:CheckboxCard SettingName="DisablePackageIllustrations"
84+
Text="{t:Translate Show illustrations on package lists}"
85+
WarningText="{t:Translate Restart UniGetUI to apply this change}"
86+
StateChangedCommand="{Binding ShowRestartRequiredCommand}"
87+
CornerRadius="0"
88+
BorderThickness="1,0,1,1"/>
89+
8390
<settings:ButtonCard x:Name="ResetIconCache"
8491
CornerRadius="0,0,8,8"
8592
BorderThickness="1,0,1,1"

‎src/UniGetUI.Core.Settings/SettingsEngine_Names.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public enum K
4545
DisableWinGetMalfunctionDetector,
4646
EnableBackupTimestamping,
4747
DisableIconsOnPackageLists,
48+
DisablePackageIllustrations,
4849
ProxyURL,
4950
ProxyUsername,
5051
PreferredLanguage,
@@ -156,6 +157,7 @@ public static string ResolveKey(K key)
156157
K.DisableWinGetMalfunctionDetector => "DisableWinGetMalfunctionDetector",
157158
K.EnableBackupTimestamping => "EnableBackupTimestamping",
158159
K.DisableIconsOnPackageLists => "DisableIconsOnPackageLists",
160+
K.DisablePackageIllustrations => "DisablePackageIllustrations",
159161
K.ProxyURL => "ProxyURL",
160162
K.ProxyUsername => "ProxyUsername",
161163
K.PreferredLanguage => "PreferredLanguage",

0 commit comments

Comments
 (0)