mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-31 03:09:17 -05:00
GuiListView background
This commit is contained in:
@ -3010,6 +3010,10 @@ RAYGUIDEF bool GuiListView(Rectangle bounds, const char **text, int count, int *
|
|||||||
|
|
||||||
// Draw control
|
// Draw control
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Draw background
|
||||||
|
DrawRectangleRec(bounds, GetColor(style[DEFAULT_BACKGROUND_COLOR]));
|
||||||
|
|
||||||
int posX = bounds.x + style[LISTVIEW_BAR_WIDTH] + style[LISTVIEW_ELEMENTS_PADDING];
|
int posX = bounds.x + style[LISTVIEW_BAR_WIDTH] + style[LISTVIEW_ELEMENTS_PADDING];
|
||||||
int elementWidth = bounds.width - style[LISTVIEW_BAR_WIDTH] - 2*style[LISTVIEW_ELEMENTS_PADDING] - LISTVIEW_LINE_THICK;
|
int elementWidth = bounds.width - style[LISTVIEW_BAR_WIDTH] - 2*style[LISTVIEW_ELEMENTS_PADDING] - LISTVIEW_LINE_THICK;
|
||||||
if (!useScrollBar)
|
if (!useScrollBar)
|
||||||
@ -3047,7 +3051,6 @@ RAYGUIDEF bool GuiListView(Rectangle bounds, const char **text, int count, int *
|
|||||||
case FOCUSED:
|
case FOCUSED:
|
||||||
{
|
{
|
||||||
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[SLIDERBAR_BASE_COLOR_FOCUSED]), guiAlpha));
|
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[SLIDERBAR_BASE_COLOR_FOCUSED]), guiAlpha));
|
||||||
|
|
||||||
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_FOCUSED]), guiAlpha));
|
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_FOCUSED]), guiAlpha));
|
||||||
|
|
||||||
if(auxActive >= startIndex && auxActive < endIndex) GuiListElement((Rectangle){ posX, bounds.y + style[LISTVIEW_ELEMENTS_PADDING] + LISTVIEW_LINE_THICK + (auxActive - startIndex)*(style[LISTVIEW_ELEMENTS_HEIGHT] + style[LISTVIEW_ELEMENTS_PADDING]), elementWidth, style[LISTVIEW_ELEMENTS_HEIGHT] }, text[auxActive], true, false);
|
if(auxActive >= startIndex && auxActive < endIndex) GuiListElement((Rectangle){ posX, bounds.y + style[LISTVIEW_ELEMENTS_PADDING] + LISTVIEW_LINE_THICK + (auxActive - startIndex)*(style[LISTVIEW_ELEMENTS_HEIGHT] + style[LISTVIEW_ELEMENTS_PADDING]), elementWidth, style[LISTVIEW_ELEMENTS_HEIGHT] }, text[auxActive], true, false);
|
||||||
@ -3055,12 +3058,12 @@ RAYGUIDEF bool GuiListView(Rectangle bounds, const char **text, int count, int *
|
|||||||
case PRESSED:
|
case PRESSED:
|
||||||
{
|
{
|
||||||
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[SLIDERBAR_BASE_COLOR_PRESSED]), guiAlpha));
|
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[SLIDERBAR_BASE_COLOR_PRESSED]), guiAlpha));
|
||||||
|
|
||||||
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_PRESSED]), guiAlpha));
|
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_PRESSED]), guiAlpha));
|
||||||
} break;
|
} break;
|
||||||
case DISABLED:
|
case DISABLED:
|
||||||
{
|
{
|
||||||
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[LISTVIEW_BASE_COLOR_DISABLED]), guiAlpha));
|
if (useScrollBar) DrawRectangle(bounds.x, barPosY, style[LISTVIEW_BAR_WIDTH], barHeight, Fade(GetColor(style[LISTVIEW_BASE_COLOR_DISABLED]), guiAlpha));
|
||||||
|
|
||||||
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_DISABLED]), guiAlpha));
|
DrawRectangleLinesEx(bounds, LISTVIEW_LINE_THICK, Fade(GetColor(style[LISTVIEW_BORDER_COLOR_DISABLED]), guiAlpha));
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
|
|||||||
Reference in New Issue
Block a user