-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddButton.cs
94 lines (83 loc) · 2.98 KB
/
AddButton.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Instagram
{
public partial class AddButton : Form
{
UIUtilities UI;
Main main;
Panel panelRef;
public AddButton(Main main)
{
InitializeComponent();
this.main = main;
UI = new UIUtilities(main.lightModeOn);
Configure_Theme();
}
public void Add_Panel_Reference(Panel panel)
{
this.panelRef = panel;
}
private void Configure_Theme()
{
Color backColor;
if (main.lightModeOn)
backColor = Color.FromArgb(209, 209, 209);
else
backColor = Color.FromArgb(31, 31, 31);
this.BackColor = backColor;
addPostBtn.Image = Image.FromFile(UI.Return_UI_Location() + @"\left-half-triangle.png");
addStoryBtn.Image = Image.FromFile(UI.Return_UI_Location() + @"\right-half-triangle.png");
}
private void Reset_Color()
{
Color backColor;
if (main.lightModeOn)
backColor = Color.FromArgb(209, 209, 209);
else
backColor = Color.FromArgb(31, 31, 31);
this.BackColor = backColor;
}
private void addPost_MouseHover(object sender, EventArgs e)
{
addPostBtn.Image.Dispose();
addPostBtn.Image = Image.FromFile(Environment.CurrentDirectory + @"\Assets\Selected Mode\left-half-triangle.png");
}
private void addPost_MouseLeave(object sender, EventArgs e)
{
addPostBtn.Image.Dispose();
addPostBtn.Image = Image.FromFile(UI.Return_UI_Location() + @"\left-half-triangle.png");
}
private void addPost_Click(object sender, EventArgs e)
{
if(main.form != null)
{
main.form.Dispose();
panelRef.Dispose();
main.form = new AddPost(main.userID, main.userName, main.lightModeOn) { TopLevel = false, TopMost = true };;
main.form.Show();
}
}
private void addStory_Click(object sender, EventArgs e)
{
if(main.form != null)
{
main.form.Dispose();
panelRef.Dispose();
main.form = new AddStory(main.userID, main.userName, main.lightModeOn) { TopLevel = false, TopMost = true };;
main.form.Show();
}
}
private void addStory_MouseHover(object sender, EventArgs e)
{
addStoryBtn.Image.Dispose();
addStoryBtn.Image = Image.FromFile(Environment.CurrentDirectory + @"\Assets\Selected Mode\right-half-triangle.png");
}
private void addStory_MouseLeave(object sender, EventArgs e)
{
addStoryBtn.Image.Dispose();
addStoryBtn.Image = Image.FromFile(UI.Return_UI_Location() + @"\right-half-triangle.png");
}
}
}