Added search panel border setting

This commit is contained in:
Alexander 2019-10-18 00:27:17 +03:00
parent 89e1e69f1a
commit cf2de9bc0e
6 changed files with 57 additions and 1 deletions

View file

@ -159,6 +159,9 @@
<setting name="editorBorder" serializeAs="String">
<value>None</value>
</setting>
<setting name="searchPanelBorder" serializeAs="String">
<value>Single</value>
</setting>
</Crypto_Notepad.Properties.Settings>
</userSettings>
</configuration>

View file

@ -555,6 +555,7 @@ private void LoadSettings()
searchWholeWordCheckBox.ForeColor = settings.searchPanelForeColor;
searchFindNextButton.ForeColor = settings.searchPanelForeColor;
searchCloseButton.ForeColor = settings.searchPanelForeColor;
searchPanel.CellBorderStyle = (TableLayoutPanelCellBorderStyle)Enum.Parse(typeof(TableLayoutPanelCellBorderStyle), settings.searchPanelBorder);
lineNumbers.Visible = bool.Parse(settings.lineNumbersVisible);
lineNumbers.Show_BorderLines = bool.Parse(settings.borderLinesVisible);
lineNumbers.Show_GridLines = bool.Parse(settings.gridLinesVisible);
@ -753,7 +754,6 @@ private void MainForm_Shown(object sender, EventArgs e)
private void MainWindow_Load(object sender, EventArgs e)
{
Visible = false;
searchPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
LoadSettings();
DeleteUpdateFiles();
MenuIcons(settings.menuIcons);

View file

@ -660,5 +660,18 @@ public string editorBorder {
this["editorBorder"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Single")]
public string searchPanelBorder {
get {
return ((string)(this["searchPanelBorder"]));
}
set {
this["searchPanelBorder"] = value;
}
}
}
}

View file

@ -149,5 +149,8 @@
<Setting Name="editorBorder" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">None</Value>
</Setting>
<Setting Name="searchPanelBorder" Provider="PortableSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">Single</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -113,6 +113,8 @@ private void InitializeComponent()
this.searchBackColorLabel = new System.Windows.Forms.Label();
this.settingsNavigation = new System.Windows.Forms.ListBox();
this.fontDialog = new System.Windows.Forms.FontDialog();
this.searchBorderLabel = new System.Windows.Forms.Label();
this.searchBorderComboBox = new System.Windows.Forms.ComboBox();
this.settingsTabControl.SuspendLayout();
this.editorTabPage.SuspendLayout();
this.applicationTabPage.SuspendLayout();
@ -1042,6 +1044,8 @@ private void InitializeComponent()
//
this.searchPanelTabPage.BackColor = System.Drawing.SystemColors.Window;
this.searchPanelTabPage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.searchPanelTabPage.Controls.Add(this.searchBorderComboBox);
this.searchPanelTabPage.Controls.Add(this.searchBorderLabel);
this.searchPanelTabPage.Controls.Add(this.searchFontColor);
this.searchPanelTabPage.Controls.Add(this.searchBackColor);
this.searchPanelTabPage.Controls.Add(this.searchFontColorLabel);
@ -1128,6 +1132,28 @@ private void InitializeComponent()
this.fontDialog.ShowEffects = false;
this.fontDialog.Apply += new System.EventHandler(this.FontDialog_Apply);
//
// searchBorderLabel
//
this.searchBorderLabel.AutoSize = true;
this.searchBorderLabel.Location = new System.Drawing.Point(6, 61);
this.searchBorderLabel.Name = "searchBorderLabel";
this.searchBorderLabel.Size = new System.Drawing.Size(42, 15);
this.searchBorderLabel.TabIndex = 4;
this.searchBorderLabel.Text = "Border";
//
// searchBorderComboBox
//
this.searchBorderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.searchBorderComboBox.FormattingEnabled = true;
this.searchBorderComboBox.Items.AddRange(new object[] {
"None",
"Single"});
this.searchBorderComboBox.Location = new System.Drawing.Point(132, 58);
this.searchBorderComboBox.Name = "searchBorderComboBox";
this.searchBorderComboBox.Size = new System.Drawing.Size(100, 23);
this.searchBorderComboBox.TabIndex = 5;
this.searchBorderComboBox.DropDownClosed += new System.EventHandler(this.SearchBorderComboBox_DropDownClosed);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1168,6 +1194,7 @@ private void InitializeComponent()
this.toolbarTabPage.ResumeLayout(false);
this.toolbarTabPage.PerformLayout();
this.searchPanelTabPage.ResumeLayout(false);
this.searchPanelTabPage.PerformLayout();
this.ResumeLayout(false);
}
@ -1258,5 +1285,7 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox minimizeToTrayCheckBox;
private System.Windows.Forms.ComboBox editorBorderComboBox;
private System.Windows.Forms.Label editorBorderLabel;
private System.Windows.Forms.ComboBox searchBorderComboBox;
private System.Windows.Forms.Label searchBorderLabel;
}
}

View file

@ -47,6 +47,7 @@ private void LoadSettings()
searchBackColor.BackColor = settings.searchPanelBackColor;
searchFontColor.BackColor = settings.searchPanelForeColor;
searchBorderComboBox.Text = settings.searchPanelBorder;
toolbarBackColor.BackColor = settings.toolbarBackColor;
toolbarBorderCheckBox.Checked = settings.toolbarBorder;
@ -822,6 +823,13 @@ private void EditorBorderComboBox_DropDownClosed(object sender, EventArgs e)
settings.editorBorder = editorBorderComboBox.Text;
}
private void SearchBorderComboBox_DropDownClosed(object sender, EventArgs e)
{
MainForm main = Owner as MainForm;
main.searchPanel.CellBorderStyle = (TableLayoutPanelCellBorderStyle)Enum.Parse(typeof(TableLayoutPanelCellBorderStyle), searchBorderComboBox.Text);
settings.searchPanelBorder = searchBorderComboBox.Text;
}
/*Settings Section*/