From f31a94dd419f85af54e017bfe74d70d48d6f3ad3 Mon Sep 17 00:00:00 2001 From: Kirill Date: Sat, 9 Feb 2019 19:51:52 +0300 Subject: [PATCH] Color(Favorit fishka) --- BorsenoTextEditor.csproj | 10 +++--- Main menu.Designer.cs => Mainmenu.Designer.cs | 34 ++++++++++--------- Main menu.cs => Mainmenu.cs | 18 +++++++--- Main menu.resx => Mainmenu.resx | 0 4 files changed, 36 insertions(+), 26 deletions(-) rename Main menu.Designer.cs => Mainmenu.Designer.cs (88%) rename Main menu.cs => Mainmenu.cs (91%) rename Main menu.resx => Mainmenu.resx (100%) diff --git a/BorsenoTextEditor.csproj b/BorsenoTextEditor.csproj index 4159ac5..fce4b7b 100644 --- a/BorsenoTextEditor.csproj +++ b/BorsenoTextEditor.csproj @@ -66,11 +66,11 @@ - + Form - - Main menu.cs + + Mainmenu.cs @@ -83,8 +83,8 @@ ChooseFileFromDBForm.cs - - Main menu.cs + + Mainmenu.cs ResXFileCodeGenerator diff --git a/Main menu.Designer.cs b/Mainmenu.Designer.cs similarity index 88% rename from Main menu.Designer.cs rename to Mainmenu.Designer.cs index 9a8d4be..5c10afe 100644 --- a/Main menu.Designer.cs +++ b/Mainmenu.Designer.cs @@ -52,8 +52,9 @@ private void InitializeComponent() // // Input // + this.Input.BackColor = System.Drawing.SystemColors.ControlDarkDark; this.Input.Font = new System.Drawing.Font("Times New Roman", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.Input.Location = new System.Drawing.Point(12, 84); + this.Input.Location = new System.Drawing.Point(12, 50); this.Input.Name = "Input"; this.Input.Size = new System.Drawing.Size(972, 545); this.Input.TabIndex = 0; @@ -64,7 +65,7 @@ private void InitializeComponent() // this.FileChoosing.Location = new System.Drawing.Point(12, 12); this.FileChoosing.Name = "FileChoosing"; - this.FileChoosing.Size = new System.Drawing.Size(170, 56); + this.FileChoosing.Size = new System.Drawing.Size(120, 32); this.FileChoosing.TabIndex = 1; this.FileChoosing.Text = "Choose file to edit"; this.FileChoosing.UseVisualStyleBackColor = true; @@ -72,9 +73,9 @@ private void InitializeComponent() // // Clear // - this.Clear.Location = new System.Drawing.Point(814, 12); + this.Clear.Location = new System.Drawing.Point(852, 12); this.Clear.Name = "Clear"; - this.Clear.Size = new System.Drawing.Size(170, 56); + this.Clear.Size = new System.Drawing.Size(132, 32); this.Clear.TabIndex = 2; this.Clear.Text = "Clear"; this.Clear.UseVisualStyleBackColor = true; @@ -82,9 +83,9 @@ private void InitializeComponent() // // Save // - this.Save.Location = new System.Drawing.Point(638, 12); + this.Save.Location = new System.Drawing.Point(714, 12); this.Save.Name = "Save"; - this.Save.Size = new System.Drawing.Size(170, 56); + this.Save.Size = new System.Drawing.Size(132, 32); this.Save.TabIndex = 3; this.Save.Text = "Save"; this.Save.UseVisualStyleBackColor = true; @@ -96,9 +97,9 @@ private void InitializeComponent() // // button1 // - this.button1.Location = new System.Drawing.Point(188, 12); + this.button1.Location = new System.Drawing.Point(138, 12); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(179, 56); + this.button1.Size = new System.Drawing.Size(123, 32); this.button1.TabIndex = 4; this.button1.Text = "Unchoose file (reset)"; this.button1.UseVisualStyleBackColor = true; @@ -106,16 +107,16 @@ private void InitializeComponent() // // CurrentFileNameValue // - this.CurrentFileNameValue.Location = new System.Drawing.Point(373, 47); + this.CurrentFileNameValue.Location = new System.Drawing.Point(367, 19); this.CurrentFileNameValue.Name = "CurrentFileNameValue"; this.CurrentFileNameValue.ReadOnly = true; - this.CurrentFileNameValue.Size = new System.Drawing.Size(259, 20); + this.CurrentFileNameValue.Size = new System.Drawing.Size(341, 20); this.CurrentFileNameValue.TabIndex = 5; // // CurrentFileNameLabel // this.CurrentFileNameLabel.AutoSize = true; - this.CurrentFileNameLabel.Location = new System.Drawing.Point(443, 22); + this.CurrentFileNameLabel.Location = new System.Drawing.Point(267, 22); this.CurrentFileNameLabel.Name = "CurrentFileNameLabel"; this.CurrentFileNameLabel.Size = new System.Drawing.Size(94, 13); this.CurrentFileNameLabel.TabIndex = 6; @@ -123,9 +124,9 @@ private void InitializeComponent() // // FileMode // - this.FileMode.Location = new System.Drawing.Point(342, 708); + this.FileMode.Location = new System.Drawing.Point(12, 601); this.FileMode.Name = "FileMode"; - this.FileMode.Size = new System.Drawing.Size(110, 39); + this.FileMode.Size = new System.Drawing.Size(108, 39); this.FileMode.TabIndex = 7; this.FileMode.Text = "Explorer mode"; this.FileMode.UseVisualStyleBackColor = true; @@ -133,9 +134,9 @@ private void InitializeComponent() // // ScreenMode // - this.ScreenMode.Location = new System.Drawing.Point(500, 708); + this.ScreenMode.Location = new System.Drawing.Point(879, 601); this.ScreenMode.Name = "ScreenMode"; - this.ScreenMode.Size = new System.Drawing.Size(112, 39); + this.ScreenMode.Size = new System.Drawing.Size(105, 39); this.ScreenMode.TabIndex = 8; this.ScreenMode.Text = "Night mode"; this.ScreenMode.UseVisualStyleBackColor = true; @@ -145,7 +146,8 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(998, 759); + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(998, 649); this.Controls.Add(this.ScreenMode); this.Controls.Add(this.FileMode); this.Controls.Add(this.CurrentFileNameLabel); diff --git a/Main menu.cs b/Mainmenu.cs similarity index 91% rename from Main menu.cs rename to Mainmenu.cs index 952b7d7..72a2ed6 100644 --- a/Main menu.cs +++ b/Mainmenu.cs @@ -21,6 +21,7 @@ public partial class MainForm : Form private IFilePicker _filePicker; private IFileManager _fileManager; private FileMode _fileMode; + bool darkenable; private string CurrentFilePath { @@ -138,13 +139,20 @@ private void FileMode_Click(object sender, EventArgs e) CurrentFilePath = null; } - // TODO: Screen Mode (color) change private void ScreenMode_Click(object sender, EventArgs e) - { - bool isDark = ScreenMode.Text.StartsWith("Dark"); + { + if (darkenable == false) + { + this.BackColor = System.Drawing.Color.Black; + darkenable = true; + } - if (isDark) - this.BackColor = new Color(); + else if (darkenable == true) + { + this.BackColor = System.Drawing.Color.White; + darkenable = false; + return; + } } } } diff --git a/Main menu.resx b/Mainmenu.resx similarity index 100% rename from Main menu.resx rename to Mainmenu.resx