Skip to content

Commit c5783fe

Browse files
committed
Add footer
1 parent b9a3c89 commit c5783fe

File tree

5 files changed

+72
-6
lines changed

5 files changed

+72
-6
lines changed

Keys/KeysTab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public KeysTab(TabControl Tabs)
117117
ContentTable.AllowUserToDeleteRows = false;
118118
ContentTable.ReadOnly = true;
119119
ContentTable.RowHeadersVisible = false;
120-
ContentTable.Columns.Add("Name", "Имя файла");
120+
ContentTable.Columns.Add("Name", "Файл");
121121
ContentTable.Columns.Add("PublicKey", "Публичный ключ");
122122
ContentTable.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
123123
ContentTable.Columns["PublicKey"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

MainForm.cs

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Data;
55
using System.Drawing;
66
using System.Linq;
7+
using System.Reflection.Emit;
78
using System.Text;
89
using System.Threading.Tasks;
910
using System.Windows.Forms;
@@ -14,6 +15,7 @@ namespace RishWinTools
1415
public partial class MainForm : Form
1516
{
1617
private TabControl Tabs;
18+
private Panel Footer;
1719
private readonly System.ComponentModel.IContainer? Components;
1820

1921
protected override void Dispose(bool disposing)
@@ -32,8 +34,9 @@ public MainForm()
3234
Text = "RishWinTools";
3335
AutoScaleDimensions = new SizeF(6F, 13F);
3436
AutoScaleMode = AutoScaleMode.Font;
35-
ClientSize = new Size(800, 600);
37+
ClientSize = new Size(1024, 600);
3638
StartPosition = FormStartPosition.CenterScreen;
39+
Icon = new Icon("icon.ico");
3740

3841
// Tabs
3942
Tabs = new TabControl();
@@ -45,13 +48,65 @@ public MainForm()
4548
Tabs.SelectedIndexChanged += onTabControlSelectedIndexChanged;
4649
Tabs.SuspendLayout();
4750
Controls.Add(Tabs);
48-
49-
// Add servers tab
5051
Tabs.Controls.Add(new Servers.ServersTab(Tabs));
51-
52-
// Add keys tab
5352
Tabs.Controls.Add(new Keys.KeysTab(Tabs));
5453

54+
55+
// Footer
56+
Footer = new Panel
57+
{
58+
Dock = DockStyle.Bottom,
59+
BackColor = Color.White
60+
};
61+
Controls.Add(Footer);
62+
63+
PictureBox footerLogo = new PictureBox
64+
{
65+
Image = Image.FromFile("logo.png"),
66+
SizeMode = PictureBoxSizeMode.Zoom,
67+
Size = new Size(100, 80),
68+
Location = new Point(10, 10)
69+
};
70+
Footer.Controls.Add(footerLogo);
71+
72+
System.Windows.Forms.Label footerTitle = new System.Windows.Forms.Label
73+
{
74+
Text = "Rish Windows Tools",
75+
Location = new Point(footerLogo.Right + 20, 10),
76+
AutoSize = true
77+
};
78+
footerTitle.Font = new Font(footerTitle.Font, FontStyle.Bold);
79+
Footer.Controls.Add(footerTitle);
80+
81+
System.Windows.Forms.Label footerAuthor = new System.Windows.Forms.Label
82+
{
83+
Text = "by Igor Berdichevskiy",
84+
Location = new Point(footerLogo.Right + 20, footerTitle.Bottom + 5),
85+
AutoSize = true
86+
};
87+
Footer.Controls.Add(footerAuthor);
88+
89+
LinkLabel footerLink = new LinkLabel
90+
{
91+
Text = "Перейти на сайт rish.su",
92+
Location = new Point(footerLogo.Right + 20, footerAuthor.Bottom + 5),
93+
AutoSize = true
94+
};
95+
footerLink.LinkClicked += (sender, e) => System.Diagnostics.Process.Start("http://rish.su");
96+
Footer.Controls.Add(footerLink);
97+
98+
int footerHeight = 0;
99+
foreach (Control control in Footer.Controls)
100+
{
101+
int controlBottom = control.Bottom;
102+
if (controlBottom > footerHeight)
103+
{
104+
footerHeight = controlBottom;
105+
}
106+
}
107+
Footer.Height = footerHeight;
108+
109+
// Layout
55110
Tabs.ResumeLayout(false);
56111
}
57112

RishWinTools.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,16 @@
99
<Company>Delo Design</Company>
1010
<Product>RishWinTools</Product>
1111
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
12+
<ApplicationIcon>icon.ico</ApplicationIcon>
1213
</PropertyGroup>
14+
<ItemGroup>
15+
<Content Include="icon.ico">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</Content>
18+
</ItemGroup>
19+
<ItemGroup>
20+
<None Update="logo.png">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</None>
23+
</ItemGroup>
1324
</Project>

icon.ico

40 KB
Binary file not shown.

logo.png

3.86 KB
Loading

0 commit comments

Comments
 (0)