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

Commit f9a786e

Browse files
authored
Merge pull request from dagadtwok/master
Custom Color, Opacity
2 parents ca67181 + 942b969 commit f9a786e

File tree

4 files changed

+121
-1
lines changed

4 files changed

+121
-1
lines changed

Main.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,24 @@ public Main()
105105
} else {
106106
x1logo.Text = "x1";
107107
}
108+
if (File.Exists(appdata + "/x1color"))
109+
{
110+
using (StreamReader readdata = File.OpenText(appdata + "/x1color"))
111+
{
112+
113+
this.BackColor = Color.FromArgb(Convert.ToInt32(readdata.ReadLine()));
114+
}
115+
}
116+
if (File.Exists(appdata + "/x1opacity"))
117+
{
118+
float igen;
119+
using (StreamReader readdata = File.OpenText(appdata + "/x1opacity"))
120+
{
121+
igen = float.Parse(readdata.ReadLine(), System.Globalization.CultureInfo.InvariantCulture);
122+
this.Opacity = Convert.ToDouble(igen / 100);
123+
}
108124
}
125+
}
109126

110127
bool helpdialog = false;
111128
PowerStatus battery = SystemInformation.PowerStatus;

help.Designer.cs

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

help.cs

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,46 @@ private void textBox1_TextChanged(object sender, EventArgs e)
9494
}
9595
}
9696
}
97+
98+
private void button1_Click(object sender, EventArgs e)
99+
{
100+
colorselect.ShowDialog();
101+
colorpicker.BackColor = colorselect.Color;
102+
if (File.Exists(appdata + "/x1color"))
103+
{
104+
File.Delete(appdata + "/x1color");
105+
using (StreamWriter storedata = File.CreateText(appdata + "/x1color"))
106+
{
107+
storedata.WriteLine(colorselect.Color.ToArgb().ToString());
108+
}
109+
}
110+
else
111+
{
112+
using (StreamWriter storedata = File.CreateText(appdata + "/x1color"))
113+
{
114+
storedata.WriteLine(colorselect.Color.ToArgb().ToString());
115+
}
116+
}
117+
}
118+
119+
private void trackBar1_Scroll(object sender, EventArgs e)
120+
{
121+
opcatiyindicator.Text = setopacity.Value.ToString() + "% Opacity";
122+
if (File.Exists(appdata + "/x1opacity"))
123+
{
124+
File.Delete(appdata + "/x1opacity");
125+
using (StreamWriter storedata = File.CreateText(appdata + "/x1opacity"))
126+
{
127+
storedata.WriteLine(setopacity.Value.ToString());
128+
}
129+
}
130+
else
131+
{
132+
using (StreamWriter storedata = File.CreateText(appdata + "/x1opacity"))
133+
{
134+
storedata.WriteLine(setopacity.Value.ToString());
135+
}
136+
}
137+
}
138+
}
97139
}
98-
}

help.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="colorselect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>17, 17</value>
122+
</metadata>
120123
</root>

0 commit comments

Comments
 (0)