Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 41f0fb4

Browse files
author
skver0
committed
added bar location changer + fixed bugs
c00l ep1c gamEr momentzz
1 parent d87b5fb commit 41f0fb4

File tree

4 files changed

+172
-16
lines changed

4 files changed

+172
-16
lines changed

Main.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Main.cs

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Text;
1010
using System.Threading.Tasks;
1111
using System.Windows.Forms;
12+
using System.IO;
1213

1314
namespace x1
1415
{
@@ -92,18 +93,35 @@ public Main()
9293
bool helpdialog = false;
9394
PowerStatus battery = SystemInformation.PowerStatus;
9495
Help help = new Help();
95-
96+
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
9697

9798
private void Main_Load(object sender, EventArgs e)
9899
{
100+
101+
99102
SetProcessDPIAware();
100-
spotifytrack.Anchor = AnchorStyles.Right;
101-
seperator.Anchor = AnchorStyles.Right;
102-
btry.Anchor = AnchorStyles.Right;
103-
time.Anchor = AnchorStyles.Right;
104-
panel_StuffHere.Anchor = AnchorStyles.Right;
105103

106-
Width = Screen.PrimaryScreen.Bounds.Width;
104+
if (File.Exists(appdata + "/x1left"))
105+
{
106+
Width = 62;
107+
spotifytrack.Anchor = AnchorStyles.Right;
108+
seperator.Anchor = AnchorStyles.Right;
109+
btry.Anchor = AnchorStyles.Right;
110+
time.Anchor = AnchorStyles.Right;
111+
panel_StuffHere.Anchor = AnchorStyles.Right;
112+
113+
Height = Screen.PrimaryScreen.Bounds.Height;
114+
}
115+
else
116+
{
117+
spotifytrack.Anchor = AnchorStyles.Right;
118+
seperator.Anchor = AnchorStyles.Right;
119+
btry.Anchor = AnchorStyles.Right;
120+
time.Anchor = AnchorStyles.Right;
121+
panel_StuffHere.Anchor = AnchorStyles.Right;
122+
123+
Width = Screen.PrimaryScreen.Bounds.Width;
124+
}
107125

108126
t1.Start();
109127

@@ -183,8 +201,25 @@ bool IsOnDesktop()
183201
#region haha im epic
184202
private void t1_Tick(object sender, EventArgs e)
185203
{
186-
var ScreenHeight = Screen.PrimaryScreen.Bounds.Height;
187-
Location = new Point(0, ScreenHeight - 40);
204+
if (File.Exists(appdata + "/x1left"))
205+
{
206+
// idfk how to do it its hard man please make a pull request thanks
207+
Location = new Point(0, 0);
208+
}
209+
210+
if (File.Exists(appdata + "/x1top"))
211+
{
212+
Location = new Point(0, 0);
213+
}
214+
else
215+
{
216+
if (!File.Exists(appdata + "/x1left"))
217+
{
218+
var ScreenHeight = Screen.PrimaryScreen.Bounds.Height;
219+
Location = new Point(0, ScreenHeight - 40);
220+
}
221+
}
222+
188223

189224
Rectangle window = new Rectangle();
190225
Rectangle edited = new Rectangle();
@@ -199,7 +234,7 @@ private void t1_Tick(object sender, EventArgs e)
199234
//label1.Text = Convert.ToString(GetDesktopWindow());
200235

201236
//this is so fucking retarded that i dont even know why it doesnt work only if i add a retarded bool that checks every process this is anoying. install gentoo
202-
237+
203238
if (edited.Height >= Screen.PrimaryScreen.Bounds.Height && edited.Width >= Screen.PrimaryScreen.Bounds.Width && GetActiveWindowTitle() != "" && GetForegroundWindow() != null && GetForegroundWindow() != GetShellWindow() && GetForegroundWindow() != GetDesktopWindow() && !IsOnDesktop())
204239
{
205240
Hide();

help.Designer.cs

Lines changed: 64 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

help.cs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Text;
88
using System.Threading.Tasks;
99
using System.Windows.Forms;
10+
using System.IO;
1011

1112
namespace x1
1213
{
@@ -16,5 +17,66 @@ public Help()
1617
{
1718
InitializeComponent();
1819
}
20+
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
21+
private void checkBox1_CheckedChanged(object sender, EventArgs e)
22+
{
23+
//tfw you are too lazy to code a left sided bar
24+
try
25+
{
26+
if (checkBox1.Checked)
27+
{
28+
if (!checkBox2.Checked)
29+
File.Create(appdata + "/x1left");
30+
}
31+
else
32+
{
33+
if (!checkBox2.Checked)
34+
File.Delete(appdata + "/x1left");
35+
}
36+
}
37+
catch (Exception ex)
38+
{
39+
}
40+
}
41+
42+
private void Help_Load(object sender, EventArgs e)
43+
{
44+
try
45+
{
46+
if (File.Exists(appdata + "/x1left"))
47+
{
48+
checkBox1.Checked = true;
49+
}
50+
51+
if (File.Exists(appdata + "/x1top"))
52+
{
53+
checkBox2.Checked = true;
54+
}
55+
}
56+
catch (Exception ex)
57+
{
58+
}
59+
60+
}
61+
62+
private void checkBox2_CheckedChanged(object sender, EventArgs e)
63+
{
64+
try
65+
{
66+
if (checkBox2.Checked)
67+
{
68+
if (!checkBox1.Checked)
69+
File.Create(appdata + "/x1top");
70+
}
71+
else
72+
{
73+
if (!checkBox1.Checked)
74+
File.Delete(appdata + "/x1top");
75+
}
76+
}
77+
catch (Exception ex)
78+
{
79+
}
80+
}
1981
}
2082
}

0 commit comments

Comments
 (0)