Add more info to About dialog

This commit is contained in:
Michael Bucari-Tovo 2023-04-02 18:02:52 -06:00 committed by Mbucari
parent 756d387238
commit 1991bf5b4d
4 changed files with 167 additions and 100 deletions

View File

@ -2,9 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="450" d:DesignHeight="600"
MinWidth="450" MinHeight="550"
Width="450" Height="600"
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="600"
MinWidth="500" MinHeight="550"
Width="500" Height="600"
x:Class="LibationAvalonia.Dialogs.AboutDialog"
xmlns:controls="clr-namespace:LibationAvalonia.Controls"
Title="About Libation"
@ -12,9 +12,9 @@
<Grid Margin="10" ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto,Auto,*">
<TextBlock Grid.ColumnSpan="2" FontSize="18" FontWeight="Bold" Text="{Binding Version}" />
<controls:LinkLabel Grid.ColumnSpan="2" FontSize="18" FontWeight="Bold" Text="{Binding Version}" ToolTip.Tip="View Release Notes" Tapped="ViewReleaseNotes_Tapped" />
<controls:LinkLabel Grid.Column="1" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" Text="Release Notes" Tapped="ViewReleaseNotes_Tapped"/>
<controls:LinkLabel Grid.Column="1" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right" Text="https://getlibation.com" Tapped="Link_getlibation"/>
<Button Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Margin="0,20,0,0" IsEnabled="{Binding CanCheckForUpgrade}" Content="{Binding UpgradeButtonText}" Click="CheckForUpgrade_Click" />
@ -38,10 +38,12 @@
</TransformGroup>
</Path.RenderTransform>
</Path>
<controls:LinkLabel Canvas.Left="50" Canvas.Top="40" Text="rmcrackan" Tapped="Link_rmcrackan" ToolTip.Tip="View rmcrackan's GitHub profile" />
<controls:LinkLabel Canvas.Right="50" Canvas.Top="40" Text="MBucari" Tapped="Link_MBucari" ToolTip.Tip="View MBucari's GitHub profile" />
</Canvas>
<TextBlock Grid.Row="3" VerticalAlignment="Center" FontSize="16" FontWeight="Bold" Text="Loaded Assemblies"/>
<Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Padding="10,0" Content="Copy to Clopboard" Command="{Binding CopyAssembliesAsync}"/>
<Button Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Padding="10,0" Content="Copy to Clipboard" Command="{Binding CopyAssembliesAsync}"/>
<ListBox Grid.Row="4" Grid.ColumnSpan="2" Margin="0,10,0,0" ItemsSource="{Binding Assemblies}">
<ListBox.Styles>

View File

@ -50,10 +50,12 @@ namespace LibationAvalonia.Dialogs
}
}
private void Link_rmcrackan(object sender, Avalonia.Input.TappedEventArgs e) => Dinah.Core.Go.To.Url($"ht" + "tps://github.com/rmcrackan");
private void Link_MBucari(object sender, Avalonia.Input.TappedEventArgs e) => Dinah.Core.Go.To.Url($"ht" + "tps://github.com/MBucari");
private void Link_getlibation(object sender, Avalonia.Input.TappedEventArgs e) => Dinah.Core.Go.To.Url(AppScaffolding.LibationScaffolding.WebsiteUrl);
private void ViewReleaseNotes_Tapped(object sender, Avalonia.Input.TappedEventArgs e)
{
Dinah.Core.Go.To.Url($"{AppScaffolding.LibationScaffolding.RepositoryUrl}/releases/tag/v{AppScaffolding.LibationScaffolding.BuildVersion.ToString(3)}");
}
=> Dinah.Core.Go.To.Url($"{AppScaffolding.LibationScaffolding.RepositoryUrl}/releases/tag/v{AppScaffolding.LibationScaffolding.BuildVersion.ToString(3)}");
}
public class AboutVM : ViewModelBase

View File

@ -28,128 +28,175 @@
/// </summary>
private void InitializeComponent()
{
pictureBox1 = new System.Windows.Forms.PictureBox();
versionLbl = new System.Windows.Forms.Label();
releaseNotesLbl = new System.Windows.Forms.LinkLabel();
checkForUpgradeBtn = new System.Windows.Forms.Button();
listView1 = new System.Windows.Forms.ListView();
columnHeader1 = new System.Windows.Forms.ColumnHeader();
columnHeader2 = new System.Windows.Forms.ColumnHeader();
copyBtn = new System.Windows.Forms.Button();
label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
SuspendLayout();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.releaseNotesLbl = new System.Windows.Forms.LinkLabel();
this.checkForUpgradeBtn = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.copyBtn = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.getLibationLbl = new System.Windows.Forms.LinkLabel();
this.rmcrackanLbl = new System.Windows.Forms.LinkLabel();
this.MBucariLbl = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
pictureBox1.Image = Properties.Resources.cheers;
pictureBox1.Location = new System.Drawing.Point(12, 105);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(410, 283);
pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
//
// versionLbl
//
versionLbl.AutoSize = true;
versionLbl.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
versionLbl.Location = new System.Drawing.Point(12, 9);
versionLbl.Name = "versionLbl";
versionLbl.Size = new System.Drawing.Size(198, 21);
versionLbl.TabIndex = 1;
versionLbl.Text = "Libation Classic v11.0.0.0";
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Image = global::LibationWinForms.Properties.Resources.cheers;
this.pictureBox1.Location = new System.Drawing.Point(22, 224);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(6);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(761, 604);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// releaseNotesLbl
//
releaseNotesLbl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
releaseNotesLbl.AutoSize = true;
releaseNotesLbl.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
releaseNotesLbl.Location = new System.Drawing.Point(319, 10);
releaseNotesLbl.Name = "releaseNotesLbl";
releaseNotesLbl.Size = new System.Drawing.Size(103, 20);
releaseNotesLbl.TabIndex = 2;
releaseNotesLbl.TabStop = true;
releaseNotesLbl.Text = "Release Notes";
releaseNotesLbl.LinkClicked += releaseNotesLbl_LinkClicked;
this.releaseNotesLbl.AutoSize = true;
this.releaseNotesLbl.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.releaseNotesLbl.Location = new System.Drawing.Point(22, 26);
this.releaseNotesLbl.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.releaseNotesLbl.Name = "releaseNotesLbl";
this.releaseNotesLbl.Size = new System.Drawing.Size(343, 41);
this.releaseNotesLbl.TabIndex = 2;
this.releaseNotesLbl.TabStop = true;
this.releaseNotesLbl.Text = "Libation Classic v11.0.0.0";
//
// checkForUpgradeBtn
//
checkForUpgradeBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
checkForUpgradeBtn.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
checkForUpgradeBtn.Location = new System.Drawing.Point(12, 54);
checkForUpgradeBtn.Name = "checkForUpgradeBtn";
checkForUpgradeBtn.Size = new System.Drawing.Size(410, 31);
checkForUpgradeBtn.TabIndex = 3;
checkForUpgradeBtn.Text = "Check for Upgrade";
checkForUpgradeBtn.UseVisualStyleBackColor = true;
checkForUpgradeBtn.Click += checkForUpgradeBtn_Click;
this.checkForUpgradeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.checkForUpgradeBtn.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.checkForUpgradeBtn.Location = new System.Drawing.Point(22, 115);
this.checkForUpgradeBtn.Margin = new System.Windows.Forms.Padding(6);
this.checkForUpgradeBtn.Name = "checkForUpgradeBtn";
this.checkForUpgradeBtn.Size = new System.Drawing.Size(761, 66);
this.checkForUpgradeBtn.TabIndex = 3;
this.checkForUpgradeBtn.Text = "Check for Upgrade";
this.checkForUpgradeBtn.UseVisualStyleBackColor = true;
//
// listView1
//
listView1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { columnHeader1, columnHeader2 });
listView1.Location = new System.Drawing.Point(12, 444);
listView1.Name = "listView1";
listView1.Size = new System.Drawing.Size(410, 105);
listView1.TabIndex = 4;
listView1.UseCompatibleStateImageBehavior = false;
listView1.View = System.Windows.Forms.View.Details;
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listView1.Location = new System.Drawing.Point(22, 947);
this.listView1.Margin = new System.Windows.Forms.Padding(6);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(758, 219);
this.listView1.TabIndex = 4;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
columnHeader1.Text = "Assembly";
this.columnHeader1.Text = "Assembly";
//
// columnHeader2
//
columnHeader2.Text = "Version";
this.columnHeader2.Text = "Version";
//
// copyBtn
//
copyBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
copyBtn.Location = new System.Drawing.Point(304, 415);
copyBtn.Name = "copyBtn";
copyBtn.Size = new System.Drawing.Size(118, 23);
copyBtn.TabIndex = 5;
copyBtn.Text = "Copy to Clipboard";
copyBtn.UseVisualStyleBackColor = true;
copyBtn.Click += copyBtn_Click;
this.copyBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.copyBtn.Location = new System.Drawing.Point(565, 885);
this.copyBtn.Margin = new System.Windows.Forms.Padding(6);
this.copyBtn.Name = "copyBtn";
this.copyBtn.Size = new System.Drawing.Size(219, 49);
this.copyBtn.TabIndex = 5;
this.copyBtn.Text = "Copy to Clipboard";
this.copyBtn.UseVisualStyleBackColor = true;
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(12, 419);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(108, 15);
label2.TabIndex = 6;
label2.Text = "Loaded Assemblies";
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(22, 894);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(217, 32);
this.label2.TabIndex = 6;
this.label2.Text = "Loaded Assemblies";
//
// getLibationLbl
//
this.getLibationLbl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.getLibationLbl.AutoSize = true;
this.getLibationLbl.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.getLibationLbl.Location = new System.Drawing.Point(455, 26);
this.getLibationLbl.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.getLibationLbl.Name = "getLibationLbl";
this.getLibationLbl.Size = new System.Drawing.Size(325, 41);
this.getLibationLbl.TabIndex = 7;
this.getLibationLbl.TabStop = true;
this.getLibationLbl.Text = "https://getlibation.com";
this.getLibationLbl.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.getLibationLbl_LinkClicked);
//
// rmcrackanLbl
//
this.rmcrackanLbl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.rmcrackanLbl.AutoSize = true;
this.rmcrackanLbl.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.rmcrackanLbl.Location = new System.Drawing.Point(45, 567);
this.rmcrackanLbl.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.rmcrackanLbl.Name = "rmcrackanLbl";
this.rmcrackanLbl.Size = new System.Drawing.Size(123, 32);
this.rmcrackanLbl.TabIndex = 8;
this.rmcrackanLbl.TabStop = true;
this.rmcrackanLbl.Text = "rmcrackan";
this.rmcrackanLbl.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.rmcrackanLbl_LinkClicked);
//
// MBucariLbl
//
this.MBucariLbl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MBucariLbl.AutoSize = true;
this.MBucariLbl.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.MBucariLbl.Location = new System.Drawing.Point(665, 567);
this.MBucariLbl.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.MBucariLbl.Name = "MBucariLbl";
this.MBucariLbl.Size = new System.Drawing.Size(101, 32);
this.MBucariLbl.TabIndex = 9;
this.MBucariLbl.TabStop = true;
this.MBucariLbl.Text = "MBucari";
this.MBucariLbl.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.MBucariLbl_LinkClicked);
//
// AboutDialog
//
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(434, 561);
Controls.Add(label2);
Controls.Add(copyBtn);
Controls.Add(listView1);
Controls.Add(checkForUpgradeBtn);
Controls.Add(releaseNotesLbl);
Controls.Add(versionLbl);
Controls.Add(pictureBox1);
MinimumSize = new System.Drawing.Size(450, 600);
Name = "AboutDialog";
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
Text = "About Libation";
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
ResumeLayout(false);
PerformLayout();
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(806, 1197);
this.Controls.Add(this.MBucariLbl);
this.Controls.Add(this.rmcrackanLbl);
this.Controls.Add(this.getLibationLbl);
this.Controls.Add(this.label2);
this.Controls.Add(this.copyBtn);
this.Controls.Add(this.listView1);
this.Controls.Add(this.checkForUpgradeBtn);
this.Controls.Add(this.releaseNotesLbl);
this.Controls.Add(this.pictureBox1);
this.Margin = new System.Windows.Forms.Padding(6);
this.MinimumSize = new System.Drawing.Size(813, 1200);
this.Name = "AboutDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About Libation";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label versionLbl;
private System.Windows.Forms.LinkLabel releaseNotesLbl;
private System.Windows.Forms.Button checkForUpgradeBtn;
private System.Windows.Forms.ListView listView1;
@ -157,5 +204,8 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.LinkLabel getLibationLbl;
private System.Windows.Forms.LinkLabel rmcrackanLbl;
private System.Windows.Forms.LinkLabel MBucariLbl;
}
}

View File

@ -18,7 +18,13 @@ namespace LibationWinForms.Dialogs
{
InitializeComponent();
this.SetLibationIcon();
versionLbl.Text = $"Libation {AppScaffolding.LibationScaffolding.Variety} v{AppScaffolding.LibationScaffolding.BuildVersion}";
releaseNotesLbl.Text = $"Libation {AppScaffolding.LibationScaffolding.Variety} v{AppScaffolding.LibationScaffolding.BuildVersion}";
var toolTip = new ToolTip();
toolTip.SetToolTip(releaseNotesLbl, "View Release Notes");
toolTip.SetToolTip(rmcrackanLbl, "View rmcrackan's GitHub profile");
toolTip.SetToolTip(MBucariLbl, "View MBucari's GitHub profile");
var asmNames = AppDomain.CurrentDomain.GetAssemblies().Select(a => new AssemblyName(a.FullName)).Where(a => a.Version.Major + a.Version.Minor + a.Version.Build + a.Version.Revision > 0).OrderBy(a => a.Name).ToList();
listView1.Items.AddRange(asmNames.Select(a => new ListViewItem(new string[] { a.Name, a.Version.ToString() })).ToArray());
@ -62,5 +68,12 @@ namespace LibationWinForms.Dialogs
var text = string.Join(Environment.NewLine, listView1.Items.OfType<ListViewItem>().Select(i => $"{i.SubItems[0].Text}\t{i.SubItems[1].Text}"));
Clipboard.SetDataObject(text, false, 5, 150);
}
private void getLibationLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
=> Dinah.Core.Go.To.Url(AppScaffolding.LibationScaffolding.WebsiteUrl);
private void rmcrackanLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => Dinah.Core.Go.To.Url($"ht" + "tps://github.com/rmcrackan");
private void MBucariLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => Dinah.Core.Go.To.Url($"ht" + "tps://github.com/MBucari");
}
}