• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂0f782a4f5f8796c9a91fb0598b8c089d2ecc73ce (tree)
時間2020-09-05 17:59:45
作者Kazuhiro Fujieda <fujieda@user...>
CommiterKazuhiro Fujieda

Log Message

DPIズーム時に一覧のレイアウトがくずれるのを直す

クラッシュするのを直したときの直し方がまずくScaler.Factorが
設定されるより前にShipListPanelのラベル生成が走っていた。

Change Summary

差異

--- a/KancolleSniffer/Forms/ListForm.cs
+++ b/KancolleSniffer/Forms/ListForm.cs
@@ -31,7 +31,7 @@ namespace KancolleSniffer.Forms
3131 private readonly Config _config;
3232 private readonly Form _form;
3333 private readonly MainWindow.TimeOutChecker _suppressActivate;
34- private CheckBox[] _shipTypeCheckBoxes;
34+ private readonly CheckBox[] _shipTypeCheckBoxes;
3535 private bool _isMaster;
3636 private Settings _settings;
3737 public const int PanelWidth = 215;
@@ -103,32 +103,7 @@ namespace KancolleSniffer.Forms
103103 _form = main.Form;
104104 _sniffer = main.Sniffer;
105105 _config = main.Config;
106- ApplySettings();
107- SetupShipTypeCheckBoxes();
108106 _suppressActivate = main.SuppressActivate;
109- battleResultPanel.HpLabelClick += ToggleHpPercent;
110- shipListPanel.HpLabelClick += ToggleHpPercent;
111- var swipe = new SwipeScrollify();
112- swipe.AddShipListPanel(shipListPanel);
113- swipe.AddTreeView(itemTreeView);
114- swipe.AddPanel(fleetPanel);
115- }
116-
117- private void ApplySettings()
118- {
119- var config = GetConfig();
120- _settings = Settings.FromShipListConfig(config);
121- if (_settings.ShowHpInPercent)
122- {
123- shipListPanel.ToggleHpPercent();
124- battleResultPanel.ToggleHpPercent();
125- }
126- LoadShipGroupFromConfig();
127- comboBoxGroup.SelectedItem = _settings.Mode;
128- }
129-
130- private void SetupShipTypeCheckBoxes()
131- {
132107 _shipTypeCheckBoxes = new[]
133108 {
134109 checkBoxSTypeBattleShip,
@@ -140,7 +115,12 @@ namespace KancolleSniffer.Forms
140115 checkBoxSTypeSubmarine,
141116 checkBoxSTypeAuxiliary
142117 };
143- SetCheckBoxSTypeState();
118+ battleResultPanel.HpLabelClick += ToggleHpPercent;
119+ shipListPanel.HpLabelClick += ToggleHpPercent;
120+ var swipe = new SwipeScrollify();
121+ swipe.AddShipListPanel(shipListPanel);
122+ swipe.AddTreeView(itemTreeView);
123+ swipe.AddPanel(fleetPanel);
144124 }
145125
146126 public void UpdateList()
@@ -297,8 +277,16 @@ namespace KancolleSniffer.Forms
297277 {
298278 AdjustHeader();
299279 SetMinimumSize();
300- comboBoxGroup.SelectedItem = _settings.Mode;
301280 var config = GetConfig();
281+ _settings = Settings.FromShipListConfig(config);
282+ if (_settings.ShowHpInPercent)
283+ {
284+ shipListPanel.ToggleHpPercent();
285+ battleResultPanel.ToggleHpPercent();
286+ }
287+ LoadShipGroupFromConfig();
288+ comboBoxGroup.SelectedItem = _settings.Mode;
289+ SetCheckBoxSTypeState();
302290 if (config.Location.X == int.MinValue)
303291 return;
304292 var bounds = new Rectangle(config.Location, config.Size);
@@ -359,6 +347,8 @@ namespace KancolleSniffer.Forms
359347
360348 public void SaveConfig()
361349 {
350+ if (_settings == null)
351+ return;
362352 if (_isMaster)
363353 {
364354 SaveMasterState();