Compare commits
2 Commits
908f7a3275
...
793b69d9d9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
793b69d9d9 | ||
|
|
2e95908242 |
@ -69,10 +69,10 @@ void init(){
|
|||||||
year = get_current_year();
|
year = get_current_year();
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* savefile_path = "./calendar";
|
static const char *savefile_path = "./calendar";
|
||||||
static char* wiki_url = "https://gitea.ammerhai.com/Ammerhai/work-calendar/wiki";
|
static const char *wiki_url = "https://gitea.ammerhai.com/Ammerhai/work-calendar/wiki";
|
||||||
|
|
||||||
static const char* month_names[] = {"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"};
|
static const char *month_names[] = {"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"};
|
||||||
|
|
||||||
typedef struct Category {
|
typedef struct Category {
|
||||||
bool editing;
|
bool editing;
|
||||||
@ -426,7 +426,7 @@ void per_frame(){
|
|||||||
};
|
};
|
||||||
num_categorized_days++;
|
num_categorized_days++;
|
||||||
}
|
}
|
||||||
color_changed:
|
color_changed:;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
@ -485,6 +485,18 @@ void per_frame(){
|
|||||||
|
|
||||||
ImGui::TableSetColumnIndex(3);
|
ImGui::TableSetColumnIndex(3);
|
||||||
if (ImGui::Button("d")) {
|
if (ImGui::Button("d")) {
|
||||||
|
for (size_t j = 0; j < num_categorized_days; j++) {
|
||||||
|
// Remove categorized days that have the to be deleted category
|
||||||
|
if (categorized_days[j].category == i) {
|
||||||
|
for (size_t k = j; k < num_categorized_days - 1; k++) categorized_days[k] = categorized_days[k + 1];
|
||||||
|
num_categorized_days--;
|
||||||
|
j--;
|
||||||
|
}
|
||||||
|
// Decrement the category index of all categorized days that have an index higher than the one to be removed
|
||||||
|
if (categorized_days[j].category > i) categorized_days[j].category--;
|
||||||
|
}
|
||||||
|
// Remove the category
|
||||||
|
for (size_t j = i; j < num_categories - 1; j++) categories[j] = categories[j + 1];
|
||||||
num_categories--;
|
num_categories--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user