X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=KancolleSniffer%2FView%2FShipListPanel%2FRepairListLabels.cs;h=92ef4fc963851d95dcdece7e45a704c9b81e523a;hb=9f248aac1385f77cf294fc7a6c9c7e4ac43306c5;hp=631de5212f5d62279bd8de8e6ded4c86939b124f;hpb=92cd3a7afa9d852ad34558db434b4619dfb12842;p=kancollesniffer%2FKancolleSniffer.git diff --git a/KancolleSniffer/View/ShipListPanel/RepairListLabels.cs b/KancolleSniffer/View/ShipListPanel/RepairListLabels.cs index 631de52..92ef4fc 100644 --- a/KancolleSniffer/View/ShipListPanel/RepairListLabels.cs +++ b/KancolleSniffer/View/ShipListPanel/RepairListLabels.cs @@ -14,8 +14,8 @@ using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Windows.Forms; +using KancolleSniffer.Forms; using KancolleSniffer.Model; namespace KancolleSniffer.View.ShipListPanel @@ -30,7 +30,7 @@ namespace KancolleSniffer.View.ShipListPanel public ShipLabel.RepairTime Time { get; set; } public Label PerHp { get; set; } - public override Control[] Controls => base.Controls.Concat(new[] {Time, PerHp}).ToArray(); + protected override Control[] AddedControls => new Control[] {Time, PerHp}; public override void Set(ShipStatus status) { @@ -55,18 +55,35 @@ namespace KancolleSniffer.View.ShipListPanel Hp = new ShipLabel.Hp(new Point(118, 0), ShipListPanel.LineHeight), Level = new ShipLabel.Level(new Point(116, 2), height), Time = new ShipLabel.RepairTime(new Point(141, 2)), - PerHp = new Label {Location = new Point(186, 2), AutoSize = true}, + PerHp = new Label {Location = new Point(185, 2), AutoSize = true}, BackPanel = new Panel { Location = new Point(0, y), - Size = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight) + Size = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight), + Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top } }; + SetAnchorRight(labels.Hp, labels.Level, labels.Time, labels.PerHp); _labelList.Add(labels); labels.Arrange(_shipListPanel, CustomColors.ColumnColors.BrightFirst(i)); + labels.Scale(); _shipListPanel.SetHpPercent(labels.Hp); } + private void SetAnchorRight(params Control[] controls) + { + foreach (var control in controls) + control.Anchor = AnchorStyles.Top | AnchorStyles.Right; + } + + public void Resize(int i, int width) + { + var labels = _labelList[i]; + labels.BackPanel.Width = width; + labels.Hp.AdjustLocation(); + labels.Name.AdjustWidth(Scaler.DownWidth(width) - ListForm.PanelWidth); + } + public void SetRepairList(int i) { var s = _shipListPanel.GetShip(i);