コミットメタ情報

リビジョンf393f318641a5636d35462720e4d7fc761f8dd80 (tree)
日時2018-03-25 20:32:32
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

HPとcondのラベルの縦幅を広げて行間を埋める

変更サマリ

差分

--- a/KancolleSniffer/BattleResultPanel.cs
+++ b/KancolleSniffer/BattleResultPanel.cs
@@ -316,7 +316,15 @@ namespace KancolleSniffer
316316
317317 var friend = new[]
318318 {
319- new ShipLabel {Location = new Point(100, 2), AutoSize = true, AnchorRight = true},
319+ new ShipLabel
320+ {
321+ Location = new Point(100, 0),
322+ AutoSize = true,
323+ AnchorRight = true,
324+ MinimumSize = new Size(0, LineHeight),
325+ TextAlign = ContentAlignment.MiddleLeft,
326+ Cursor = Cursors.Hand
327+ },
320328 new ShipLabel {Location = new Point(1, 2), AutoSize = true}
321329 };
322330 _friendLabels.Add(friend);
@@ -324,7 +332,13 @@ namespace KancolleSniffer
324332 friend[0].Click += HpLabelClickHandler;
325333 var enemy = new[]
326334 {
327- new ShipLabel {Location = new Point(119, 2), AutoSize = true},
335+ new ShipLabel
336+ {
337+ Location = new Point(119, 0),
338+ AutoSize = true,
339+ MinimumSize = new Size(0, LineHeight),
340+ TextAlign = ContentAlignment.MiddleLeft
341+ },
328342 new ShipLabel {Location = new Point(164, 2), AutoSize = true}
329343 };
330344 _enemyLabels.Add(enemy);
--- a/KancolleSniffer/MainFormLabels.cs
+++ b/KancolleSniffer/MainFormLabels.cs
@@ -59,7 +59,7 @@ namespace KancolleSniffer
5959 public void CreateShipLabels(Control parent, EventHandler onClick, ShipLabel[][] shipLabels, int lineHeight)
6060 {
6161 parent.SuspendLayout();
62- const int top = 3, height = 12;
62+ const int top = 1, height = 12;
6363 ShipLabel[] headings;
6464 parent.Controls.AddRange(headings = new[]
6565 {
@@ -79,27 +79,35 @@ namespace KancolleSniffer
7979 var y = top + lineHeight * (i + 1);
8080 parent.Controls.AddRange(shipLabels[i] = new[]
8181 {
82- new ShipLabel {Location = new Point(129, y), AutoSize = true, AnchorRight = true},
82+ new ShipLabel
83+ {
84+ Location = new Point(129, y),
85+ AutoSize = true,
86+ AnchorRight = true,
87+ MinimumSize = new Size(0, lineHeight),
88+ TextAlign = ContentAlignment.MiddleLeft,
89+ Cursor = Cursors.Hand
90+ },
8391 new ShipLabel
8492 {
8593 Location = new Point(131, y),
86- Size = new Size(24, height),
94+ Size = new Size(24, lineHeight),
8795 TextAlign = ContentAlignment.MiddleRight
8896 },
8997 new ShipLabel
9098 {
91- Location = new Point(155, y),
99+ Location = new Point(155, y + 2),
92100 Size = new Size(24, height),
93101 TextAlign = ContentAlignment.MiddleRight
94102 },
95103 new ShipLabel
96104 {
97- Location = new Point(176, y),
105+ Location = new Point(176, y + 2),
98106 Size = new Size(42, height),
99107 TextAlign = ContentAlignment.MiddleRight
100108 },
101- new ShipLabel {Location = new Point(2, y), AutoSize = true}, // 名前のZ-orderを下に
102- new ShipLabel {Location = new Point(0, y - 2), Size = new Size(parent.Width, lineHeight - 1)}
109+ new ShipLabel {Location = new Point(2, y + 2), AutoSize = true}, // 名前のZ-orderを下に
110+ new ShipLabel {Location = new Point(0, y), Size = new Size(parent.Width, lineHeight)}
103111 });
104112 foreach (var label in shipLabels[i])
105113 {
@@ -151,7 +159,7 @@ namespace KancolleSniffer
151159 public void CreateCombinedShipLabels(Control parent, EventHandler onClick)
152160 {
153161 parent.SuspendLayout();
154- const int top = 3, height = 12, lh = 16;
162+ const int top = 1, lh = 16;
155163 const int parentWidth = 220; // parent.Widthを使うとDPIスケーリング時に計算がくるうので
156164 ShipLabel[] headings;
157165 parent.Controls.AddRange(headings = new[]
@@ -173,15 +181,23 @@ namespace KancolleSniffer
173181 var y = top + lh * (i % ShipInfo.MemberCount + 1);
174182 parent.Controls.AddRange(_combinedLabels[i] = new[]
175183 {
176- new ShipLabel {Location = new Point(x + 88, y), AutoSize = true, AnchorRight = true},
184+ new ShipLabel
185+ {
186+ Location = new Point(x + 88, y),
187+ AutoSize = true,
188+ AnchorRight = true,
189+ MinimumSize = new Size(0, lh),
190+ TextAlign = ContentAlignment.MiddleLeft,
191+ Cursor = Cursors.Hand
192+ },
177193 new ShipLabel
178194 {
179195 Location = new Point(x + 85, y),
180- Size = new Size(24, height),
196+ Size = new Size(24, lh),
181197 TextAlign = ContentAlignment.MiddleRight
182198 },
183- new ShipLabel {Location = new Point(x + 2, y), AutoSize = true}, // 名前のZ-orderを下に
184- new ShipLabel {Location = new Point(x, y - 2), Size = new Size(parentWidth / 2, lh - 1)}
199+ new ShipLabel {Location = new Point(x + 2, y + 2), AutoSize = true}, // 名前のZ-orderを下に
200+ new ShipLabel {Location = new Point(x, y), Size = new Size(parentWidth / 2, lh)}
185201 });
186202 foreach (var label in _combinedLabels[i])
187203 {
@@ -275,12 +291,12 @@ namespace KancolleSniffer
275291 }
276292 else
277293 {
278-
279294 SetAkashiTimer(statuses, timers, _akashiTimers, _shiplabels);
280295 }
281296 }
282297
283- public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers, ShipLabel[] timerLabels, ShipLabel[][] shipLabels)
298+ public void SetAkashiTimer(ShipStatus[] statuses, AkashiTimer.RepairSpan[] timers, ShipLabel[] timerLabels,
299+ ShipLabel[][] shipLabels)
284300 {
285301 var shortest = -1;
286302 for (var i = 0; i < timers.Length; i++)
--- a/KancolleSniffer/ShipListPanel.cs
+++ b/KancolleSniffer/ShipListPanel.cs
@@ -231,12 +231,12 @@ namespace KancolleSniffer
231231
232232 private void CreateGroupingComponents(int i)
233233 {
234- var y = 3 + LineHeight * i;
234+ var y = LineHeight * i + 1;
235235 var cfgp = new Panel
236236 {
237- Location = new Point(0, y - 2),
238- Size = new Size(ListForm.PanelWidth, LineHeight - 1),
239- BackColor = ShipLabel.ColumnColors[(i + 1) % 2],
237+ Location = new Point(0, y),
238+ Size = new Size(ListForm.PanelWidth, LineHeight),
239+ BackColor = ShipLabel.ColumnColors[(i + 1) % 2]
240240 };
241241 cfgp.Scale(ShipLabel.ScaleFactor);
242242 cfgp.Tag = cfgp.Location.Y;
@@ -299,19 +299,27 @@ namespace KancolleSniffer
299299
300300 private void CreateRepairLabels(int i)
301301 {
302- var y = 3 + LineHeight * i;
302+ var y = LineHeight * i + 1;
303303 const int height = LabelHeight;
304304 var rpp = new Panel
305305 {
306- Location = new Point(0, y - 2),
307- Size = new Size(ListForm.PanelWidth, LineHeight - 1),
308- BackColor = ShipLabel.ColumnColors[(i + 1) % 2],
306+ Location = new Point(0, y),
307+ Size = new Size(ListForm.PanelWidth, LineHeight),
308+ BackColor = ShipLabel.ColumnColors[(i + 1) % 2]
309309 };
310310 rpp.Scale(ShipLabel.ScaleFactor);
311311 rpp.Tag = rpp.Location.Y;
312312 var rpl = new[]
313313 {
314- new ShipLabel {Location = new Point(118, 2), AutoSize = true, AnchorRight = true},
314+ new ShipLabel
315+ {
316+ Location = new Point(118, 0),
317+ AutoSize = true,
318+ AnchorRight = true,
319+ MinimumSize = new Size(0, LineHeight),
320+ TextAlign = ContentAlignment.MiddleLeft,
321+ Cursor = Cursors.Hand
322+ },
315323 new ShipLabel
316324 {
317325 Location = new Point(116, 2),
@@ -342,22 +350,30 @@ namespace KancolleSniffer
342350
343351 private void CreateShipLabels(int i)
344352 {
345- var y = 3 + LineHeight * i;
353+ var y = LineHeight * i + 1;
346354 const int height = LabelHeight;
347355 var lbp = new Panel
348356 {
349- Location = new Point(0, y - 2),
350- Size = new Size(ListForm.PanelWidth, LineHeight - 1),
357+ Location = new Point(0, y),
358+ Size = new Size(ListForm.PanelWidth, LineHeight),
351359 BackColor = ShipLabel.ColumnColors[(i + 1) % 2]
352360 };
353361 lbp.Scale(ShipLabel.ScaleFactor);
354362 var labels = new[]
355363 {
356- new ShipLabel {Location = new Point(126, 2), AutoSize = true, AnchorRight = true},
357364 new ShipLabel
358365 {
359- Location = new Point(128, 2),
360- Size = new Size(24, height),
366+ Location = new Point(126, 0),
367+ AutoSize = true,
368+ AnchorRight = true,
369+ MinimumSize = new Size(0, LineHeight),
370+ TextAlign = ContentAlignment.MiddleLeft,
371+ Cursor = Cursors.Hand
372+ },
373+ new ShipLabel
374+ {
375+ Location = new Point(128, 0),
376+ Size = new Size(24, LineHeight),
361377 TextAlign = ContentAlignment.MiddleRight
362378 },
363379 new ShipLabel
旧リポジトリブラウザで表示