diff --git a/Compact RAM Cleaner/Controls/ColorDialogProvider.cs b/Compact RAM Cleaner/Controls/ColorDialogProvider.cs index f3a1c16..c0cdfa9 100644 --- a/Compact RAM Cleaner/Controls/ColorDialogProvider.cs +++ b/Compact RAM Cleaner/Controls/ColorDialogProvider.cs @@ -25,26 +25,26 @@ public Color Color public event EventHandler OnColorChanged; - public ColorDialogProvider() + protected override void OnMouseEnter(EventArgs e) { - MouseEnter += (s, e) => - { - _drawOutline = true; - Refresh(); - }; + base.OnMouseEnter(e); + _drawOutline = true; + Refresh(); + } - MouseLeave += (s, e) => - { - _drawOutline = false; - Refresh(); - }; + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + _drawOutline = false; + Refresh(); + } - Click += (s, e) => - { - var cd = new ColorDialog { Color = _color, FullOpen = true }; - if (cd.ShowDialog() == DialogResult.OK) - Color = cd.Color; - }; + protected override void OnClick(EventArgs e) + { + base.OnClick(e); + var cd = new ColorDialog { Color = _color, FullOpen = true }; + if (cd.ShowDialog() == DialogResult.OK) + Color = cd.Color; } protected override void OnPaint(PaintEventArgs e) diff --git a/Compact RAM Cleaner/Controls/GroupPanel.cs b/Compact RAM Cleaner/Controls/GroupPanel.cs index 8293f30..41132a2 100644 --- a/Compact RAM Cleaner/Controls/GroupPanel.cs +++ b/Compact RAM Cleaner/Controls/GroupPanel.cs @@ -7,11 +7,28 @@ public class GroupPanel : Panel { readonly int _indent = 10; readonly int _cornerRadius = 6; + readonly Label _label; + + string _title = ""; + public string Title + { + get => _title; + set + { + _title = value; + _label.Text = _title; + } + } + + public GroupPanel() + { + _label = new Label { AutoSize = true, Location = new Point(20, 3), Text = Title }; + Controls.Add(_label); + } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); - using (var pen = new Pen(SystemColors.ControlDarkDark)) e.Graphics.DrawRoundedRectangle(pen, new Rectangle(_indent, _indent, Width - (_indent * 2), Height - (_indent * 2)), _cornerRadius); } diff --git a/Compact RAM Cleaner/Forms/Settings.Designer.cs b/Compact RAM Cleaner/Forms/Settings.Designer.cs index a3de6ac..fa2e180 100644 --- a/Compact RAM Cleaner/Forms/Settings.Designer.cs +++ b/Compact RAM Cleaner/Forms/Settings.Designer.cs @@ -43,7 +43,6 @@ private void InitializeComponent() this.RadioButtonUA = new System.Windows.Forms.RadioButton(); this.RadioButtonRU = new System.Windows.Forms.RadioButton(); this.RadioButtonEN = new System.Windows.Forms.RadioButton(); - this.LabelGroup2 = new System.Windows.Forms.Label(); this.groupPanel1 = new Compact_RAM_Cleaner.GroupPanel(); this.StartMinimizedCheck = new System.Windows.Forms.CheckBox(); this.NumericContainer = new System.Windows.Forms.Panel(); @@ -53,7 +52,6 @@ private void InitializeComponent() this.AutoClearCheck = new System.Windows.Forms.CheckBox(); this.AutorunCheck = new System.Windows.Forms.CheckBox(); this.AutoUpdateCheck = new System.Windows.Forms.CheckBox(); - this.LabelGroup1 = new System.Windows.Forms.Label(); this.TabPanel2 = new System.Windows.Forms.Panel(); this.groupPanel4 = new Compact_RAM_Cleaner.GroupPanel(); this.ColorsPanel = new System.Windows.Forms.Panel(); @@ -65,7 +63,6 @@ private void InitializeComponent() this.TrayTheme1 = new System.Windows.Forms.Panel(); this.TrayTheme0 = new System.Windows.Forms.Panel(); this.LabelCustomStyle = new System.Windows.Forms.Label(); - this.LabelGroup4 = new System.Windows.Forms.Label(); this.groupPanel3 = new Compact_RAM_Cleaner.GroupPanel(); this.radioButton2 = new System.Windows.Forms.RadioButton(); this.radioButton1 = new System.Windows.Forms.RadioButton(); @@ -74,7 +71,6 @@ private void InitializeComponent() this.CheckBoxTextShadow = new System.Windows.Forms.CheckBox(); this.TrayTextColor = new Compact_RAM_Cleaner.ColorDialogProvider(); this.LabelTextColor = new System.Windows.Forms.Label(); - this.LabelGroup3 = new System.Windows.Forms.Label(); this.TabPanel3 = new System.Windows.Forms.Panel(); this.AboutLink4 = new System.Windows.Forms.LinkLabel(); this.label6 = new System.Windows.Forms.Label(); @@ -184,11 +180,11 @@ private void InitializeComponent() this.groupPanel2.Controls.Add(this.RadioButtonUA); this.groupPanel2.Controls.Add(this.RadioButtonRU); this.groupPanel2.Controls.Add(this.RadioButtonEN); - this.groupPanel2.Controls.Add(this.LabelGroup2); this.groupPanel2.Location = new System.Drawing.Point(0, 152); this.groupPanel2.Name = "groupPanel2"; this.groupPanel2.Size = new System.Drawing.Size(320, 106); this.groupPanel2.TabIndex = 1; + this.groupPanel2.Title = "Language"; // // label3 // @@ -252,15 +248,6 @@ private void InitializeComponent() this.RadioButtonEN.Text = "English"; this.RadioButtonEN.UseVisualStyleBackColor = true; // - // LabelGroup2 - // - this.LabelGroup2.AutoSize = true; - this.LabelGroup2.Location = new System.Drawing.Point(20, 3); - this.LabelGroup2.Name = "LabelGroup2"; - this.LabelGroup2.Size = new System.Drawing.Size(54, 13); - this.LabelGroup2.TabIndex = 1; - this.LabelGroup2.Text = "Language"; - // // groupPanel1 // this.groupPanel1.Controls.Add(this.StartMinimizedCheck); @@ -269,11 +256,11 @@ private void InitializeComponent() this.groupPanel1.Controls.Add(this.AutoClearCheck); this.groupPanel1.Controls.Add(this.AutorunCheck); this.groupPanel1.Controls.Add(this.AutoUpdateCheck); - this.groupPanel1.Controls.Add(this.LabelGroup1); this.groupPanel1.Location = new System.Drawing.Point(0, 0); this.groupPanel1.Name = "groupPanel1"; this.groupPanel1.Size = new System.Drawing.Size(320, 152); this.groupPanel1.TabIndex = 0; + this.groupPanel1.Title = "General"; // // StartMinimizedCheck // @@ -374,15 +361,6 @@ private void InitializeComponent() this.AutoUpdateCheck.Text = "Automatically check for updates"; this.AutoUpdateCheck.UseVisualStyleBackColor = true; // - // LabelGroup1 - // - this.LabelGroup1.AutoSize = true; - this.LabelGroup1.Location = new System.Drawing.Point(20, 3); - this.LabelGroup1.Name = "LabelGroup1"; - this.LabelGroup1.Size = new System.Drawing.Size(44, 13); - this.LabelGroup1.TabIndex = 1; - this.LabelGroup1.Text = "General"; - // // TabPanel2 // this.TabPanel2.Controls.Add(this.groupPanel4); @@ -401,11 +379,11 @@ private void InitializeComponent() this.groupPanel4.Controls.Add(this.TrayTheme1); this.groupPanel4.Controls.Add(this.TrayTheme0); this.groupPanel4.Controls.Add(this.LabelCustomStyle); - this.groupPanel4.Controls.Add(this.LabelGroup4); this.groupPanel4.Location = new System.Drawing.Point(0, 128); this.groupPanel4.Name = "groupPanel4"; this.groupPanel4.Size = new System.Drawing.Size(320, 162); this.groupPanel4.TabIndex = 1; + this.groupPanel4.Title = "Style"; // // ColorsPanel // @@ -465,7 +443,7 @@ private void InitializeComponent() // // TrayTheme0 // - this.TrayTheme0.Location = new System.Drawing.Point(24, 99); + this.TrayTheme0.Location = new System.Drawing.Point(24, 98); this.TrayTheme0.Name = "TrayTheme0"; this.TrayTheme0.Size = new System.Drawing.Size(38, 38); this.TrayTheme0.TabIndex = 4; @@ -479,15 +457,6 @@ private void InitializeComponent() this.LabelCustomStyle.TabIndex = 3; this.LabelCustomStyle.Text = "Custom"; // - // LabelGroup4 - // - this.LabelGroup4.AutoSize = true; - this.LabelGroup4.Location = new System.Drawing.Point(20, 3); - this.LabelGroup4.Name = "LabelGroup4"; - this.LabelGroup4.Size = new System.Drawing.Size(31, 13); - this.LabelGroup4.TabIndex = 2; - this.LabelGroup4.Text = "Style"; - // // groupPanel3 // this.groupPanel3.Controls.Add(this.radioButton2); @@ -497,11 +466,11 @@ private void InitializeComponent() this.groupPanel3.Controls.Add(this.CheckBoxTextShadow); this.groupPanel3.Controls.Add(this.TrayTextColor); this.groupPanel3.Controls.Add(this.LabelTextColor); - this.groupPanel3.Controls.Add(this.LabelGroup3); this.groupPanel3.Location = new System.Drawing.Point(0, 0); this.groupPanel3.Name = "groupPanel3"; this.groupPanel3.Size = new System.Drawing.Size(320, 128); this.groupPanel3.TabIndex = 0; + this.groupPanel3.Title = "General"; // // radioButton2 // @@ -571,15 +540,6 @@ private void InitializeComponent() this.LabelTextColor.TabIndex = 3; this.LabelTextColor.Text = "Text color"; // - // LabelGroup3 - // - this.LabelGroup3.AutoSize = true; - this.LabelGroup3.Location = new System.Drawing.Point(20, 3); - this.LabelGroup3.Name = "LabelGroup3"; - this.LabelGroup3.Size = new System.Drawing.Size(44, 13); - this.LabelGroup3.TabIndex = 2; - this.LabelGroup3.Text = "General"; - // // TabPanel3 // this.TabPanel3.Controls.Add(this.AboutLink4); @@ -606,7 +566,7 @@ private void InitializeComponent() this.AboutLink4.ForeColor = System.Drawing.Color.Silver; this.AboutLink4.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; this.AboutLink4.LinkColor = System.Drawing.Color.Silver; - this.AboutLink4.Location = new System.Drawing.Point(91, 62); + this.AboutLink4.Location = new System.Drawing.Point(90, 62); this.AboutLink4.Name = "AboutLink4"; this.AboutLink4.Size = new System.Drawing.Size(39, 13); this.AboutLink4.TabIndex = 10; @@ -618,7 +578,7 @@ private void InitializeComponent() // this.label6.AutoSize = true; this.label6.ForeColor = System.Drawing.Color.Silver; - this.label6.Location = new System.Drawing.Point(72, 63); + this.label6.Location = new System.Drawing.Point(72, 62); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(17, 13); this.label6.TabIndex = 9; @@ -784,9 +744,7 @@ private void InitializeComponent() private System.Windows.Forms.Panel NumericContainer; private System.Windows.Forms.NumericUpDown Numeric1; private System.Windows.Forms.Panel Panel1; - private System.Windows.Forms.Label LabelGroup1; private GroupPanel groupPanel2; - private System.Windows.Forms.Label LabelGroup2; private System.Windows.Forms.CheckBox CleaningResultsCheck; private System.Windows.Forms.CheckBox AutoClearCheck; private System.Windows.Forms.CheckBox AutorunCheck; @@ -800,7 +758,6 @@ private void InitializeComponent() private System.Windows.Forms.Panel TabPanel2; private GroupPanel groupPanel3; private GroupPanel groupPanel4; - private System.Windows.Forms.Label LabelGroup3; private ColorDialogProvider TrayTextColor; private System.Windows.Forms.Label LabelTextColor; private System.Windows.Forms.CheckBox CheckBoxTextShadow; @@ -808,7 +765,6 @@ private void InitializeComponent() private System.Windows.Forms.Label LabelMouseClick; private System.Windows.Forms.RadioButton radioButton2; private System.Windows.Forms.RadioButton radioButton1; - private System.Windows.Forms.Label LabelGroup4; private System.Windows.Forms.Label LabelCustomStyle; private System.Windows.Forms.Panel TrayTheme1; private System.Windows.Forms.Panel TrayTheme0; diff --git a/Compact RAM Cleaner/Forms/Settings.cs b/Compact RAM Cleaner/Forms/Settings.cs index 9ff333f..8d1bc12 100644 --- a/Compact RAM Cleaner/Forms/Settings.cs +++ b/Compact RAM Cleaner/Forms/Settings.cs @@ -579,15 +579,15 @@ public bool TryGetColor(string s, out Color color) void UpdateTranslation() { LabelResetSettings.Text = Translations.GetString("ResetSettings"); - LabelGroup1.Text = Translations.GetString("GeneralSettings"); + groupPanel1.Title = Translations.GetString("GeneralSettings"); AutoUpdateCheck.Text = Translations.GetString("AutoUpdate"); AutorunCheck.Text = Translations.GetString("Autorun"); AutoClearCheck.Text = Translations.GetString("AutoClear"); CleaningResultsCheck.Text = Translations.GetString("ShowCleaningResults"); StartMinimizedCheck.Text = Translations.GetString("StartMinimized"); - LabelGroup2.Text = Translations.GetString("Language"); + groupPanel2.Title = Translations.GetString("Language"); - LabelGroup3.Text = Translations.GetString("GeneralSettings"); + groupPanel3.Title = Translations.GetString("GeneralSettings"); LabelTextColor.Text = Translations.GetString("TextColor"); TrayTextColor.Location = new Point(LabelTextColor.Location.X + LabelTextColor.Width, TrayTextColor.Location.Y); CheckBoxTextShadow.Text = Translations.GetString("TextShadow"); @@ -597,7 +597,7 @@ void UpdateTranslation() radioButton1.Text = Translations.GetString("ClearRAM"); radioButton2.Text = Translations.GetString("OpenTaskManager"); - LabelGroup4.Text = Translations.GetString("Style"); + groupPanel4.Title = Translations.GetString("Style"); LabelCustomStyle.Text = Translations.GetString("Custom"); AboutLabel1.Text = Translations.GetString("AboutString1"); diff --git a/Compact RAM Cleaner/Properties/AssemblyInfo.cs b/Compact RAM Cleaner/Properties/AssemblyInfo.cs index 3cb234e..18d007d 100644 --- a/Compact RAM Cleaner/Properties/AssemblyInfo.cs +++ b/Compact RAM Cleaner/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: AssemblyVersion("1.1.1.0")] +[assembly: AssemblyFileVersion("1.1.1.0")]