From 1a96e4f559c4df1f8036e6054e2876f3c24f0665 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 14 Nov 2025 16:25:14 +0000 Subject: [PATCH] fix git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@712 b9cfdab3-6d41-4d17-bbe4-086880011989 --- src/dialog/colorpicker.c | 19 ++++--------------- src/widget/entry.c | 2 +- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/dialog/colorpicker.c b/src/dialog/colorpicker.c index 0a7032c..daed680 100644 --- a/src/dialog/colorpicker.c +++ b/src/dialog/colorpicker.c @@ -30,7 +30,6 @@ typedef struct color_picker { MwWidget parent; MwWidget color_picker_img; MwWidget value_slider; - MwWidget color_display; MwWidget color_display_text; MwWidget finish; MwLLPixmap color_picker_pixmap; @@ -182,7 +181,6 @@ static void color_picker_click(MwWidget handle, void* user, void* call) { fb = picker->chosen_color.blue > 128 ? 0 : 255; sprintf(fgColor, "#%02X%02X%02X", fr, fg, fb); - MwSetText(picker->color_display, MwNbackground, hexColor); MwSetText(picker->color_display_text, MwNforeground, fgColor); MwSetText(picker->color_display_text, MwNbackground, hexColor); @@ -251,7 +249,6 @@ static void color_display_text_change(MwWidget handle, void* user, fb = color->common.blue > 128 ? 0 : 255; sprintf(fgColor, "#%02X%02X%02X", fr, fg, fb); - MwSetText(picker->color_display, MwNbackground, hexColor); MwSetText(picker->color_display_text, MwNforeground, fgColor); MwSetText(picker->color_display_text, MwNbackground, hexColor); @@ -297,19 +294,11 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) { MwAddUserHandler(picker->color_picker_img, MwNmouseDownHandler, color_picker_click, picker); - picker->color_display = MwCreateWidget( - MwFrameClass, "colorDisplayFrame", picker->parent, IMG_POS_X(w) + (PICKER_SIZE / 2) - ((PICKER_SIZE / 4) / 2), - IMG_POS_Y(h) - (PICKER_SIZE / 16) - MARGIN, (PICKER_SIZE / 4), PICKER_SIZE / 16); - MwSetText(picker->color_display, MwNbackground, "#FFFFFF"); - MwSetInteger(picker->color_display, MwnhasBorder, 1); - MwSetInteger(picker->color_display, MwNinverted, 1); - picker->color_display_text = MwCreateWidget( - MwEntryClass, "colorDisplayFrameText", picker->color_display, - MwDefaultBorderWidth(parent), MwDefaultBorderWidth(parent), - (PICKER_SIZE / 4) - MwDefaultBorderWidth(parent), - (PICKER_SIZE / 16) - (MwDefaultBorderWidth(parent) * 2)); + MwEntryClass, "colorDisplayText", picker->parent, IMG_POS_X(w) + (PICKER_SIZE / 2) - ((PICKER_SIZE / 4) / 2), + IMG_POS_Y(h) - (PICKER_SIZE / 16) - MARGIN, (PICKER_SIZE / 4), PICKER_SIZE / 16); + MwSetText(picker->color_display_text, MwNbackground, "#FFFFFF"); MwSetText(picker->color_display_text, MwNtext, "#FFFFFF"); // MwSetInteger(picker->color_display_text, Mwnali, MwALIGNMENT_CENTER); @@ -338,7 +327,7 @@ color_picker_t* color_picker_setup(MwWidget parent, int w, int h) { MwButtonClass, "colorPickerFinish", picker->parent, IMG_POS_X(w), IMG_POS_Y(h) + PICKER_SIZE + MARGIN, PICKER_SIZE, (WIN_SIZE - PICKER_SIZE - MARGIN * 4) / 2); MwSetText(picker->finish, MwNtext, "Select"); - MwSetInteger(picker->finish, MwnhasBorder, 1); + MwSetInteger(picker->finish, MwNhasBorder, 1); MwSetInteger(picker->finish, MwNinverted, 1); MwAddUserHandler(picker->finish, MwNactivateHandler, diff --git a/src/widget/entry.c b/src/widget/entry.c index c3f8a5c..e14c180 100644 --- a/src/widget/entry.c +++ b/src/widget/entry.c @@ -32,7 +32,7 @@ static void draw(MwWidget handle) { r.width = MwGetInteger(handle, MwNwidth) - t->right; r.height = MwGetInteger(handle, MwNheight); - MwDrawWidgetBack(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0, MwTRUE); + MwDrawWidgetBack(handle, &r, base, 1, 1); if(str != NULL) { int w = MwTextWidth(handle, "M"); int h = MwTextHeight(handle, "M");