diff --git a/README.md b/README.md index b652aa1..5e33810 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ You can use any standard GDB command, or any of the commands listed in "Special ### User interface -You can change the font and user interface scaling in the `[ui]` section. For example, +You can change the font, user interface scaling, window width and height in the `[ui]` section. For example, ```ini [ui] @@ -117,6 +117,8 @@ scale=1.5 font_path=/usr/share/fonts/TTF/DejaVuSansMono.ttf font_size_interface=17 font_size_code=20 +width=800 +height=600 ``` To change the font, FreeType must have been available when you compiled gf. You can enable subpixel font rendering by recompiling with `extra_flags=-DUI_FREETYPE_SUBPIXEL ./build.sh`. diff --git a/gf2.cpp b/gf2.cpp index dc707b4..672e265 100644 --- a/gf2.cpp +++ b/gf2.cpp @@ -181,6 +181,8 @@ const char *fontPath; int fontSizeCode = 13; int fontSizeInterface = 11; float uiScale = 1; +int uiWidth = 800; +int uiHeight = 600; bool selectableSource; bool restoreWatchWindow; struct WatchWindow *firstWatchWindow; @@ -1278,6 +1280,10 @@ void SettingsLoad(bool earlyPass) { fontSizeInterface = atoi(state.value); } else if (0 == strcmp(state.key, "scale")) { uiScale = atof(state.value); + } else if (0 == strcmp(state.key, "width")) { + uiWidth = atoi(state.value); + } else if (0 == strcmp(state.key, "height")) { + uiHeight = atoi(state.value); } else if (0 == strcmp(state.key, "layout")) { layoutString = state.value; } else if (0 == strcmp(state.key, "maximize")) { @@ -1855,7 +1861,7 @@ int GfMain(int argc, char **argv) { fontCode = UIFontCreate(fontPath, fontSizeCode); UIFontActivate(UIFontCreate(fontPath, fontSizeInterface)); - windowMain = UIWindowCreate(0, maximize ? UI_WINDOW_MAXIMIZE : 0, "gf2", 0, 0); + windowMain = UIWindowCreate(0, maximize ? UI_WINDOW_MAXIMIZE : 0, "gf2", uiWidth, uiHeight); windowMain->scale = uiScale; windowMain->e.messageUser = WindowMessage;