OSDN Git Service

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

index be4e266..095023e 100644 (file)
@@ -79,6 +79,7 @@ namespace OpenTween
             this.TweetActPanel.LoadConfig(settingCommon, settingLocal);
             this.ActionPanel.LoadConfig(settingCommon, settingLocal);
             this.FontPanel.LoadConfig(settingLocal);
+            this.FontPanel2.LoadConfig(settingLocal);
         }
 
         public void SaveConfig(SettingCommon settingCommon, SettingLocal settingLocal)
@@ -89,6 +90,7 @@ namespace OpenTween
             this.TweetActPanel.SaveConfig(settingCommon, settingLocal);
             this.ActionPanel.SaveConfig(settingCommon, settingLocal);
             this.FontPanel.SaveConfig(settingLocal);
+            this.FontPanel2.SaveConfig(settingLocal);
         }
 
         private void TreeViewSetting_BeforeSelect(object sender, TreeViewCancelEventArgs e)
@@ -214,16 +216,6 @@ namespace OpenTween
 #endif
             try
             {
-                ColorSelf = this.FontPanel2.lblSelf.BackColor;
-                ColorAtSelf = this.FontPanel2.lblAtSelf.BackColor;
-                ColorTarget = this.FontPanel2.lblTarget.BackColor;
-                ColorAtTarget = this.FontPanel2.lblAtTarget.BackColor;
-                ColorAtFromTarget = this.FontPanel2.lblAtFromTarget.BackColor;
-                ColorAtTo = this.FontPanel2.lblAtTo.BackColor;
-                ColorInputBackcolor = this.FontPanel2.lblInputBackcolor.BackColor;
-                ColorInputFont = this.FontPanel2.lblInputFont.ForeColor;
-                ColorListBackcolor = this.FontPanel2.lblListBackcolor.BackColor;
-                FontInputFont = this.FontPanel2.lblInputFont.Font;
                 switch (this.PreviewPanel.cmbNameBalloon.SelectedIndex)
                 {
                     case 0:
@@ -459,17 +451,6 @@ namespace OpenTween
                 }
             }
 
-            this.FontPanel2.lblSelf.BackColor = ColorSelf;
-            this.FontPanel2.lblAtSelf.BackColor = ColorAtSelf;
-            this.FontPanel2.lblTarget.BackColor = ColorTarget;
-            this.FontPanel2.lblAtTarget.BackColor = ColorAtTarget;
-            this.FontPanel2.lblAtFromTarget.BackColor = ColorAtFromTarget;
-            this.FontPanel2.lblAtTo.BackColor = ColorAtTo;
-            this.FontPanel2.lblInputBackcolor.BackColor = ColorInputBackcolor;
-            this.FontPanel2.lblInputFont.ForeColor = ColorInputFont;
-            this.FontPanel2.lblInputFont.Font = FontInputFont;
-            this.FontPanel2.lblListBackcolor.BackColor = ColorListBackcolor;
-
             switch (NameBalloon)
             {
                 case MyCommon.NameBalloonEnum.None:
@@ -842,16 +823,6 @@ namespace OpenTween
             }
         }
 
-        public Color ColorSelf { get; set; }
-        public Color ColorAtSelf { get; set; }
-        public Color ColorTarget { get; set; }
-        public Color ColorAtTarget { get; set; }
-        public Color ColorAtFromTarget { get; set; }
-        public Color ColorAtTo { get; set; }
-        public Color ColorInputBackcolor { get; set; }
-        public Color ColorInputFont { get; set; }
-        public Font FontInputFont { get; set; }
-        public Color ColorListBackcolor { get; set; }
         public MyCommon.NameBalloonEnum NameBalloon { get; set; }
         public int CountApi { get; set; }
         public int CountApiReply { get; set; }
index 3db78d1..6db11a9 100644 (file)
@@ -42,6 +42,34 @@ namespace OpenTween.Setting.Panel
             InitializeComponent();
         }
 
+        public void LoadConfig(SettingLocal settingLocal)
+        {
+            this.lblSelf.BackColor = settingLocal.ColorSelf;
+            this.lblAtSelf.BackColor = settingLocal.ColorAtSelf;
+            this.lblTarget.BackColor = settingLocal.ColorTarget;
+            this.lblAtTarget.BackColor = settingLocal.ColorAtTarget;
+            this.lblAtFromTarget.BackColor = settingLocal.ColorAtFromTarget;
+            this.lblAtTo.BackColor = settingLocal.ColorAtTo;
+            this.lblInputBackcolor.BackColor = settingLocal.ColorInputBackcolor;
+            this.lblInputFont.ForeColor = settingLocal.ColorInputFont;
+            this.lblInputFont.Font = settingLocal.FontInputFont;
+            this.lblListBackcolor.BackColor = settingLocal.ColorListBackcolor;
+        }
+
+        public void SaveConfig(SettingLocal settingLocal)
+        {
+            settingLocal.ColorSelf = this.lblSelf.BackColor;
+            settingLocal.ColorAtSelf = this.lblAtSelf.BackColor;
+            settingLocal.ColorTarget = this.lblTarget.BackColor;
+            settingLocal.ColorAtTarget = this.lblAtTarget.BackColor;
+            settingLocal.ColorAtFromTarget = this.lblAtFromTarget.BackColor;
+            settingLocal.ColorAtTo = this.lblAtTo.BackColor;
+            settingLocal.ColorInputBackcolor = this.lblInputBackcolor.BackColor;
+            settingLocal.ColorInputFont = this.lblInputFont.ForeColor;
+            settingLocal.ColorListBackcolor = this.lblListBackcolor.BackColor;
+            settingLocal.FontInputFont = this.lblInputFont.Font;
+        }
+
         private void ButtonBackToDefaultFontColor2_Click(object sender, EventArgs e)
         {
             lblInputFont.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
index 82c910f..d5025b2 100644 (file)
@@ -769,17 +769,6 @@ namespace OpenTween
             //サウンド再生(タブ別設定より優先)
             this.PlaySoundMenuItem.Checked = this._cfgCommon.PlaySound;
             this.PlaySoundFileMenuItem.Checked = this._cfgCommon.PlaySound;
-            //フォント&文字色&背景色
-            SettingDialog.ColorSelf = _clSelf;
-            SettingDialog.ColorAtSelf = _clAtSelf;
-            SettingDialog.ColorTarget = _clTarget;
-            SettingDialog.ColorAtTarget = _clAtTarget;
-            SettingDialog.ColorAtFromTarget = _clAtFromTarget;
-            SettingDialog.ColorAtTo = _clAtTo;
-            SettingDialog.ColorListBackcolor = _clListBackcolor;
-            SettingDialog.ColorInputBackcolor = _clInputBackcolor;
-            SettingDialog.ColorInputFont = _clInputFont;
-            SettingDialog.FontInputFont = _fntInputFont;
 
             SettingDialog.NameBalloon = _cfgCommon.NameBalloon;
 
@@ -912,16 +901,16 @@ namespace OpenTween
                 _clDetail = this._cfgLocal.ColorDetail;
                 _clDetailLink = this._cfgLocal.ColorDetailLink;
                 _clDetailBackcolor = this._cfgLocal.ColorDetailBackcolor;
-                _clSelf = SettingDialog.ColorSelf;
-                _clAtSelf = SettingDialog.ColorAtSelf;
-                _clTarget = SettingDialog.ColorTarget;
-                _clAtTarget = SettingDialog.ColorAtTarget;
-                _clAtFromTarget = SettingDialog.ColorAtFromTarget;
-                _clAtTo = SettingDialog.ColorAtTo;
-                _clListBackcolor = SettingDialog.ColorListBackcolor;
-                _clInputBackcolor = SettingDialog.ColorInputBackcolor;
-                _clInputFont = SettingDialog.ColorInputFont;
-                _fntInputFont = SettingDialog.FontInputFont;
+                _clSelf = this._cfgLocal.ColorSelf;
+                _clAtSelf = this._cfgLocal.ColorAtSelf;
+                _clTarget = this._cfgLocal.ColorTarget;
+                _clAtTarget = this._cfgLocal.ColorAtTarget;
+                _clAtFromTarget = this._cfgLocal.ColorAtFromTarget;
+                _clAtTo = this._cfgLocal.ColorAtTo;
+                _clListBackcolor = this._cfgLocal.ColorListBackcolor;
+                _clInputBackcolor = this._cfgLocal.ColorInputBackcolor;
+                _clInputFont = this._cfgLocal.ColorInputFont;
+                _fntInputFont = this._cfgLocal.FontInputFont;
 
                 //他の設定項目は、随時設定画面で保持している値を読み出して使用
             }
@@ -3945,16 +3934,16 @@ namespace OpenTween
                     _clDetail = this._cfgLocal.ColorDetail;
                     _clDetailLink = this._cfgLocal.ColorDetailLink;
                     _clDetailBackcolor = this._cfgLocal.ColorDetailBackcolor;
-                    _clSelf = SettingDialog.ColorSelf;
-                    _clAtSelf = SettingDialog.ColorAtSelf;
-                    _clTarget = SettingDialog.ColorTarget;
-                    _clAtTarget = SettingDialog.ColorAtTarget;
-                    _clAtFromTarget = SettingDialog.ColorAtFromTarget;
-                    _clAtTo = SettingDialog.ColorAtTo;
-                    _clListBackcolor = SettingDialog.ColorListBackcolor;
-                    _clInputBackcolor = SettingDialog.ColorInputBackcolor;
-                    _clInputFont = SettingDialog.ColorInputFont;
-                    _fntInputFont = SettingDialog.FontInputFont;
+                    _clSelf = this._cfgLocal.ColorSelf;
+                    _clAtSelf = this._cfgLocal.ColorAtSelf;
+                    _clTarget = this._cfgLocal.ColorTarget;
+                    _clAtTarget = this._cfgLocal.ColorAtTarget;
+                    _clAtFromTarget = this._cfgLocal.ColorAtFromTarget;
+                    _clAtTo = this._cfgLocal.ColorAtTo;
+                    _clListBackcolor = this._cfgLocal.ColorListBackcolor;
+                    _clInputBackcolor = this._cfgLocal.ColorInputBackcolor;
+                    _clInputFont = this._cfgLocal.ColorInputFont;
+                    _fntInputFont = this._cfgLocal.FontInputFont;
                     _brsBackColorMine.Dispose();
                     _brsBackColorAt.Dispose();
                     _brsBackColorYou.Dispose();