Skip to content

Commit

Permalink
Fix minimize to tray issue
Browse files Browse the repository at this point in the history
also updated readme.txt and settings page to provide more clarity.
  • Loading branch information
Timthreetwelve committed Jan 22, 2023
1 parent d38f3bd commit 6d77a5a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 34 deletions.
4 changes: 2 additions & 2 deletions GetMyIP/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private async void Window_ContentRendered(object sender, EventArgs e)

await ExternalInfo.GetExtInfo();

BuildToolTip();
MinimizeToTray(UserSettings.Setting.MinimizeToTray);
}

private void Window_StateChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -794,7 +794,7 @@ public void BuildToolTip()
{
_ = sb.AppendLine(AppInfo.AppProduct);
}
_log.Debug($"Tooltip is {sb.Length} bytes.");
_log.Debug($"Tooltip text is {sb.Length} bytes.");
tbIcon.ToolTipText = sb.ToString();
}
}
Expand Down
7 changes: 4 additions & 3 deletions GetMyIP/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<UserControl x:Class="GetMyIP.Pages.SettingsPage"
<!--Copyright (c) Tim Kennedy. All Rights Reserved. Licensed under the MIT License.-->
<UserControl x:Class="GetMyIP.Pages.SettingsPage"
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"
Expand Down Expand Up @@ -236,7 +237,7 @@
<!--#endregion-->

<!--#region Pop up box-->
<materialDesign:PopupBox Margin="140,5,0,0" Padding="0"
<materialDesign:PopupBox Margin="270,5,0,0" Padding="0"
PlacementMode="RightAndAlignMiddles"
PopupMode="MouseOver">
<materialDesign:PopupBox.ToggleContent>
Expand All @@ -261,7 +262,7 @@
Grid.Row="0"
HorizontalAlignment="Left"
materialDesign:CheckBoxAssist.CheckBoxSize="22"
Content=" Minimize to tray"
Content=" Minimize to tray and enable tray icon"
IsChecked="{Binding MinimizeToTray,
Source={x:Static local:UserSettings.Setting}}" />

Expand Down
62 changes: 33 additions & 29 deletions GetMyIP/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,39 @@ Settings
========
There are four sections on the Settings page. Click on the chevron on the right to expand the section.

UI settings
-----------
There are options for the initial view, the UI size, the theme (light, dark, darker or system), the
accent color, and row spacing.

Application Settings
--------------------
There are options to toggle the display of internal IPv6 addresses in addition to IPv4 addresses,
to keep the window on top, to control the verbosity of the temp log file and to choose a map provider.

Tray Icon Settings
------------------
If you wish to display an icon in the system tray, check the "Minimize to tray" checkbox. Once checked
the remaining checkboxes are enabled. Check the box corresponding to the information that you want to
be displayed in the tray icon tooltip. The internal IPv6 option will be disabled if IPv6 is not
check in the Application Settings section. If the minimize to tray option is checked and no other
options are checked then the tooltip will display the application name. After changing any of the
tooltip information options, click the "Refresh Tooltip" button or restart the application.

The tray icon has a right-click context menu that has options for showing the main window, refreshing
the IP information and exiting the application.

Permanent Log File Settings
---------------------------
If you don't intend to keep a permanent log file you can ignore this section.

There is a text box where you can supply a log file name. Please supply the full path to a log file.
If the log file doesn't exist, it will be created. There are buttons for testing and viewing this
log file.
UI settings
-----------
There are options for the initial view, the UI size, the theme (light, dark, darker or system), the
accent color, and row spacing.

Application Settings
--------------------
There are options to toggle the display of internal IPv6 addresses in addition to IPv4 addresses,
to keep the window on top, to control the verbosity of the temp log file and to choose a map provider.

Tray Icon Settings
------------------
If you wish to display an icon in the system tray, check the "Minimize to tray and enable tray icon"
checkbox. Once checked the remaining checkboxes are enabled. Check the box corresponding to the
information that you want to be displayed in the tray icon tooltip. The internal IPv6 option will be
disabled if IPv6 is not check in the Application Settings section. If the minimize to tray option is
checked and no other options are checked then the tooltip will display the application name. After
changing any of the tooltip information options, click the "Refresh Tooltip" button or restart the
application.

Note that the tray icon tooltip has limited size and capacity, some options may cause text to wrap and
checking too many options may result in truncation. Results will vary.

The tray icon has a right-click context menu that has options for showing the main window, refreshing
the IP information and exiting the application.

Permanent Log File Settings
---------------------------
If you don't intend to keep a permanent log file you can ignore this section.

There is a text box where you can supply a log file name. Please supply the full path to a log file.
If the log file doesn't exist, it will be created. There are buttons for testing and viewing this
log file.


Logging
Expand Down

0 comments on commit 6d77a5a

Please sign in to comment.