OSDN Git Service

背景の白い帯が短くなるのを直す
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Tue, 5 May 2020 11:20:53 +0000 (20:20 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Sun, 30 Aug 2020 05:58:22 +0000 (14:58 +0900)
KancolleSniffer/View/MainWindow/ShipPanels.cs

index 58b849b..42d950b 100644 (file)
@@ -22,19 +22,19 @@ namespace KancolleSniffer.View.MainWindow
 {\r
     public class ShipPanels\r
     {\r
-        private const int Width = 220;\r
+        private const int PanelWidth = 220;\r
 \r
         private readonly Panel _combined = new Panel\r
         {\r
             Location = new Point(0, 0),\r
-            Size = new Size(Width, 113),\r
+            Size = new Size(PanelWidth, 113),\r
             Visible = false\r
         };\r
 \r
         private readonly Panel _7Ships = new Panel\r
         {\r
             Location = new Point(0, 0),\r
-            Size = new Size(Width, 113),\r
+            Size = new Size(PanelWidth, 113),\r
             Visible = false\r
         };\r
 \r
@@ -148,7 +148,7 @@ namespace KancolleSniffer.View.MainWindow
                         Cond = new ShipLabel.Cond(new Point(131, y), _lineHeight),\r
                         Level = new ShipLabel.Level(new Point(155, y + 2), LabelHeight),\r
                         Exp = new ShipLabel.Exp(new Point(176, y + 2), LabelHeight),\r
-                        BackGround = new Label {Location = new Point(0, y), Size = new Size(parent.Width, _lineHeight)}\r
+                        BackGround = new Label {Location = new Point(0, y), Size = new Size(PanelWidth, _lineHeight)}\r
                     };\r
                     labels.Arrange(parent, CustomColors.ColumnColors.DarkFirst(i));\r
                     labels.SetClickHandler(onClick);\r
@@ -166,7 +166,7 @@ namespace KancolleSniffer.View.MainWindow
                     new Label {Location = new Point(128, Top), Text = "cond", AutoSize = true},\r
                     new Label {Location = new Point(162, Top), Text = "Lv", AutoSize = true},\r
                     new Label {Location = new Point(194, Top), Text = "Exp", AutoSize = true},\r
-                    new Label {Location = new Point(0, 1), Size = new Size(parent.Width, _lineHeight - 1)}\r
+                    new Label {Location = new Point(0, 1), Size = new Size(PanelWidth, _lineHeight - 1)}\r
                 };\r
                 parent.Controls.AddRange(headings);\r
                 foreach (var control in headings)\r
@@ -293,7 +293,6 @@ namespace KancolleSniffer.View.MainWindow
 \r
             private const int Top = 1;\r
             private const int LineHeight = 16;\r
-            private const int ParentWidth = 220; // parent.Widthを使うとDPIスケーリング時に計算がくるうので\r
 \r
             public void Create(Control parent, HpToggle hpToggle, EventHandler onClick)\r
             {\r
@@ -301,14 +300,14 @@ namespace KancolleSniffer.View.MainWindow
                 CreateHeader(parent, hpToggle);\r
                 for (var i = 0; i < _combinedLines.Length; i++)\r
                 {\r
-                    var x = ParentWidth / 2 * (i / ShipInfo.MemberCount);\r
+                    var x = PanelWidth / 2 * (i / ShipInfo.MemberCount);\r
                     var y = Top + LineHeight * (i % ShipInfo.MemberCount + 1);\r
                     var labels = _combinedLines[i] = new ShipLabels\r
                     {\r
                         Name = new ShipLabel.Name(new Point(x + 2, y + 2), ShipNameWidth.Combined),\r
                         Hp = new ShipLabel.Hp(new Point(x + 88, y), LineHeight),\r
                         Cond = new ShipLabel.Cond(new Point(x + 85, y), LineHeight),\r
-                        BackGround = new Label {Location = new Point(x, y), Size = new Size(ParentWidth / 2, LineHeight)}\r
+                        BackGround = new Label {Location = new Point(x, y), Size = new Size(PanelWidth / 2, LineHeight)}\r
                     };\r
                     labels.Arrange(parent, CustomColors.ColumnColors.DarkFirst(i));\r
                     labels.SetClickHandler(onClick);\r
@@ -327,7 +326,7 @@ namespace KancolleSniffer.View.MainWindow
                     new Label {Location = new Point(86, Top), Text = "cnd", AutoSize = true},\r
                     new Label {Location = new Point(177, Top), Text = "HP", AutoSize = true},\r
                     new Label {Location = new Point(195, Top), Text = "cnd", AutoSize = true},\r
-                    new Label {Location = new Point(0, 1), Size = new Size(ParentWidth, LineHeight - 1)}\r
+                    new Label {Location = new Point(0, 1), Size = new Size(PanelWidth, LineHeight - 1)}\r
                 };\r
                 parent.Controls.AddRange(headings);\r
                 foreach (var control in headings)\r