Skip to content

Commit 9da6758

Browse files
committed
Rename variables
1 parent 94199c7 commit 9da6758

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

TelegramThemeCreator/MainWindow.xaml.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,25 @@ private void MainWindow1_Initialized(object sender, EventArgs e)
147147

148148
private void CreateThemeButton_Click(object sender, RoutedEventArgs e)
149149
{
150-
string original_theme_file_name = @"colors.tdesktop-palette";
151-
string output_folder_path = @"Output\";
152-
string new_theme_file_name = @"colors.tdesktop-theme";
153-
string new_zip_file_name = @"Your_theme.tdesktop-theme";
154-
string new_theme_file_path = output_folder_path + new_theme_file_name;
155-
if (Directory.Exists(output_folder_path) == false)
150+
string originalThemeFileName = @"colors.tdesktop-palette";
151+
string outputFolderPath = @"Output\";
152+
string newThemeFileName = @"colors.tdesktop-theme";
153+
string newZipFileName = @"Your_theme.tdesktop-theme";
154+
string newThemeFilePath = outputFolderPath + newThemeFileName;
155+
if (Directory.Exists(outputFolderPath) == false)
156156
{
157-
Directory.CreateDirectory(output_folder_path);
157+
Directory.CreateDirectory(outputFolderPath);
158158
}
159-
if (File.Exists(new_theme_file_path))
160-
File.Delete(new_theme_file_path);
161-
if (File.Exists(new_zip_file_name))
162-
File.Delete(new_zip_file_name);
163-
if (File.Exists(output_folder_path + "tiled.jpg"))
164-
File.Delete(output_folder_path + "tiled.jpg");
165-
if (File.Exists(new_theme_file_name))
166-
File.Delete(new_theme_file_name);
159+
if (File.Exists(newThemeFilePath))
160+
File.Delete(newThemeFilePath);
161+
if (File.Exists(newZipFileName))
162+
File.Delete(newZipFileName);
163+
if (File.Exists(outputFolderPath + "tiled.jpg"))
164+
File.Delete(outputFolderPath + "tiled.jpg");
165+
if (File.Exists(newThemeFileName))
166+
File.Delete(newThemeFileName);
167167

168-
string[] lines = File.ReadAllLines(original_theme_file_name);
168+
string[] lines = File.ReadAllLines(originalThemeFileName);
169169

170170
Dictionary<string, string> dic = new Dictionary<string, string>();
171171

@@ -181,7 +181,7 @@ private void CreateThemeButton_Click(object sender, RoutedEventArgs e)
181181
}
182182
}
183183

184-
double new_hue = new UniColor(((SolidColorBrush)ColorSquare.Fill).Color).Hue; //user hue
184+
double newHue = new UniColor(((SolidColorBrush)ColorSquare.Fill).Color).Hue; //user hue
185185

186186
for (int i = 0; i < dic.Count; i++)
187187
{
@@ -201,7 +201,7 @@ private void CreateThemeButton_Click(object sender, RoutedEventArgs e)
201201
changed = true;
202202
if (valColor.SaturationV >= 0.88)
203203
valColor.SaturationV -= 0.2;
204-
valColor.Hue = new_hue;
204+
valColor.Hue = newHue;
205205
}
206206
else if (valColor.SaturationV < 0.3)
207207
{
@@ -215,30 +215,30 @@ private void CreateThemeButton_Click(object sender, RoutedEventArgs e)
215215

216216
if (changed)
217217
{
218-
string new_hex_color = string.Empty;
218+
string newHexColor = string.Empty;
219219
if (value.Length == 9)
220-
new_hex_color = valColor.ToHex(HexFormat.RGBA);
220+
newHexColor = valColor.ToHex(HexFormat.RGBA);
221221
else
222-
new_hex_color = valColor.ToHex(HexFormat.RGB);
223-
dic[item.Key] = new_hex_color;
222+
newHexColor = valColor.ToHex(HexFormat.RGB);
223+
dic[item.Key] = newHexColor;
224224
}
225225
}
226226
}
227227

228-
using (StreamWriter file = new StreamWriter(new_theme_file_path))
228+
using (StreamWriter file = new StreamWriter(newThemeFilePath))
229229
foreach (var entry in dic)
230230
file.WriteLine("{0}:{1};", entry.Key, entry.Value);
231231
if (UseWindowsWallpaperCheckBox.IsChecked == true)
232232
{
233-
File.Copy(winWallpaperFile, output_folder_path + "background.jpg");
233+
File.Copy(winWallpaperFile, outputFolderPath + "background.jpg");
234234
}
235235
else
236236
{
237-
CreateImage(100, 100, output_folder_path, "tiled.jpg");
237+
CreateImage(100, 100, outputFolderPath, "tiled.jpg");
238238
}
239239

240-
ZipFile.CreateFromDirectory(output_folder_path, new_zip_file_name);
241-
Directory.Delete(output_folder_path, true);
240+
ZipFile.CreateFromDirectory(outputFolderPath, newZipFileName);
241+
Directory.Delete(outputFolderPath, true);
242242
Process.Start(Environment.CurrentDirectory);
243243
}
244244

0 commit comments

Comments
 (0)