From 3584522e8fe856773f18c7ecda68e0c3ddcf864c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 4 Aug 2019 09:32:53 +1000 Subject: [PATCH] Scale up servers table default column widths with DPI --- src/LWidgets.c | 5 +++++ src/Window.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/LWidgets.c b/src/LWidgets.c index 33fd9a9d0..2390ea93b 100644 --- a/src/LWidgets.c +++ b/src/LWidgets.c @@ -1090,6 +1090,7 @@ static struct LWidgetVTABLE ltable_VTABLE = { LTable_MouseWheel, /* Wheel */ }; void LTable_Init(struct LTable* w, FontDesc* rowFont) { + int i; w->VTABLE = <able_VTABLE; w->Columns = tableColumns; w->NumColumns = Array_Elems(tableColumns); @@ -1098,6 +1099,10 @@ void LTable_Init(struct LTable* w, FontDesc* rowFont) { w->ScrollbarWidth = Display_ScaleX(10); w->GridlineWidth = Display_ScaleX(2); w->GridlineHeight = Display_ScaleY(2); + + for (i = 0; i < w->NumColumns; i++) { + w->Columns[i].width = Display_ScaleX(w->Columns[i].width); + } } void LTable_Reset(struct LTable* w) { diff --git a/src/Window.c b/src/Window.c index 1f69f4ef1..9684eab66 100644 --- a/src/Window.c +++ b/src/Window.c @@ -2947,7 +2947,7 @@ static void JNICALL java_onLowMemory(JNIEnv* env, jobject o) { /* TODO: Low memory */ } -static const JNINativeMethod methods[19] = { +static const JNINativeMethod methods[18] = { { "processKeyDown", "(I)V", java_processKeyDown }, { "processKeyUp", "(I)V", java_processKeyUp }, { "processKeyChar", "(I)V", java_processKeyChar }, @@ -2967,9 +2967,9 @@ static const JNINativeMethod methods[19] = { { "processOnPause", "()V", java_onPause }, { "processOnDestroy", "()V", java_onDestroy }, - { "processOnGotFocus", "()V", java_onGotFocus }, - { "processOnLostFocus", "()V", java_onLostFocus }, - { "processOnLowMemory", "()V", java_onLowMemory } + { "processOnGotFocus", "()V", java_onGotFocus }, + { "processOnLostFocus", "()V", java_onLostFocus }, + { "processOnLowMemory", "()V", java_onLowMemory } }; void Window_Init(void) { @@ -2986,7 +2986,7 @@ void Window_Init(void) { void Window_Create(int width, int height) { Window_Exists = true; - /* actual window creation is done when processSurfaceCreated is called */ + /* actual window creation is done when processSurfaceCreated is received */ } void Window_SetTitle(const String* title) {