yuzhubin Posted May 8, 2018 Report Share Posted May 8, 2018 is there any options to remove the 3D efforts of the widgets? for example the button looks like it has some shadow effects, in order to remove this i try to remove some codes like below void gwinButtonDraw_Normal(GWidgetObject *gw, void *param) { const GColorSet * pcol; fixed alpha; fixed dalpha; coord_t i; color_t tcol, bcol; (void) param; if (gw->g.vmt != (gwinVMT *)&buttonVMT) return; pcol = getButtonColors(gw); /* Fill the box blended from variants of the fill color */ //tcol = gdispBlendColor(GFX_WHITE, pcol->fill, BTN_TOP_FADE); //bcol = gdispBlendColor(GFX_BLACK, pcol->fill, BTN_BOTTOM_FADE); //dalpha = FIXED(255)/gw->g.height; //for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha) // gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha))); gdispGDrawStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, justifyCenter); //gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge); //gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge); // Render highlighted border if focused _gwidgetDrawFocusRect(gw, 0, 0, gw->g.width-1, gw->g.height-1); } it did work for me , the button just show texts right and can be toggled. i wonder is there any better ways to do this? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted May 8, 2018 Report Share Posted May 8, 2018 I think you might want to give GWIN_FLAT_STYLING a try (set it to FALSE or GFXOFF). Other than that you can always just create a custom rendering routine in your application instead of modifying library code: https://wiki.ugfx.io/index.php/Creating_a_custom_rendering_routine Link to comment Share on other sites More sharing options...
yuzhubin Posted May 9, 2018 Author Report Share Posted May 9, 2018 thanks for reply, i tried GWIN_FLAT_STYLING but nothing changed, i will try to write custom rendering routine Link to comment Share on other sites More sharing options...
inmarket Posted May 9, 2018 Report Share Posted May 9, 2018 Try setting the option to TRUE (or GFXON if using the latest repository version). Link to comment Share on other sites More sharing options...
yuzhubin Posted May 9, 2018 Author Report Share Posted May 9, 2018 yes i did clone the lastest repository and set GWIN_FLAT_STYLING to GFXON。however thanks for your reply Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted May 14, 2018 Report Share Posted May 14, 2018 Did you perform a clean compilation? This should definitely work. There's not much that can go wrong. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now