add fix and first changes for legend

#3 #6
This commit is contained in:
Ammerhai 2025-08-23 13:44:11 +02:00
parent ccf34d2aa9
commit 0dd68bea8a

View File

@ -46,6 +46,7 @@ int days_per_month(int year, int month){
void init(){ void init(){
ImGuiIO &io = ImGui::GetIO(); ImGuiIO &io = ImGui::GetIO();
io.Fonts->AddFontFromMemoryCompressedTTF(inter_compressed_data, inter_compressed_size); io.Fonts->AddFontFromMemoryCompressedTTF(inter_compressed_data, inter_compressed_size);
year = get_current_year();
} }
void per_frame(){ void per_frame(){
@ -71,8 +72,6 @@ void per_frame(){
if(ImGui::BeginTable("Calendar", 2, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoHostExtendX)) { if(ImGui::BeginTable("Calendar", 2, ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_NoHostExtendX)) {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
year = get_current_year();
ImGui::BeginGroup(); ImGui::BeginGroup();
if (ImGui::ArrowButton("##left", ImGuiDir_Left)) if (ImGui::ArrowButton("##left", ImGuiDir_Left))
@ -86,6 +85,10 @@ void per_frame(){
ImGui::TextAligned(0.5, -FLT_MIN, "%d", year); ImGui::TextAligned(0.5, -FLT_MIN, "%d", year);
ImGui::EndGroup(); ImGui::EndGroup();
ImGui::TableSetColumnIndex(1);
ImGui::TextAligned(0.5, -FLT_MIN, "Legende");
//
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
@ -194,6 +197,16 @@ void per_frame(){
ImGui::PopID(); ImGui::PopID();
} }
//Legende
ImGui::TableSetColumnIndex(1);
ImVec4 col;
ImGui::ColorButton("colortest", col);
ImGui::SameLine(0, 0);
char buf[64];
ImGui::InputText("", buf, IM_ARRAYSIZE(buf));
//TODO
//calendar table //calendar table
ImGui::EndTable(); ImGui::EndTable();
} }