parent
910b238763
commit
18f0a41072
4665
src/inter-bold.h
Normal file
4665
src/inter-bold.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,16 +5,30 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "inter.h"
|
#include "inter.h"
|
||||||
|
#include "inter-bold.h"
|
||||||
|
|
||||||
|
|
||||||
extern bool should_exit;
|
extern bool should_exit;
|
||||||
extern bool show_demo_window;
|
extern bool show_demo_window;
|
||||||
|
|
||||||
//standard year
|
//standard year
|
||||||
int year = 2025;
|
static int year = 2025;
|
||||||
|
|
||||||
|
static int current_year = 2025;
|
||||||
|
static int current_month = 1;
|
||||||
|
static int current_day = 1;
|
||||||
|
|
||||||
|
//fonts
|
||||||
|
static ImFont *inter_regular;
|
||||||
|
static ImFont *inter_bold;
|
||||||
|
|
||||||
int get_current_year(){
|
int get_current_year(){
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
struct tm tm = *localtime(&t);
|
struct tm tm = *localtime(&t);
|
||||||
|
|
||||||
|
current_year = tm.tm_year + 1900;
|
||||||
|
current_month = tm.tm_mon + 1;
|
||||||
|
current_day = tm.tm_mday;
|
||||||
|
|
||||||
// tm_year is years since 1900
|
// tm_year is years since 1900
|
||||||
return year = tm.tm_year + 1900;
|
return year = tm.tm_year + 1900;
|
||||||
@ -50,7 +64,8 @@ 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);
|
inter_regular = io.Fonts->AddFontFromMemoryCompressedTTF(inter_compressed_data, inter_compressed_size);
|
||||||
|
inter_bold = io.Fonts->AddFontFromMemoryCompressedTTF(inter_bold_compressed_data, inter_bold_compressed_size);
|
||||||
year = get_current_year();
|
year = get_current_year();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +375,13 @@ void per_frame(){
|
|||||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImU32(color));
|
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImU32(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
if(current_year == year && current_month == month && current_day == day ) {
|
||||||
|
ImGui::PushFont(inter_bold);
|
||||||
|
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
||||||
|
ImGui::PopFont();
|
||||||
|
} else {
|
||||||
|
ImGui::TextAligned(0.5, -FLT_MIN, "%d", day);
|
||||||
|
}
|
||||||
|
|
||||||
if(ImGui::IsItemHovered()){
|
if(ImGui::IsItemHovered()){
|
||||||
if(selected_category != -1) {
|
if(selected_category != -1) {
|
||||||
|
|||||||
BIN
tools/Inter-Bold.ttf
Normal file
BIN
tools/Inter-Bold.ttf
Normal file
Binary file not shown.
BIN
tools/binary_to_compressed_c.exe
Normal file
BIN
tools/binary_to_compressed_c.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user