\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
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
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
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
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
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
}\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
\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
\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
\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