OSDN Git Service

usingの順序を揃える (SA1208, SA1210)
[opentween/open-tween.git] / OpenTween / Setting / Panel / FontPanel2.cs
1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 //           (c) 2008-2011 Moz (@syo68k)
4 //           (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 //           (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 //           (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 //           (c) 2014      kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
8 // All rights reserved.
9 //
10 // This file is part of OpenTween.
11 //
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 3 of the License, or (at your option)
15 // any later version.
16 //
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 // for more details.
21 //
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
24 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
25 // Boston, MA 02110-1301, USA.
26
27 #nullable enable
28
29 using System;
30 using System.Collections.Generic;
31 using System.ComponentModel;
32 using System.Data;
33 using System.Drawing;
34 using System.Linq;
35 using System.Text;
36 using System.Windows.Forms;
37
38 namespace OpenTween.Setting.Panel
39 {
40     public partial class FontPanel2 : SettingPanelBase
41     {
42         public FontPanel2()
43             => this.InitializeComponent();
44
45         public void LoadConfig(SettingLocal settingLocal)
46         {
47             this.lblSelf.BackColor = settingLocal.ColorSelf;
48             this.lblAtSelf.BackColor = settingLocal.ColorAtSelf;
49             this.lblTarget.BackColor = settingLocal.ColorTarget;
50             this.lblAtTarget.BackColor = settingLocal.ColorAtTarget;
51             this.lblAtFromTarget.BackColor = settingLocal.ColorAtFromTarget;
52             this.lblAtTo.BackColor = settingLocal.ColorAtTo;
53             this.lblInputBackcolor.BackColor = settingLocal.ColorInputBackcolor;
54             this.lblInputFont.ForeColor = settingLocal.ColorInputFont;
55             this.lblInputFont.Font = settingLocal.FontInputFont;
56             this.lblListBackcolor.BackColor = settingLocal.ColorListBackcolor;
57         }
58
59         public void SaveConfig(SettingLocal settingLocal)
60         {
61             settingLocal.ColorSelf = this.lblSelf.BackColor;
62             settingLocal.ColorAtSelf = this.lblAtSelf.BackColor;
63             settingLocal.ColorTarget = this.lblTarget.BackColor;
64             settingLocal.ColorAtTarget = this.lblAtTarget.BackColor;
65             settingLocal.ColorAtFromTarget = this.lblAtFromTarget.BackColor;
66             settingLocal.ColorAtTo = this.lblAtTo.BackColor;
67             settingLocal.ColorInputBackcolor = this.lblInputBackcolor.BackColor;
68             settingLocal.ColorInputFont = this.lblInputFont.ForeColor;
69             settingLocal.ColorListBackcolor = this.lblListBackcolor.BackColor;
70             settingLocal.FontInputFont = this.lblInputFont.Font;
71         }
72
73         private void ButtonBackToDefaultFontColor2_Click(object sender, EventArgs e)
74         {
75             this.lblInputFont.ForeColor = Color.FromKnownColor(System.Drawing.KnownColor.ControlText);
76             this.lblInputFont.Font = System.Drawing.SystemFonts.DefaultFont;
77
78             this.lblSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AliceBlue);
79
80             this.lblAtSelf.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.AntiqueWhite);
81
82             this.lblTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
83
84             this.lblAtTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LavenderBlush);
85
86             this.lblAtFromTarget.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Honeydew);
87
88             this.lblInputBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.LemonChiffon);
89
90             this.lblAtTo.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Pink);
91
92             this.lblListBackcolor.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Window);
93         }
94
95         private void btnSelf_Click(object sender, EventArgs e)
96             => this.ShowBackColorDialog(this.lblSelf);
97
98         private void btnAtSelf_Click(object sender, EventArgs e)
99             => this.ShowBackColorDialog(this.lblAtSelf);
100
101         private void btnTarget_Click(object sender, EventArgs e)
102             => this.ShowBackColorDialog(this.lblTarget);
103
104         private void btnAtTarget_Click(object sender, EventArgs e)
105             => this.ShowBackColorDialog(this.lblAtTarget);
106
107         private void btnAtFromTarget_Click(object sender, EventArgs e)
108             => this.ShowBackColorDialog(this.lblAtFromTarget);
109
110         private void btnAtTo_Click(object sender, EventArgs e)
111             => this.ShowBackColorDialog(this.lblAtTo);
112
113         private void btnListBack_Click(object sender, EventArgs e)
114             => this.ShowBackColorDialog(this.lblListBackcolor);
115
116         private void btnInputBackcolor_Click(object sender, EventArgs e)
117             => this.ShowBackColorDialog(this.lblInputBackcolor);
118
119         private void btnInputFont_Click(object sender, EventArgs e)
120             => this.ShowFontDialog(this.lblInputFont);
121     }
122 }