From 6ebb57a1a22255338bdc4e981fd257f0063e7bb0 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 14 Nov 2025 18:19:07 +0000 Subject: [PATCH] better theme git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@721 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/core.c | 2 +- src/default.c | 2 +- src/dialog/messagebox.c | 20 ++++++++++---------- src/draw.c | 23 +++++++++++++++++++---- src/widget/frame.c | 24 ++++++++++++------------ 5 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/core.c b/src/core.c index e4ff0a4..e289486 100644 --- a/src/core.c +++ b/src/core.c @@ -280,7 +280,7 @@ int MwStep(MwWidget handle) { handle->prop_event = 1; clean_destroy_queue(handle); - if(handle->parent == NULL && handle->destroyed){ + if(handle->parent == NULL && handle->destroyed) { MwFreeWidget(handle); return 1; } diff --git a/src/default.c b/src/default.c index fa9f21e..3954dd1 100644 --- a/src/default.c +++ b/src/default.c @@ -1,7 +1,7 @@ /* $Id$ */ #include -const char* MwDefaultBackground = "#ddd"; +const char* MwDefaultBackground = "#d2d2d2"; const char* MwDefaultForeground = "#000"; const char* MwDefaultDarkBackground = "#333"; diff --git a/src/dialog/messagebox.c b/src/dialog/messagebox.c index 0da76e0..e9c2aba 100644 --- a/src/dialog/messagebox.c +++ b/src/dialog/messagebox.c @@ -26,16 +26,16 @@ static void messagebox_close(MwWidget handle, void* user, void* call) { } MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsigned int flag) { - MwWidget window; - MwPoint p; - int w, h; - int left = 8; - int th; - int x = 0; - int wx; - int wy; - int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth); - int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight); + MwWidget window; + MwPoint p; + int w, h; + int left = 8; + int th; + int x = 0; + int wx; + int wy; + int ww = handle == NULL ? 0 : MwGetInteger(handle, MwNwidth); + int wh = handle == NULL ? 0 : MwGetInteger(handle, MwNheight); MwSizeHints sh; w = 512; diff --git a/src/draw.c b/src/draw.c index 9a047f4..a066081 100644 --- a/src/draw.c +++ b/src/draw.c @@ -13,9 +13,9 @@ static int get_color_diff(MwWidget handle) { if(MwGetInteger(handle, MwNmodernLook)) { - return 48; + return 46; } else { - return 128; + return 96; } } @@ -127,7 +127,22 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color) { } void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { - MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle)); + if(MwGetInteger(handle, MwNmodernLook)) { + MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle)); + } else { + int diff = get_color_diff(handle) / 2; + MwLLColor col = MwLightenColor(handle, color, diff, diff, diff); + + if(invert) { + MwDrawFrameEx(handle, rect, col, invert, MwDefaultBorderWidth(handle) / 2); + MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2); + } else { + MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2); + MwDrawFrameEx(handle, rect, col, invert, MwDefaultBorderWidth(handle) / 2); + } + + MwLLFreeColor(col); + } } void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border) { @@ -215,7 +230,7 @@ void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border) { MwPoint p[6]; int ColorDiff = get_color_diff(handle); - MwLLColor darker = MwLightenColor(handle, color, -ColorDiff, -ColorDiff, -ColorDiff); + MwLLColor darker = MwLightenColor(handle, color, -ColorDiff * 3 / 2, -ColorDiff * 3 / 2, -ColorDiff * 3 / 2); MwLLColor lighter = MwLightenColor(handle, color, ColorDiff, ColorDiff, ColorDiff); p[0].x = rect->x; diff --git a/src/widget/frame.c b/src/widget/frame.c index 73ba846..329f64c 100644 --- a/src/widget/frame.c +++ b/src/widget/frame.c @@ -46,18 +46,18 @@ static void prop_change(MwWidget handle, const char* key) { } MwClassRec MwFrameClassRec = { - create, /* create */ - NULL, /* destroy */ - draw, /* draw */ - NULL, /* click */ - NULL, /* parent_resize */ - prop_change, /* prop_change */ - NULL, /* mouse_move */ - NULL, /* mouse_up */ - NULL, /* mouse_down */ - NULL, /* key */ - NULL, /* execute */ - NULL, /* tick */ + create, /* create */ + NULL, /* destroy */ + draw, /* draw */ + NULL, /* click */ + NULL, /* parent_resize */ + prop_change, /* prop_change */ + NULL, /* mouse_move */ + NULL, /* mouse_up */ + NULL, /* mouse_down */ + NULL, /* key */ + NULL, /* execute */ + NULL, /* tick */ NULL, NULL, NULL};