OSDN Git Service

FontPanelに対する設定値の設定・取得を LoadConfing/SaveConfig メソッドに移動
authorKimura Youichi <kim.upsilon@bucyou.net>
Sun, 27 Jul 2014 04:00:11 +0000 (13:00 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Thu, 31 Jul 2014 16:16:49 +0000 (01:16 +0900)
OpenTween/AppendSettingDialog.cs
OpenTween/Setting/Panel/FontPanel.cs
OpenTween/Tween.cs

index b7c34ab..be4e266 100644 (file)
@@ -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; }
index 8dd64fe..67f168a 100644 (file)
@@ -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;
index 565bef1..82c910f 100644 (file)
@@ -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;
             }
         }