From e9f1d43dd19ed63242399cbb59a2ba9513a317ef Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sun, 27 Jul 2014 13:00:11 +0900 Subject: [PATCH] =?utf8?q?FontPanel=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B?= =?utf8?q?=E8=A8=AD=E5=AE=9A=E5=80=A4=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=83=BB?= =?utf8?q?=E5=8F=96=E5=BE=97=E3=82=92=20LoadConfing/SaveConfig=20=E3=83=A1?= =?utf8?q?=E3=82=BD=E3=83=83=E3=83=89=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- OpenTween/AppendSettingDialog.cs | 35 ++------------------ OpenTween/Setting/Panel/FontPanel.cs | 30 +++++++++++++++++ OpenTween/Tween.cs | 63 +++++++++++++++--------------------- 3 files changed, 58 insertions(+), 70 deletions(-) diff --git a/OpenTween/AppendSettingDialog.cs b/OpenTween/AppendSettingDialog.cs index b7c34abc..be4e266a 100644 --- a/OpenTween/AppendSettingDialog.cs +++ b/OpenTween/AppendSettingDialog.cs @@ -78,6 +78,7 @@ namespace OpenTween this.TweetPrvPanel.LoadConfig(settingCommon); this.TweetActPanel.LoadConfig(settingCommon, settingLocal); this.ActionPanel.LoadConfig(settingCommon, settingLocal); + this.FontPanel.LoadConfig(settingLocal); } public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal) @@ -87,6 +88,7 @@ namespace OpenTween this.TweetPrvPanel.SaveConfig(settingCommon); this.TweetActPanel.SaveConfig(settingCommon, settingLocal); this.ActionPanel.SaveConfig(settingCommon, settingLocal); + this.FontPanel.SaveConfig(settingLocal); } private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e) @@ -212,14 +214,6 @@ namespace OpenTween #endif try { - FontUnread = this.FontPanel.lblUnread.Font; //未使用 - ColorUnread = this.FontPanel.lblUnread.ForeColor; - FontReaded = this.FontPanel.lblListFont.Font; //リストフォントとして使用 - ColorReaded = this.FontPanel.lblListFont.ForeColor; - ColorFav = this.FontPanel.lblFav.ForeColor; - ColorOWL = this.FontPanel.lblOWL.ForeColor; - ColorRetweet = this.FontPanel.lblRetweet.ForeColor; - FontDetail = this.FontPanel.lblDetail.Font; ColorSelf = this.FontPanel2.lblSelf.BackColor; ColorAtSelf = this.FontPanel2.lblAtSelf.BackColor; ColorTarget = this.FontPanel2.lblTarget.BackColor; @@ -229,9 +223,6 @@ namespace OpenTween ColorInputBackcolor = this.FontPanel2.lblInputBackcolor.BackColor; ColorInputFont = this.FontPanel2.lblInputFont.ForeColor; ColorListBackcolor = this.FontPanel2.lblListBackcolor.BackColor; - ColorDetailBackcolor = this.FontPanel.lblDetailBackcolor.BackColor; - ColorDetail = this.FontPanel.lblDetail.ForeColor; - ColorDetailLink = this.FontPanel.lblDetailLink.ForeColor; FontInputFont = this.FontPanel2.lblInputFont.Font; switch (this.PreviewPanel.cmbNameBalloon.SelectedIndex) { @@ -468,14 +459,6 @@ namespace OpenTween } } - this.FontPanel.lblListFont.Font = FontReaded; - this.FontPanel.lblUnread.Font = FontUnread; - this.FontPanel.lblUnread.ForeColor = ColorUnread; - this.FontPanel.lblListFont.ForeColor = ColorReaded; - this.FontPanel.lblFav.ForeColor = ColorFav; - this.FontPanel.lblOWL.ForeColor = ColorOWL; - this.FontPanel.lblRetweet.ForeColor = ColorRetweet; - this.FontPanel.lblDetail.Font = FontDetail; this.FontPanel2.lblSelf.BackColor = ColorSelf; this.FontPanel2.lblAtSelf.BackColor = ColorAtSelf; this.FontPanel2.lblTarget.BackColor = ColorTarget; @@ -486,9 +469,6 @@ namespace OpenTween this.FontPanel2.lblInputFont.ForeColor = ColorInputFont; this.FontPanel2.lblInputFont.Font = FontInputFont; this.FontPanel2.lblListBackcolor.BackColor = ColorListBackcolor; - this.FontPanel.lblDetailBackcolor.BackColor = ColorDetailBackcolor; - this.FontPanel.lblDetail.ForeColor = ColorDetail; - this.FontPanel.lblDetailLink.ForeColor = ColorDetailLink; switch (NameBalloon) { @@ -862,16 +842,6 @@ namespace OpenTween } } - public Font FontUnread { get; set; } /////未使用 - public Color ColorUnread { get; set; } - public Font FontReaded { get; set; } /////リストフォントとして使用 - public Color ColorReaded { get; set; } - public Color ColorFav { get; set; } - public Color ColorOWL { get; set; } - public Color ColorRetweet { get; set; } - public Font FontDetail { get; set; } - public Color ColorDetail { get; set; } - public Color ColorDetailLink { get; set; } public Color ColorSelf { get; set; } public Color ColorAtSelf { get; set; } public Color ColorTarget { get; set; } @@ -882,7 +852,6 @@ namespace OpenTween public Color ColorInputFont { get; set; } public Font FontInputFont { get; set; } public Color ColorListBackcolor { get; set; } - public Color ColorDetailBackcolor { get; set; } public MyCommon.NameBalloonEnum NameBalloon { get; set; } public int CountApi { get; set; } public int CountApiReply { get; set; } diff --git a/OpenTween/Setting/Panel/FontPanel.cs b/OpenTween/Setting/Panel/FontPanel.cs index 8dd64fe8..67f168a9 100644 --- a/OpenTween/Setting/Panel/FontPanel.cs +++ b/OpenTween/Setting/Panel/FontPanel.cs @@ -42,6 +42,36 @@ namespace OpenTween.Setting.Panel InitializeComponent(); } + public void LoadConfig(SettingLocal settingLocal) + { + this.lblListFont.Font = settingLocal.FontRead; + this.lblUnread.Font = settingLocal.FontUnread; + this.lblUnread.ForeColor = settingLocal.ColorUnread; + this.lblListFont.ForeColor = settingLocal.ColorRead; + this.lblFav.ForeColor = settingLocal.ColorFav; + this.lblOWL.ForeColor = settingLocal.ColorOWL; + this.lblRetweet.ForeColor = settingLocal.ColorRetweet; + this.lblDetail.Font = settingLocal.FontDetail; + this.lblDetailBackcolor.BackColor = settingLocal.ColorDetailBackcolor; + this.lblDetail.ForeColor = settingLocal.ColorDetail; + this.lblDetailLink.ForeColor = settingLocal.ColorDetailLink; + } + + public void SaveConfig(SettingLocal settingLocal) + { + settingLocal.FontUnread = this.lblUnread.Font; // 未使用 + settingLocal.ColorUnread = this.lblUnread.ForeColor; + settingLocal.FontRead = this.lblListFont.Font; // リストフォントとして使用 + settingLocal.ColorRead = this.lblListFont.ForeColor; + settingLocal.ColorFav = this.lblFav.ForeColor; + settingLocal.ColorOWL = this.lblOWL.ForeColor; + settingLocal.ColorRetweet = this.lblRetweet.ForeColor; + settingLocal.FontDetail = this.lblDetail.Font; + settingLocal.ColorDetailBackcolor = this.lblDetailBackcolor.BackColor; + settingLocal.ColorDetail = this.lblDetail.ForeColor; + settingLocal.ColorDetailLink = this.lblDetailLink.ForeColor; + } + private void ButtonBackToDefaultFontColor_Click(object sender, EventArgs e) { lblUnread.ForeColor = SystemColors.ControlText; diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index 565bef16..82c910f3 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -770,17 +770,6 @@ namespace OpenTween this.PlaySoundMenuItem.Checked = this._cfgCommon.PlaySound; this.PlaySoundFileMenuItem.Checked = this._cfgCommon.PlaySound; //フォント&文字色&背景色 - SettingDialog.FontUnread = _fntUnread; - SettingDialog.ColorUnread = _clUnread; - SettingDialog.FontReaded = _fntReaded; - SettingDialog.ColorReaded = _clReaded; - SettingDialog.ColorFav = _clFav; - SettingDialog.ColorOWL = _clOWL; - SettingDialog.ColorRetweet = _clRetweet; - SettingDialog.FontDetail = _fntDetail; - SettingDialog.ColorDetail = _clDetail; - SettingDialog.ColorDetailLink = _clDetailLink; - SettingDialog.ColorDetailBackcolor = _clDetailBackcolor; SettingDialog.ColorSelf = _clSelf; SettingDialog.ColorAtSelf = _clAtSelf; SettingDialog.ColorTarget = _clTarget; @@ -912,17 +901,17 @@ namespace OpenTween //新しい設定を反映 //フォント&文字色&背景色保持 - _fntUnread = SettingDialog.FontUnread; - _clUnread = SettingDialog.ColorUnread; - _fntReaded = SettingDialog.FontReaded; - _clReaded = SettingDialog.ColorReaded; - _clFav = SettingDialog.ColorFav; - _clOWL = SettingDialog.ColorOWL; - _clRetweet = SettingDialog.ColorRetweet; - _fntDetail = SettingDialog.FontDetail; - _clDetail = SettingDialog.ColorDetail; - _clDetailLink = SettingDialog.ColorDetailLink; - _clDetailBackcolor = SettingDialog.ColorDetailBackcolor; + _fntUnread = this._cfgLocal.FontUnread; + _clUnread = this._cfgLocal.ColorUnread; + _fntReaded = this._cfgLocal.FontRead; + _clReaded = this._cfgLocal.ColorRead; + _clFav = this._cfgLocal.ColorFav; + _clOWL = this._cfgLocal.ColorOWL; + _clRetweet = this._cfgLocal.ColorRetweet; + _fntDetail = this._cfgLocal.FontDetail; + _clDetail = this._cfgLocal.ColorDetail; + _clDetailLink = this._cfgLocal.ColorDetailLink; + _clDetailBackcolor = this._cfgLocal.ColorDetailBackcolor; _clSelf = SettingDialog.ColorSelf; _clAtSelf = SettingDialog.ColorAtSelf; _clTarget = SettingDialog.ColorTarget; @@ -3945,17 +3934,17 @@ namespace OpenTween this.PlaySoundMenuItem.Checked = this._cfgCommon.PlaySound; this.PlaySoundFileMenuItem.Checked = this._cfgCommon.PlaySound; - _fntUnread = SettingDialog.FontUnread; - _clUnread = SettingDialog.ColorUnread; - _fntReaded = SettingDialog.FontReaded; - _clReaded = SettingDialog.ColorReaded; - _clFav = SettingDialog.ColorFav; - _clOWL = SettingDialog.ColorOWL; - _clRetweet = SettingDialog.ColorRetweet; - _fntDetail = SettingDialog.FontDetail; - _clDetail = SettingDialog.ColorDetail; - _clDetailLink = SettingDialog.ColorDetailLink; - _clDetailBackcolor = SettingDialog.ColorDetailBackcolor; + _fntUnread = this._cfgLocal.FontUnread; + _clUnread = this._cfgLocal.ColorUnread; + _fntReaded = this._cfgLocal.FontRead; + _clReaded = this._cfgLocal.ColorRead; + _clFav = this._cfgLocal.ColorFav; + _clOWL = this._cfgLocal.ColorOWL; + _clRetweet = this._cfgLocal.ColorRetweet; + _fntDetail = this._cfgLocal.FontDetail; + _clDetail = this._cfgLocal.ColorDetail; + _clDetailLink = this._cfgLocal.ColorDetailLink; + _clDetailBackcolor = this._cfgLocal.ColorDetailBackcolor; _clSelf = SettingDialog.ColorSelf; _clAtSelf = SettingDialog.ColorAtSelf; _clTarget = SettingDialog.ColorTarget; @@ -6896,9 +6885,9 @@ namespace OpenTween if (tags.Count > 0) { if (forward) - tags[0].ScrollTop += SettingDialog.FontDetail.Height; + tags[0].ScrollTop += this._fntDetail.Height; else - tags[0].ScrollTop -= SettingDialog.FontDetail.Height; + tags[0].ScrollTop -= this._fntDetail.Height; } } @@ -6911,9 +6900,9 @@ namespace OpenTween if (tags.Count > 0) { if (forward) - tags[0].ScrollTop += PostBrowser.ClientRectangle.Height - SettingDialog.FontDetail.Height; + tags[0].ScrollTop += PostBrowser.ClientRectangle.Height - this._fntDetail.Height; else - tags[0].ScrollTop -= PostBrowser.ClientRectangle.Height - SettingDialog.FontDetail.Height; + tags[0].ScrollTop -= PostBrowser.ClientRectangle.Height - this._fntDetail.Height; } } -- 2.11.0