Compare commits
No commits in common. "09098bd57310bfcde284d5cf46250523ddad006e" and "52e04febe26007fffc0331cb9aaddf41a193ac95" have entirely different histories.
09098bd573
...
52e04febe2
3
TODO
3
TODO
@ -63,8 +63,7 @@
|
|||||||
[ ] add binding to open up a cheatsheet of keybinding, with a
|
[ ] add binding to open up a cheatsheet of keybinding, with a
|
||||||
search feature
|
search feature
|
||||||
[x] implement visual "ruler" at column 80
|
[x] implement visual "ruler" at column 80
|
||||||
[ ] treeview: show hidden files config and binding
|
[ ] show hidden files config and binding
|
||||||
[ ] treeview: add a config to hide files bsed on patterns (*.\.o etc)
|
|
||||||
[ ] syntax: highlight FIXME TODO BUG FIX and IMPROVEMENT keywords
|
[ ] syntax: highlight FIXME TODO BUG FIX and IMPROVEMENT keywords
|
||||||
[ ] do not open doc in new tab if current tab has an unchanged document
|
[ ] do not open doc in new tab if current tab has an unchanged document
|
||||||
[ ] doc: add auto close brackets and quotes
|
[ ] doc: add auto close brackets and quotes
|
||||||
|
15
src/main.c
15
src/main.c
@ -15,15 +15,13 @@
|
|||||||
|
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
|
||||||
static double get_scale(SDL_DisplayMode *dm)
|
static double get_scale(void)
|
||||||
{
|
{
|
||||||
float dpi, s;
|
float dpi, s;
|
||||||
SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
|
SDL_GetDisplayDPI(0, NULL, &dpi, NULL);
|
||||||
// TODO: get the current window's screen not the primary
|
|
||||||
printf("w: %d, h: %d\n", dm->w, dm->h);
|
|
||||||
s = (1.0/dpi)*25.4; // size of a point
|
s = (1.0/dpi)*25.4; // size of a point
|
||||||
// as per standard 14 point should be 3mm
|
// as per standard 14 point should be 3mm
|
||||||
return fmax(1.0, floor((FONT_14PT_SIZE_MM/(14*s))*10)/10.0);
|
return floor((FONT_14PT_SIZE_MM/(14*s))*10)/10.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_exe_filename(char *buf, int sz)
|
static void get_exe_filename(char *buf, int sz)
|
||||||
@ -72,15 +70,12 @@ int main(int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SDL_DisplayMode dm;
|
SDL_DisplayMode dm;
|
||||||
SDL_GetDesktopDisplayMode(0, &dm);
|
SDL_GetCurrentDisplayMode(0, &dm);
|
||||||
|
|
||||||
window = SDL_CreateWindow(
|
window = SDL_CreateWindow(
|
||||||
"", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
"", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
||||||
dm.w * 0.8, dm.h * 0.8,
|
dm.w * 0.8, dm.h * 0.8,
|
||||||
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN);
|
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_HIDDEN);
|
||||||
int wd = SDL_GetWindowDisplayIndex(window);
|
|
||||||
printf("%d \n", wd);
|
|
||||||
SDL_GetDesktopDisplayMode(wd, &dm);
|
|
||||||
init_window_icon();
|
init_window_icon();
|
||||||
ren_init(window);
|
ren_init(window);
|
||||||
|
|
||||||
@ -102,9 +97,7 @@ int main(int argc, char **argv)
|
|||||||
lua_pushstring(L, SDL_GetPlatform());
|
lua_pushstring(L, SDL_GetPlatform());
|
||||||
lua_setglobal(L, "PLATFORM");
|
lua_setglobal(L, "PLATFORM");
|
||||||
|
|
||||||
double scale = get_scale(&dm);
|
lua_pushnumber(L, get_scale());
|
||||||
printf("%f\n", scale);
|
|
||||||
lua_pushnumber(L, scale);
|
|
||||||
lua_setglobal(L, "SCALE");
|
lua_setglobal(L, "SCALE");
|
||||||
|
|
||||||
char exename[2048];
|
char exename[2048];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user