Add libation icon to forms

This commit is contained in:
Michael Bucari-Tovo 2022-05-09 21:09:59 -06:00
parent 04665fea36
commit 81c152ddcb
15 changed files with 37 additions and 7 deletions

View File

@ -19,6 +19,7 @@ namespace LibationWinForms.BookLiberation.BaseForms
//If this is the first form created, it will not exist until after execution //If this is the first form created, it will not exist until after execution
//reaches inside the constructor (after base class has been initialized). //reaches inside the constructor (after base class has been initialized).
Invoker = new SynchronizeInvoker(); Invoker = new SynchronizeInvoker();
this.SetLibationIcon();
} }
public void RegisterFileLiberator(Streamable streamable, LogMe logMe = null) public void RegisterFileLiberator(Streamable streamable, LogMe logMe = null)

View File

@ -28,6 +28,7 @@ namespace LibationWinForms.Dialogs
populateDropDown(); populateDropDown();
populateGridValues(); populateGridValues();
this.SetLibationIcon();
} }
private void populateDropDown() private void populateDropDown()

View File

@ -205,7 +205,6 @@
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "BookDetailsDialog"; this.Name = "BookDetailsDialog";
this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Book Details"; this.Text = "Book Details";

View File

@ -27,6 +27,7 @@ namespace LibationWinForms.Dialogs
public BookDetailsDialog() public BookDetailsDialog()
{ {
InitializeComponent(); InitializeComponent();
this.SetLibationIcon();
} }
public BookDetailsDialog(LibraryBook libraryBook) : this() public BookDetailsDialog(LibraryBook libraryBook) : this()
{ {

View File

@ -26,6 +26,7 @@ namespace LibationWinForms.Dialogs
dataGridView1.Columns[COL_Filter].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView1.Columns[COL_Filter].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
populateGridValues(); populateGridValues();
this.SetLibationIcon();
} }
private void populateGridValues() private void populateGridValues()

View File

@ -170,8 +170,10 @@
this.Controls.Add(this.templateTb); this.Controls.Add(this.templateTb);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditTemplateDialog"; this.Name = "EditTemplateDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Template"; this.Text = "Edit Template";

View File

@ -28,7 +28,11 @@ namespace LibationWinForms.Dialogs
private Templates template { get; } private Templates template { get; }
private string inputTemplateText { get; } private string inputTemplateText { get; }
public EditTemplateDialog() => InitializeComponent(); public EditTemplateDialog()
{
InitializeComponent();
this.SetLibationIcon();
}
public EditTemplateDialog(Templates template, string inputTemplateText) : this() public EditTemplateDialog(Templates template, string inputTemplateText) : this()
{ {
this.template = ArgumentValidator.EnsureNotNull(template, nameof(template)); this.template = ArgumentValidator.EnsureNotNull(template, nameof(template));

View File

@ -164,7 +164,7 @@ namespace LibationWinForms.Dialogs
this.Controls.Add(this.btnRemoveBooks); this.Controls.Add(this.btnRemoveBooks);
this.Controls.Add(this._dataGridView); this.Controls.Add(this._dataGridView);
this.Name = "RemoveBooksDialog"; this.Name = "RemoveBooksDialog";
this.Text = "RemoveBooksDialog"; this.Text = "Remove Books from Libation's Database";
this.Shown += new System.EventHandler(this.RemoveBooksDialog_Shown); this.Shown += new System.EventHandler(this.RemoveBooksDialog_Shown);
((System.ComponentModel.ISupportInitialize)(this._dataGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this._dataGridView)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridEntryBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gridEntryBindingSource)).EndInit();

View File

@ -48,6 +48,7 @@ namespace LibationWinForms.Dialogs
gridEntryBindingSource.DataSource = _removableGridEntries; gridEntryBindingSource.DataSource = _removableGridEntries;
_dataGridView.Enabled = false; _dataGridView.Enabled = false;
this.SetLibationIcon();
} }
private void _dataGridView_BindingContextChanged(object sender, EventArgs e) private void _dataGridView_BindingContextChanged(object sender, EventArgs e)

View File

@ -17,6 +17,7 @@ namespace LibationWinForms.Dialogs
_parent = parent; _parent = parent;
InitializeComponent(); InitializeComponent();
this.SetLibationIcon();
} }
private class listItem private class listItem

View File

@ -113,7 +113,6 @@
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "SearchSyntaxDialog"; this.Name = "SearchSyntaxDialog";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Filter options"; this.Text = "Filter options";
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -14,6 +14,7 @@ namespace LibationWinForms.Dialogs
label3.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchNumberFields()); label3.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchNumberFields());
label4.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchBoolFields()); label4.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchBoolFields());
label5.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchIdFields()); label5.Text += "\r\n\r\n" + string.Join("\r\n", LibationSearchEngine.SearchEngine.GetSearchIdFields());
this.SetLibationIcon();
} }
private void CloseBtn_Click(object sender, EventArgs e) => this.Close(); private void CloseBtn_Click(object sender, EventArgs e) => this.Close();

View File

@ -944,8 +944,10 @@
this.Controls.Add(this.tabControl); this.Controls.Add(this.tabControl);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn); this.Controls.Add(this.saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsDialog"; this.Name = "SettingsDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings"; this.Text = "Edit Settings";

View File

@ -13,7 +13,11 @@ namespace LibationWinForms.Dialogs
private Configuration config { get; } = Configuration.Instance; private Configuration config { get; } = Configuration.Instance;
private Func<string, string> desc { get; } = Configuration.GetDescription; private Func<string, string> desc { get; } = Configuration.GetDescription;
public SettingsDialog() => InitializeComponent(); public SettingsDialog()
{
InitializeComponent();
this.SetLibationIcon();
}
private void SettingsDialog_Load(object sender, EventArgs e) private void SettingsDialog_Load(object sender, EventArgs e)
{ {

View File

@ -7,6 +7,18 @@ namespace LibationWinForms
{ {
public static class FormSaveExtension public static class FormSaveExtension
{ {
static readonly Icon libationIcon;
static FormSaveExtension()
{
var resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
libationIcon = (Icon)resources.GetObject("$this.Icon");
}
public static void SetLibationIcon(this Form form)
{
form.Icon = libationIcon;
}
public static void RestoreSizeAndLocation(this Form form, Configuration config) public static void RestoreSizeAndLocation(this Form form, Configuration config)
{ {
FormSizeAndPosition savedState = config.GetNonString<FormSizeAndPosition>(form.Name); FormSizeAndPosition savedState = config.GetNonString<FormSizeAndPosition>(form.Name);
@ -77,6 +89,7 @@ namespace LibationWinForms
config.SetObject(form.Name, saveState); config.SetObject(form.Name, saveState);
} }
} }
class FormSizeAndPosition class FormSizeAndPosition
{ {