From e7ea8f3a262822c1d9b6862dc5d4ff135f4cb6b6 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Wed, 6 Dec 2023 01:00:06 +0900 Subject: [PATCH] =?utf8?q?=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6?= =?utf8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E7=AD=89=E3=81=AE=E8=A8=AD=E5=AE=9A?= =?utf8?q?=E5=80=A4=E3=82=92=E9=81=A9=E7=94=A8=E3=81=99=E3=82=8B=E5=87=A6?= =?utf8?q?=E7=90=86=E3=82=92Resize=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?utf8?q?=E3=81=8B=E3=82=89=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?utf8?q?=E3=82=AF=E3=82=BF=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- OpenTween/Tween.cs | 80 +++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index d9492a09..5e0a527a 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -552,7 +552,7 @@ namespace OpenTween this.TimerRefreshIcon.Enabled = false; this.ignoreConfigSave = false; - this.TweenMain_Resize(this, EventArgs.Empty); + this.ApplyLayoutFromSettings(); } private void TweenMain_Activated(object sender, EventArgs e) @@ -7180,56 +7180,56 @@ namespace OpenTween { this.Visible = false; } - if (this.initialLayout && this.settings.Local != null && this.WindowState == FormWindowState.Normal && this.Visible) + if (this.WindowState != FormWindowState.Minimized) { - // 現在の DPI と設定保存時の DPI との比を取得する - var configScaleFactor = this.settings.Local.GetConfigScaleFactor(this.CurrentAutoScaleDimensions); + this.formWindowState = this.WindowState; + } + } - this.ClientSize = ScaleBy(configScaleFactor, this.settings.Local.FormSize); + private void ApplyLayoutFromSettings() + { + // 現在の DPI と設定保存時の DPI との比を取得する + var configScaleFactor = this.settings.Local.GetConfigScaleFactor(this.CurrentAutoScaleDimensions); - // Splitterの位置設定 - var splitterDistance = ScaleBy(configScaleFactor.Height, this.settings.Local.SplitterDistance); - if (splitterDistance > this.SplitContainer1.Panel1MinSize && - splitterDistance < this.SplitContainer1.Height - this.SplitContainer1.Panel2MinSize - this.SplitContainer1.SplitterWidth) - { - this.SplitContainer1.SplitterDistance = splitterDistance; - } + this.ClientSize = ScaleBy(configScaleFactor, this.settings.Local.FormSize); - // 発言欄複数行 - this.StatusText.Multiline = this.settings.Local.StatusMultiline; - if (this.StatusText.Multiline) - { - var statusTextHeight = ScaleBy(configScaleFactor.Height, this.settings.Local.StatusTextHeight); - var dis = this.SplitContainer2.Height - statusTextHeight - this.SplitContainer2.SplitterWidth; - if (dis > this.SplitContainer2.Panel1MinSize && dis < this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth) - { - this.SplitContainer2.SplitterDistance = this.SplitContainer2.Height - statusTextHeight - this.SplitContainer2.SplitterWidth; - } - this.StatusText.Height = statusTextHeight; - } - else + // Splitterの位置設定 + var splitterDistance = ScaleBy(configScaleFactor.Height, this.settings.Local.SplitterDistance); + if (splitterDistance > this.SplitContainer1.Panel1MinSize && + splitterDistance < this.SplitContainer1.Height - this.SplitContainer1.Panel2MinSize - this.SplitContainer1.SplitterWidth) + { + this.SplitContainer1.SplitterDistance = splitterDistance; + } + + // 発言欄複数行 + this.StatusText.Multiline = this.settings.Local.StatusMultiline; + if (this.StatusText.Multiline) + { + var statusTextHeight = ScaleBy(configScaleFactor.Height, this.settings.Local.StatusTextHeight); + var dis = this.SplitContainer2.Height - statusTextHeight - this.SplitContainer2.SplitterWidth; + if (dis > this.SplitContainer2.Panel1MinSize && dis < this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth) { - if (this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth > 0) - { - this.SplitContainer2.SplitterDistance = this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth; - } + this.SplitContainer2.SplitterDistance = this.SplitContainer2.Height - statusTextHeight - this.SplitContainer2.SplitterWidth; } - - var previewDistance = ScaleBy(configScaleFactor.Width, this.settings.Local.PreviewDistance); - if (previewDistance > this.SplitContainer3.Panel1MinSize && previewDistance < this.SplitContainer3.Width - this.SplitContainer3.Panel2MinSize - this.SplitContainer3.SplitterWidth) + this.StatusText.Height = statusTextHeight; + } + else + { + if (this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth > 0) { - this.SplitContainer3.SplitterDistance = previewDistance; + this.SplitContainer2.SplitterDistance = this.SplitContainer2.Height - this.SplitContainer2.Panel2MinSize - this.SplitContainer2.SplitterWidth; } - - // Panel2Collapsed は SplitterDistance の設定を終えるまで true にしない - this.SplitContainer3.Panel2Collapsed = true; - - this.initialLayout = false; } - if (this.WindowState != FormWindowState.Minimized) + + var previewDistance = ScaleBy(configScaleFactor.Width, this.settings.Local.PreviewDistance); + if (previewDistance > this.SplitContainer3.Panel1MinSize && previewDistance < this.SplitContainer3.Width - this.SplitContainer3.Panel2MinSize - this.SplitContainer3.SplitterWidth) { - this.formWindowState = this.WindowState; + this.SplitContainer3.SplitterDistance = previewDistance; } + + // Panel2Collapsed は SplitterDistance の設定を終えるまで true にしない + this.SplitContainer3.Panel2Collapsed = true; + this.initialLayout = false; } private void PlaySoundMenuItem_CheckedChanged(object sender, EventArgs e) -- 2.11.0