From 9c4a5d55c9ded3a0c7f5efba1609fcccbb584367 Mon Sep 17 00:00:00 2001 From: MetaSoc <99367595+MetaSoc@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:14:21 +0100 Subject: [PATCH 1/2] No charging icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed charging icon (which was making the percentage unreadable) • Made the percentage font a little bigger and bolder --- percentage/percentage/TrayIcon.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/percentage/percentage/TrayIcon.cs b/percentage/percentage/TrayIcon.cs index 4ce73e4..6d3b50f 100644 --- a/percentage/percentage/TrayIcon.cs +++ b/percentage/percentage/TrayIcon.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -10,8 +10,8 @@ class TrayIcon [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern bool DestroyIcon(IntPtr handle); - private const int fontSize = 18; - private const string font = "Segoe UI"; + private const int fontSize = 20; + private const string font = "Segoe UI Semibold"; private NotifyIcon notifyIcon; @@ -26,7 +26,7 @@ public TrayIcon() menuItem.Click += new System.EventHandler(MenuItemClick); menuItem.Index = 0; - menuItem.Text = "E&xit"; + menuItem.Text = "Exit"; notifyIcon.ContextMenu = contextMenu; notifyIcon.Visible = true; @@ -73,7 +73,7 @@ private void TimerTick(object sender, EventArgs e) PowerStatus powerStatus = SystemInformation.PowerStatus; String percentage = (powerStatus.BatteryLifePercent * 100).ToString(); bool isCharging = SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online; - String bitmapText = isCharging ? percentage + "*" : percentage; + String bitmapText = percentage; using (Bitmap bitmap = new Bitmap(GetTextBitmap(bitmapText, new Font(font, fontSize), Color.White))) { System.IntPtr intPtr = bitmap.GetHicon(); From 02f927d144285c32201eaae650fb8f0f6dd94bed Mon Sep 17 00:00:00 2001 From: MetaSoc <99367595+MetaSoc@users.noreply.github.com> Date: Tue, 10 Jan 2023 20:40:07 +0100 Subject: [PATCH 2/2] Better Font Font "Franklin Gothic Medium Cond" is better readable --- percentage/percentage/TrayIcon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/percentage/percentage/TrayIcon.cs b/percentage/percentage/TrayIcon.cs index 6d3b50f..980dfa4 100644 --- a/percentage/percentage/TrayIcon.cs +++ b/percentage/percentage/TrayIcon.cs @@ -11,7 +11,7 @@ class TrayIcon static extern bool DestroyIcon(IntPtr handle); private const int fontSize = 20; - private const string font = "Segoe UI Semibold"; + private const string font = "Franklin Gothic Medium Cond"; private NotifyIcon notifyIcon;