Skip to content

Commit

Permalink
Theme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HojdaAdelin committed Jun 27, 2023
1 parent 3447249 commit 0d78a8d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Service/CommandsHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ void help(std::string ServiceString) {
if (ServiceString == "help") {
commandHelp();
} else if (ServiceString == "version") {
std::cout << "\nVersion: 1.3.2\n";
std::cout << "\nVersion: 1.3.3\n";
} else if (ServiceString == "log") {
SetConsoleTextAttribute(colorAtribute, legionEnv());
std::cout << "\n$LegionCode v1.3.2\n";
std::cout << "\n$LegionCode v1.3.3\n";
SetConsoleTextAttribute(colorAtribute, 15);
std::cout << "\n-Git checkout\n-Git branch\n-Directory opener\n-Help redesign\n-Dark theme\n-Vulcan theme\n-Ocean theme\n-Transfer file\n-Select file\n-Transfer file remove after operation\n";
std::cout << "\n-Git checkout\n-Git branch\n-Directory opener\n-Help redesign\n-Dark theme\n-Vulcan theme\n-Ocean theme\n-Transfer file\n-Select file\n-Transfer file remove after operation\n-Fix application theme\n";
} else if (ServiceString == ".git" || ".bug" || ".source") {
WebOpener(ServiceString);
}
Expand Down
25 changes: 19 additions & 6 deletions src/Settings/SetThemeByID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@
// Arrow are for arrow and folder
// legionEnv are for Legion name, files & bytes

std::string GetApplicationPath() {

char buffer[MAX_PATH];
GetModuleFileName(NULL, buffer, MAX_PATH);
std::string path(buffer);
size_t lastSeparator = path.find_last_of("\\/");
if (lastSeparator != std::string::npos) {
path = path.substr(0, lastSeparator);
}
return path;

}

void SetDefaultTheme() {

int colorTag = 0;

std::ofstream writeColorTag("config.cfg");
std::ofstream writeColorTag(std::string(GetApplicationPath() + "config.cfg"));

writeColorTag << colorTag;

Expand All @@ -22,7 +35,7 @@ void SetDarkTheme() {

int colorTag = 1;

std::ofstream writeColorTag("config.cfg");
std::ofstream writeColorTag(std::string(GetApplicationPath() + "config.cfg"));

writeColorTag << colorTag;

Expand All @@ -34,7 +47,7 @@ void SetVulcanTheme() {

int colorTag = 2;

std::ofstream writeColorTag("config.cfg");
std::ofstream writeColorTag(std::string(GetApplicationPath() + "config.cfg"));

writeColorTag << colorTag;

Expand All @@ -46,7 +59,7 @@ void SetOceanTheme() {

int colorTag = 3;

std::ofstream writeColorTag("config.cfg");
std::ofstream writeColorTag(std::string(GetApplicationPath() + "config.cfg"));

writeColorTag << colorTag;

Expand All @@ -58,7 +71,7 @@ int legionEnv() {

int colortag;

std::ifstream getID("config.cfg");
std::ifstream getID(std::string(GetApplicationPath() + "config.cfg"));

getID >> colortag;

Expand Down Expand Up @@ -92,7 +105,7 @@ int arrow() {

int colortag;

std::ifstream getID("config.cfg");
std::ifstream getID(std::string(GetApplicationPath() + "config.cfg"));

getID >> colortag;

Expand Down

0 comments on commit 0d78a8d

Please sign in to comment.