OSDN Git Service

ツールチップをズームする
[kancollesniffer/KancolleSniffer.git] / KancolleSniffer / NotificationConfigDialog.cs
index a4b10e9..dc8e9bd 100644 (file)
@@ -1,5 +1,6 @@
 using System;\r
 using System.Collections.Generic;\r
+using System.Drawing;\r
 using System.Linq;\r
 using System.Windows.Forms;\r
 \r
@@ -9,7 +10,7 @@ namespace KancolleSniffer
     {\r
         private readonly Dictionary<string, NotificationSpec> _notifications;\r
         private readonly Dictionary<NotificationType, CheckBox> _configCheckBoxs;\r
-        private readonly ToolTip _tooltip = new ToolTip();\r
+        private readonly ResizableToolTip _toolTip = new ResizableToolTip();\r
 \r
         public NotificationConfigDialog(Dictionary<string, NotificationSpec> notifications,\r
             Dictionary<NotificationType, CheckBox> checkBoxs)\r
@@ -59,7 +60,7 @@ namespace KancolleSniffer
             checkBoxPlaySound.Checked = (notification.Flags & NotificationType.PlaySound) != 0;\r
             checkBoxPush.Checked = (notification.Flags & NotificationType.Push) != 0;\r
             checkBoxRepeat.Checked = (notification.Flags & NotificationType.Repeat) != 0;\r
-            _tooltip.SetToolTip(checkBoxCont,\r
+            _toolTip.SetToolTip(checkBoxCont,\r
                 !IsContAvailable ? "" :\r
                 notification.Name == "遠征終了" ? "再度遠征に出すまでリピートする。" : "再度入渠させるまでリピートする。");\r
             checkBoxCont.Checked = (notification.Flags & NotificationType.Cont) != 0;\r
@@ -112,5 +113,12 @@ namespace KancolleSniffer
             _notifications[(string)listBoxNotifications.SelectedItem].PreliminaryPeriod =\r
                 int.TryParse(textBoxPreliminary.Text, out int preliminary) ? preliminary : 0;\r
         }\r
+\r
+        protected override void ScaleControl(SizeF factor, BoundsSpecified specified)\r
+        {\r
+            base.ScaleControl(factor, specified);\r
+            if (factor.Height > 1)\r
+                _toolTip.Font = new Font(_toolTip.Font.FontFamily, _toolTip.Font.Size * factor.Height);\r
+        }\r
     }\r
 }
\ No newline at end of file