ImpulseAdventure / GUIslice

GUIslice drag & drop embedded GUI in C for touchscreen TFT on Arduino, Raspberry Pi, ARM, ESP8266 / ESP32 / M5stack using Adafruit-GFX / TFT_eSPI / UTFT / SDL
https://www.impulseadventure.com/elec/guislice-gui.html
MIT License
1.2k stars 211 forks source link

XSlider uses frame glow color when selected instead of glow color. #464

Open Pconti31 opened 2 years ago

Pconti31 commented 2 years ago

Testing XSlider with themes shows that the current XSlider is incorrectly using frame glow color from the
gslc_ElemCalcRectState() routine when drawing the track.

inside gslc_ElemCalcRectState() 
// Calculate the element colors
  pState->colBack = pElem->colElemFill;
  if (bGlowing) {
    pState->colFrm = pElem->colElemFrameGlow;
    pState->colInner = pElem->colElemFillGlow; <-- maybe use this instead???
    pState->colTxtFore = pElem->colElemTextGlow;
  } else {
    pState->colFrm = pElem->colElemFrame;
    pState->colInner = pElem->colElemFill;
    pState->colTxtFore = pElem->colElemText;
  }

inside XSlider Draw
    // Make the track highlight during glow
    gslc_DrawLine(pGui,nX0+nMargin,nYMid,nX1-nMargin,nYMid,sState.colFrm);

Note that the builder currently doesn't even ask for frame glow colors on any elements although that could change in the future.

One more issue when touching the slider a large black box is briefly shown to refresh the controls. Might be nicer if we had a way to set the color beside you using the background since in many cases we have an enclosing box for our controls with a different color than the background. Paul--