Jump to content

is there any options to remove the 3D effects of widgets?


yuzhubin

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...