Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed May 19, 2024
1 parent 85ce52d commit fdfadea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
16 changes: 11 additions & 5 deletions src/UniGetUI/Interface/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ IntPtr GetForWindow([System.Runtime.InteropServices.In] IntPtr appWindow,
void ShowShareUIForWindow(IntPtr appWindow);
}

TaskbarIcon TrayIcon;
TaskbarIcon? TrayIcon;
private bool RecentlyActivated = false;

static readonly Guid _dtm_iid =
Expand All @@ -55,6 +55,7 @@ IntPtr GetForWindow([System.Runtime.InteropServices.In] IntPtr appWindow,
public List<ContentDialog> DialogQueue = new();

public List<NavButton> NavButtonList = new();
#pragma warning disable CS8618
public MainWindow()
{
InitializeComponent();
Expand All @@ -76,7 +77,7 @@ public MainWindow()
LoadingSthDalog.Title = CoreTools.Translate("Please wait");
LoadingSthDalog.Content = new ProgressBar() { IsIndeterminate = true, Width = 300 };
}

#pragma warning restore CS8618
public void HandleNotificationActivation(ToastArguments args, ValueSet input)
{
if (args.Contains("action") && args["action"] == "updateAll")
Expand Down Expand Up @@ -275,14 +276,19 @@ public void UpdateSystemTrayStatus()
else
tooltip = CoreTools.Translate("{0} updates are available").Replace("{0}", MainApp.Instance.TooltipStatus.AvailableUpdates.ToString()) + " - " + Title;
}
if(TrayIcon == null)
{
Logger.Warn("Attempting to update a null taskbar icon tray, aborting!");
return;
}

TrayIcon.ToolTipText = tooltip;

ApplicationTheme theme = ApplicationTheme.Light;
string RegistryKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
string RegistryValueName = "SystemUsesLightTheme";
RegistryKey key = Registry.CurrentUser.OpenSubKey(RegistryKeyPath);
object registryValueObject = key?.GetValue(RegistryValueName);
RegistryKey? key = Registry.CurrentUser.OpenSubKey(RegistryKeyPath);
object? registryValueObject = key?.GetValue(RegistryValueName) ?? null;
if (registryValueObject != null)
{
int registryValue = (int)registryValueObject;
Expand All @@ -294,7 +300,7 @@ public void UpdateSystemTrayStatus()
modifier += "_white";


string FullIconPath = Path.Join(Directory.GetParent(Assembly.GetEntryAssembly().Location).ToString(), "\\Assets\\Images\\tray" + modifier + ".ico");
string FullIconPath = Path.Join(CoreData.UniGetUIExecutableDirectory, "\\Assets\\Images\\tray" + modifier + ".ico");

TrayIcon.SetValue(TaskbarIcon.IconSourceProperty, new BitmapImage() { UriSource = new Uri(FullIconPath) });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
VerticalContentAlignment="Center"
/>
<Button Grid.Column="1" x:Name="FindButton" CornerRadius="0,4,4,0" x:FieldModifier="protected"
Height="32" Width="30" Padding="4" AutomationProperties.HelpText="Search">
Height="32" Width="32" Padding="4" AutomationProperties.HelpText="Search">
<AnimatedIcon>
<AnimatedIcon.Source>
<animatedvisuals:AnimatedFindVisualSource/>
Expand Down Expand Up @@ -880,7 +880,7 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="MegaQueryBlock" x:FieldModifier="protected" Grid.Column="1" Grid.Row="1"
CornerRadius="12,0,0,12" FontSize="40" Padding="20,12,10,13" FontWeight="SemiBold"/>
CornerRadius="12,0,0,12" FontSize="40" Padding="20,11,10,11" FontWeight="SemiBold"/>
<Button Grid.Column="2" Grid.Row="1" x:Name="MegaFindButton" CornerRadius="0,12,12,0" x:FieldModifier="protected"
Height="80" Width="80" Padding="12" AutomationProperties.HelpText="Search">
<AnimatedIcon>
Expand Down
2 changes: 1 addition & 1 deletion src/UniGetUI/Interface/SoftwarePages/PackageBundle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@
VerticalContentAlignment="Center"
/>
<Button Grid.Column="1" x:Name="FindButton" CornerRadius="0,4,4,0"
Height="32" Width="30" Padding="4" AutomationProperties.HelpText="Search">
Height="32" Width="32" Padding="4" AutomationProperties.HelpText="Search">
<AnimatedIcon>
<AnimatedIcon.Source>
<animatedvisuals:AnimatedFindVisualSource/>
Expand Down

0 comments on commit fdfadea

Please sign in to comment.