-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProfilePreview.cs
73 lines (68 loc) · 2.47 KB
/
ProfilePreview.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
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Instagram
{
public partial class ProfilePreview : Form
{
bool lightModeOn;
Main main;
public string userId, userName, realUserName;
DBHandlingUtilities dbHandler;
public ProfilePreview(Main main)
{
InitializeComponent();
this.dbHandler = new DBHandlingUtilities();
this.lightModeOn = main.lightModeOn;
this.main = main;
Configure_Theme();
}
private void Configure_Theme()
{
Color backColor, textColor, barColor;
if (lightModeOn)
{
backColor = Color.FromArgb(242, 242, 242);
textColor = Color.FromArgb(0, 0, 0);
barColor = Color.FromArgb(209, 209, 209);
}
else
{
backColor = Color.FromArgb(43, 43, 43);
textColor = Color.FromArgb(255, 255, 255);
barColor = Color.FromArgb(31, 31, 31);
}
this.BackColor = backColor;
userNameLabel.ForeColor = textColor;
topBar.BackColor = barColor;
bottomBar.BackColor = barColor;
}
private void SearchResult_Load(object sender, EventArgs e)
{
}
private void realUserNameLabel_Click(object sender, EventArgs e)
{
main.form.Dispose();
if (this.userId == main.userID)
main.form = new Profile(main) { TopLevel = false, TopMost = true };
else
main.form = new Profile(main, true, this.userId, this.userName) { TopLevel = false, TopMost = true };
}
private void userNameLabel_Click(object sender, EventArgs e)
{
main.form.Dispose();
if (this.userId == main.userID)
main.form = new Profile(main) { TopLevel = false, TopMost = true };
else
main.form = new Profile(main, true, this.userId, this.userName) { TopLevel = false, TopMost = true }; ;
}
private void profilePictureBox_Click(object sender, EventArgs e)
{
main.form.Dispose();
if (this.userId == main.userID)
main.form = new Profile(main) { TopLevel = false, TopMost = true };
else
main.form = new Profile(main, true, this.userId, this.userName) { TopLevel = false, TopMost = true }; ;
}
}
}