OSDN Git Service

HPとcondのラベルの縦幅を広げて行間を埋める
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Sun, 25 Mar 2018 09:09:23 +0000 (18:09 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Sun, 25 Mar 2018 11:32:32 +0000 (20:32 +0900)
KancolleSniffer/BattleResultPanel.cs
KancolleSniffer/MainFormLabels.cs
KancolleSniffer/ShipListPanel.cs

index 4dcb344..68795bb 100644 (file)
@@ -316,7 +316,15 @@ namespace KancolleSniffer
 \r
                 var friend = new[]\r
                 {\r
-                    new ShipLabel {Location = new Point(100, 2), AutoSize = true, AnchorRight = true},\r
+                    new ShipLabel\r
+                    {\r
+                        Location = new Point(100, 0),\r
+                        AutoSize = true,\r
+                        AnchorRight = true,\r
+                        MinimumSize = new Size(0, LineHeight),\r
+                        TextAlign = ContentAlignment.MiddleLeft,\r
+                        Cursor = Cursors.Hand\r
+                    },\r
                     new ShipLabel {Location = new Point(1, 2), AutoSize = true}\r
                 };\r
                 _friendLabels.Add(friend);\r
@@ -324,7 +332,13 @@ namespace KancolleSniffer
                 friend[0].Click += HpLabelClickHandler;\r
                 var enemy = new[]\r
                 {\r
-                    new ShipLabel {Location = new Point(119, 2), AutoSize = true},\r
+                    new ShipLabel\r
+                    {\r
+                        Location = new Point(119, 0),\r
+                        AutoSize = true,\r
+                        MinimumSize = new Size(0, LineHeight),\r
+                        TextAlign = ContentAlignment.MiddleLeft\r
+                    },\r
                     new ShipLabel {Location = new Point(164, 2), AutoSize = true}\r
                 };\r
                 _enemyLabels.Add(enemy);\r
index b7d7603..42847e3 100644 (file)
@@ -59,7 +59,7 @@ namespace KancolleSniffer
         public void CreateShipLabels(Control parent, EventHandler onClick, ShipLabel[][] shipLabels, int lineHeight)\r
         {\r
             parent.SuspendLayout();\r
-            const int top = 3, height = 12;\r
+            const int top = 1, height = 12;\r
             ShipLabel[] headings;\r
             parent.Controls.AddRange(headings = new[]\r
             {\r
@@ -79,27 +79,35 @@ namespace KancolleSniffer
                 var y = top + lineHeight * (i + 1);\r
                 parent.Controls.AddRange(shipLabels[i] = new[]\r
                 {\r
-                    new ShipLabel {Location = new Point(129, y), AutoSize = true, AnchorRight = true},\r
+                    new ShipLabel\r
+                    {\r
+                        Location = new Point(129, y),\r
+                        AutoSize = true,\r
+                        AnchorRight = true,\r
+                        MinimumSize = new Size(0, lineHeight),\r
+                        TextAlign = ContentAlignment.MiddleLeft,\r
+                        Cursor = Cursors.Hand\r
+                    },\r
                     new ShipLabel\r
                     {\r
                         Location = new Point(131, y),\r
-                        Size = new Size(24, height),\r
+                        Size = new Size(24, lineHeight),\r
                         TextAlign = ContentAlignment.MiddleRight\r
                     },\r
                     new ShipLabel\r
                     {\r
-                        Location = new Point(155, y),\r
+                        Location = new Point(155, y + 2),\r
                         Size = new Size(24, height),\r
                         TextAlign = ContentAlignment.MiddleRight\r
                     },\r
                     new ShipLabel\r
                     {\r
-                        Location = new Point(176, y),\r
+                        Location = new Point(176, y + 2),\r
                         Size = new Size(42, height),\r
                         TextAlign = ContentAlignment.MiddleRight\r
                     },\r
-                    new ShipLabel {Location = new Point(2, y), AutoSize = true}, // 名前のZ-orderを下に\r
-                    new ShipLabel {Location = new Point(0, y - 2), Size = new Size(parent.Width, lineHeight - 1)}\r
+                    new ShipLabel {Location = new Point(2, y + 2), AutoSize = true}, // 名前のZ-orderを下に\r
+                    new ShipLabel {Location = new Point(0, y), Size = new Size(parent.Width, lineHeight)}\r
                 });\r
                 foreach (var label in shipLabels[i])\r
                 {\r
@@ -151,7 +159,7 @@ namespace KancolleSniffer
         public void CreateCombinedShipLabels(Control parent, EventHandler onClick)\r
         {\r
             parent.SuspendLayout();\r
-            const int top = 3, height = 12, lh = 16;\r
+            const int top = 1, lh = 16;\r
             const int parentWidth = 220; // parent.Widthを使うとDPIスケーリング時に計算がくるうので\r
             ShipLabel[] headings;\r
             parent.Controls.AddRange(headings = new[]\r
@@ -173,15 +181,23 @@ namespace KancolleSniffer
                 var y = top + lh * (i % ShipInfo.MemberCount + 1);\r
                 parent.Controls.AddRange(_combinedLabels[i] = new[]\r
                 {\r
-                    new ShipLabel {Location = new Point(x + 88, y), AutoSize = true, AnchorRight = true},\r
+                    new ShipLabel\r
+                    {\r
+                        Location = new Point(x + 88, y),\r
+                        AutoSize = true,\r
+                        AnchorRight = true,\r
+                        MinimumSize = new Size(0, lh),\r
+                        TextAlign = ContentAlignment.MiddleLeft,\r
+                        Cursor = Cursors.Hand\r
+                    },\r
                     new ShipLabel\r
                     {\r
                         Location = new Point(x + 85, y),\r
-                        Size = new Size(24, height),\r
+                        Size = new Size(24, lh),\r
                         TextAlign = ContentAlignment.MiddleRight\r
                     },\r
-                    new ShipLabel {Location = new Point(x + 2, y), AutoSize = true}, // 名前のZ-orderを下に\r
-                    new ShipLabel {Location = new Point(x, y - 2), Size = new Size(parentWidth / 2, lh - 1)}\r
+                    new ShipLabel {Location = new Point(x + 2, y + 2), AutoSize = true}, // 名前のZ-orderを下に\r
+                    new ShipLabel {Location = new Point(x, y), Size = new Size(parentWidth / 2, lh)}\r
                 });\r
                 foreach (var label in _combinedLabels[i])\r
                 {\r
@@ -275,12 +291,12 @@ namespace KancolleSniffer
             }\r
             else\r
             {\r
-\r
                 SetAkashiTimer(statuses, timers, _akashiTimers, _shiplabels);\r
             }\r
         }\r
 \r
-        public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers, ShipLabel[] timerLabels, ShipLabel[][] shipLabels)\r
+        public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers, ShipLabel[] timerLabels,\r
+            ShipLabel[][] shipLabels)\r
         {\r
             var shortest = -1;\r
             for (var i = 0; i < timers.Length; i++)\r
index e2fc1b4..05c4098 100644 (file)
@@ -231,12 +231,12 @@ namespace KancolleSniffer
 \r
         private void CreateGroupingComponents(int i)\r
         {\r
-            var y = 3 + LineHeight * i;\r
+            var y = LineHeight * i + 1;\r
             var cfgp = new Panel\r
             {\r
-                Location = new Point(0, y - 2),\r
-                Size = new Size(ListForm.PanelWidth, LineHeight - 1),\r
-                BackColor = ShipLabel.ColumnColors[(i + 1) % 2],\r
+                Location = new Point(0, y),\r
+                Size = new Size(ListForm.PanelWidth, LineHeight),\r
+                BackColor = ShipLabel.ColumnColors[(i + 1) % 2]\r
             };\r
             cfgp.Scale(ShipLabel.ScaleFactor);\r
             cfgp.Tag = cfgp.Location.Y;\r
@@ -299,19 +299,27 @@ namespace KancolleSniffer
 \r
         private void CreateRepairLabels(int i)\r
         {\r
-            var y = 3 + LineHeight * i;\r
+            var y = LineHeight * i + 1;\r
             const int height = LabelHeight;\r
             var rpp = new Panel\r
             {\r
-                Location = new Point(0, y - 2),\r
-                Size = new Size(ListForm.PanelWidth, LineHeight - 1),\r
-                BackColor = ShipLabel.ColumnColors[(i + 1) % 2],\r
+                Location = new Point(0, y),\r
+                Size = new Size(ListForm.PanelWidth, LineHeight),\r
+                BackColor = ShipLabel.ColumnColors[(i + 1) % 2]\r
             };\r
             rpp.Scale(ShipLabel.ScaleFactor);\r
             rpp.Tag = rpp.Location.Y;\r
             var rpl = new[]\r
             {\r
-                new ShipLabel {Location = new Point(118, 2), AutoSize = true, AnchorRight = true},\r
+                new ShipLabel\r
+                {\r
+                    Location = new Point(118, 0),\r
+                    AutoSize = true,\r
+                    AnchorRight = true,\r
+                    MinimumSize = new Size(0, LineHeight),\r
+                    TextAlign = ContentAlignment.MiddleLeft,\r
+                    Cursor = Cursors.Hand\r
+                },\r
                 new ShipLabel\r
                 {\r
                     Location = new Point(116, 2),\r
@@ -342,22 +350,30 @@ namespace KancolleSniffer
 \r
         private void CreateShipLabels(int i)\r
         {\r
-            var y = 3 + LineHeight * i;\r
+            var y = LineHeight * i + 1;\r
             const int height = LabelHeight;\r
             var lbp = new Panel\r
             {\r
-                Location = new Point(0, y - 2),\r
-                Size = new Size(ListForm.PanelWidth, LineHeight - 1),\r
+                Location = new Point(0, y),\r
+                Size = new Size(ListForm.PanelWidth, LineHeight),\r
                 BackColor = ShipLabel.ColumnColors[(i + 1) % 2]\r
             };\r
             lbp.Scale(ShipLabel.ScaleFactor);\r
             var labels = new[]\r
             {\r
-                new ShipLabel {Location = new Point(126, 2), AutoSize = true, AnchorRight = true},\r
                 new ShipLabel\r
                 {\r
-                    Location = new Point(128, 2),\r
-                    Size = new Size(24, height),\r
+                    Location = new Point(126, 0),\r
+                    AutoSize = true,\r
+                    AnchorRight = true,\r
+                    MinimumSize = new Size(0, LineHeight),\r
+                    TextAlign = ContentAlignment.MiddleLeft,\r
+                    Cursor = Cursors.Hand\r
+                },\r
+                new ShipLabel\r
+                {\r
+                    Location = new Point(128, 0),\r
+                    Size = new Size(24, LineHeight),\r
                     TextAlign = ContentAlignment.MiddleRight\r
                 },\r
                 new ShipLabel\r