Skip to content

Commit

Permalink
refac: prep ui ext for 1.0 & expose additional/future flags
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Oct 23, 2024
1 parent 760155e commit 797a363
Show file tree
Hide file tree
Showing 11 changed files with 428 additions and 360 deletions.
4 changes: 2 additions & 2 deletions examples/example_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ pl_app_update(plAppData* ptAppData)

const float pfRatios[] = {1.0f};
gptUi->layout_row(PL_UI_LAYOUT_ROW_TYPE_DYNAMIC, 0.0f, 1, pfRatios);
if(gptUi->begin_collapsing_header("Information"))
if(gptUi->begin_collapsing_header("Information", 0))
{

gptUi->text("Pilot Light %s", PILOT_LIGHT_VERSION);
Expand All @@ -289,7 +289,7 @@ pl_app_update(plAppData* ptAppData)

gptUi->end_collapsing_header();
}
if(gptUi->begin_collapsing_header("User Interface"))
if(gptUi->begin_collapsing_header("User Interface", 0))
{
gptUi->checkbox("UI Debug", &ptAppData->bShowUiDebug);
gptUi->checkbox("UI Demo", &ptAppData->bShowUiDemo);
Expand Down
40 changes: 20 additions & 20 deletions extensions/pl_debug_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ pl__show_profiling(bool* bValue)

gptUI->separator();

if(gptUI->begin_tab_bar("profiling tabs"))
if(gptUI->begin_tab_bar("profiling tabs", 0))
{
if(gptUI->begin_tab("Table"))
if(gptUI->begin_tab("Table", 0))
{
gptUI->layout_template_begin(0.0f);
gptUI->layout_template_push_variable(400.0f);
Expand Down Expand Up @@ -328,20 +328,20 @@ pl__show_profiling(bool* bValue)
gptUI->unindent(15.0f * (float)(ptSamples[i].uDepth + 1));
gptUI->text("%7.3f", ptSamples[i].dDuration * 1000.0);
gptUI->text("%7.3f", ptSamples[i].dStartTime * 1000.0);
gptUI->push_theme_color(PL_UI_COLOR_PROGRESS_BAR, &atColors[ptSamples[i].uDepth % 6]);
gptUI->push_theme_color(PL_UI_COLOR_PROGRESS_BAR, atColors[ptSamples[i].uDepth % 6]);
gptUI->progress_bar((float)(ptSamples[i].dDuration / (double)gptDebugCtx->fDeltaTime), (plVec2){-1.0f, 0.0f}, NULL);
gptUI->pop_theme_color(1);
}
}
gptUI->end_tab();
}

if(gptUI->begin_tab("Graph"))
if(gptUI->begin_tab("Graph", 0))
{

const plVec2 tParentCursorPos = gptUI->get_cursor_pos();
gptUI->layout_dynamic(tWindowEnd.y - tParentCursorPos.y - 5.0f, 1);
if(gptUI->begin_child("timeline"))
if(gptUI->begin_child("timeline", 0, 0))
{

const plVec2 tChildWindowSize = gptUI->get_window_size();
Expand Down Expand Up @@ -504,7 +504,7 @@ pl__show_profiling(bool* bValue)
const float fPixelStart = (float)(dConvertToPixel * ptSamples[i].dStartTime);
gptUI->layout_space_push(fPixelStart, (float)ptSamples[i].uDepth * 25.0f + 55.0f, fPixelWidth, 20.0f);
char* pcTempBuffer = pl_temp_allocator_sprintf(&gptDebugCtx->tTempAllocator, "%s##pro%u", ptSamples[i].pcName, i);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON, &atColors[ptSamples[i].uDepth % 6]);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON, atColors[ptSamples[i].uDepth % 6]);
if(gptUI->button(pcTempBuffer))
{
dInitialVisibleTime = pl_clampd(0.0001, ptSamples[i].dDuration, (double)gptDebugCtx->fDeltaTime);
Expand Down Expand Up @@ -598,15 +598,15 @@ pl__show_statistics(bool* bValue)
gptUI->layout_template_push_dynamic();
gptUI->layout_template_end();

if(gptUI->begin_child("left"))
if(gptUI->begin_child("left", 0, 0))
{
gptUI->layout_dynamic(0.0f, 1);

const plVec4 tNewHeaderColor = (plVec4){0.0f, 0.5f, 0.0f, 0.75f};
gptUI->push_theme_color(PL_UI_COLOR_HEADER, &tNewHeaderColor);
gptUI->push_theme_color(PL_UI_COLOR_HEADER, tNewHeaderColor);
for(uint32_t i = 0; i < pl_sb_size(gptDebugCtx->sbppdValues); i++)
{
if(gptUI->selectable(gptDebugCtx->ppcNames[i], &gptDebugCtx->sbbValues[i]))
if(gptUI->selectable(gptDebugCtx->ppcNames[i], &gptDebugCtx->sbbValues[i], 0))
{
if(gptDebugCtx->sbbValues[i])
{
Expand Down Expand Up @@ -646,9 +646,9 @@ pl__show_statistics(bool* bValue)
}


if(gptUI->begin_tab_bar("stat tabs"))
if(gptUI->begin_tab_bar("stat tabs", 0))
{
if(gptUI->begin_tab("Plot"))
if(gptUI->begin_tab("Plot", 0))
{

gptUI->layout_template_begin(tWindowSize.y - 30.0f);
Expand Down Expand Up @@ -735,7 +735,7 @@ pl__show_statistics(bool* bValue)
gptUI->end_tab();
}

if(gptUI->begin_tab("Table"))
if(gptUI->begin_tab("Table", 0))
{
gptUI->layout_template_begin(0.0f);
gptUI->layout_template_push_static(35.0f);
Expand Down Expand Up @@ -842,9 +842,9 @@ pl__show_device_memory(bool* bValue)
"Device Memory: Staging Cached"
};

gptUI->push_theme_color(PL_UI_COLOR_BUTTON, &tButtonColor);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON_ACTIVE, &tButtonColor);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON_HOVERED, &tButtonColor);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON, tButtonColor);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON_ACTIVE, tButtonColor);
gptUI->push_theme_color(PL_UI_COLOR_BUTTON_HOVERED, tButtonColor);
for(uint32_t uAllocatorIndex = 0; uAllocatorIndex < 4; uAllocatorIndex++)
{
uint32_t uBlockCount = 0;
Expand Down Expand Up @@ -988,7 +988,7 @@ pl__show_logging(bool* bValue)
}

gptUI->layout_dynamic(0.0f, 1);
if(gptUI->begin_tab_bar("tab bar"))
if(gptUI->begin_tab_bar("tab bar", 0))
{
uint32_t uChannelCount = (uint32_t)pl_get_log_channel_count();
for(uint32_t i = 0; i < uChannelCount; i++)
Expand All @@ -1002,11 +1002,11 @@ pl__show_logging(bool* bValue)

if(tInfo.tType & PL_CHANNEL_TYPE_CYCLIC_BUFFER)
{
if(gptUI->begin_tab(tInfo.pcName))
if(gptUI->begin_tab(tInfo.pcName, 0))
{
const plVec2 tCursorPos = gptUI->get_cursor_pos();
gptUI->layout_dynamic(tWindowEnd.y - tCursorPos.y - 20.0f, 1);
if(gptUI->begin_child(tInfo.pcName))
if(gptUI->begin_child(tInfo.pcName, 0, 0))
{
gptUI->layout_dynamic(0.0f, 1);
const uint32_t uIndexStart = (uint32_t)uEntryCount;
Expand Down Expand Up @@ -1045,11 +1045,11 @@ pl__show_logging(bool* bValue)
}
else if(tInfo.tType & PL_CHANNEL_TYPE_BUFFER)
{
if(gptUI->begin_tab(tInfo.pcName))
if(gptUI->begin_tab(tInfo.pcName, 0))
{
const plVec2 tCursorPos = gptUI->get_cursor_pos();
gptUI->layout_dynamic(tWindowEnd.y - tCursorPos.y - 20.0f, 1);
if(gptUI->begin_child(tInfo.pcName))
if(gptUI->begin_child(tInfo.pcName, 0, 0))
{
gptUI->layout_dynamic(0.0f, 1);

Expand Down
3 changes: 1 addition & 2 deletions extensions/pl_draw_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3182,8 +3182,7 @@ pl__lit(const unsigned char* pucData, uint32_t uLength)
ptrDOut_ += uLength;
else if (pucData < ptrBarrierInB_)
ptrDOut_ = ptrBarrierOutE_ + 1;
else
memcpy(ptrDOut_, pucData, uLength); ptrDOut_ += uLength;
else {memcpy(ptrDOut_, pucData, uLength); ptrDOut_ += uLength; }
}

#define MV_IN2_(x) ((pucI[x] << 8) + pucI[(x) + 1])
Expand Down
6 changes: 3 additions & 3 deletions extensions/pl_renderer_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -4694,19 +4694,19 @@ pl_add_drawable_objects_to_scene(uint32_t uSceneHandle, uint32_t uOpaqueCount, c
static void
pl_show_graphics_options(const char* pcTitle)
{
if(gptUI->begin_collapsing_header(pcTitle))
if(gptUI->begin_collapsing_header(pcTitle, 0))
{
// if(gptUI->checkbox("VSync", &gptData->ptSwap->bVSync))
// gptData->bReloadSwapchain = true;
gptUI->checkbox("Show Origin", &gptData->bShowOrigin);
gptUI->checkbox("Frustum Culling", &gptData->bFrustumCulling);
gptUI->slider_float("Lambda Split", &gptData->fLambdaSplit, 0.0f, 1.0f);
gptUI->slider_float("Lambda Split", &gptData->fLambdaSplit, 0.0f, 1.0f, 0);
gptUI->checkbox("Draw All Bounding Boxes", &gptData->bDrawAllBoundingBoxes);
gptUI->checkbox("Draw Visible Bounding Boxes", &gptData->bDrawVisibleBoundingBoxes);
gptUI->checkbox("Show Selected Bounding Box", &gptData->bShowSelectedBoundingBox);

int iOutlineWidth = (int)gptData->uOutlineWidth;
if(gptUI->slider_int("Outline Width", &iOutlineWidth, 2, 50))
if(gptUI->slider_int("Outline Width", &iOutlineWidth, 2, 50, 0))
{
gptData->uOutlineWidth = (uint32_t)iOutlineWidth;
}
Expand Down
100 changes: 63 additions & 37 deletions extensions/pl_ui_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,41 @@ pl_set_dark_theme(void)
gptCtx->tStyle.fSeparatorTextLineSize = 3.0f;

// colors
gptCtx->tColorScheme.tTitleActiveCol = (plVec4){0.33f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tTitleBgCol = (plVec4){0.04f, 0.04f, 0.04f, 1.00f};
gptCtx->tColorScheme.tTitleBgCollapsedCol = (plVec4){0.04f, 0.04f, 0.04f, 1.00f};
gptCtx->tColorScheme.tWindowBgColor = (plVec4){0.10f, 0.10f, 0.10f, 0.78f};
gptCtx->tColorScheme.tWindowBorderColor = (plVec4){0.33f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tChildBgColor = (plVec4){0.10f, 0.10f, 0.10f, 0.78f};
gptCtx->tColorScheme.tButtonCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tButtonHoveredCol = (plVec4){0.61f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tButtonActiveCol = (plVec4){0.87f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tTextCol = (plVec4){1.00f, 1.00f, 1.00f, 1.00f};
gptCtx->tColorScheme.tTextDisabledCol = (plVec4){0.50f, 0.50f, 0.50f, 1.00f};
gptCtx->tColorScheme.tProgressBarCol = (plVec4){0.90f, 0.70f, 0.00f, 1.00f};
gptCtx->tColorScheme.tCheckmarkCol = (plVec4){0.87f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tFrameBgCol = (plVec4){0.23f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tFrameBgHoveredCol = (plVec4){0.26f, 0.59f, 0.98f, 0.40f};
gptCtx->tColorScheme.tFrameBgActiveCol = (plVec4){0.26f, 0.59f, 0.98f, 0.67f};
gptCtx->tColorScheme.tHeaderCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tHeaderHoveredCol = (plVec4){0.26f, 0.59f, 0.98f, 0.80f};
gptCtx->tColorScheme.tHeaderActiveCol = (plVec4){0.26f, 0.59f, 0.98f, 1.00f};
gptCtx->tColorScheme.tScrollbarBgCol = (plVec4){0.05f, 0.05f, 0.05f, 0.85f};
gptCtx->tColorScheme.tScrollbarHandleCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tScrollbarFrameCol = (plVec4){0.00f, 0.00f, 0.00f, 0.00f};
gptCtx->tColorScheme.tScrollbarActiveCol = gptCtx->tColorScheme.tButtonActiveCol;
gptCtx->tColorScheme.tScrollbarHoveredCol = gptCtx->tColorScheme.tButtonHoveredCol;
gptCtx->tColorScheme.tSeparatorCol = gptCtx->tColorScheme.tScrollbarHandleCol;
gptCtx->tColorScheme.tTitleActiveCol = (plVec4){0.33f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tTitleBgCol = (plVec4){0.04f, 0.04f, 0.04f, 1.00f};
gptCtx->tColorScheme.tTitleBgCollapsedCol = (plVec4){0.04f, 0.04f, 0.04f, 1.00f};
gptCtx->tColorScheme.tWindowBgColor = (plVec4){0.10f, 0.10f, 0.10f, 0.78f};
gptCtx->tColorScheme.tWindowBorderColor = (plVec4){0.33f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tChildBgColor = (plVec4){0.25f, 0.10f, 0.10f, 0.78f};
gptCtx->tColorScheme.tButtonCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tButtonHoveredCol = (plVec4){0.61f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tButtonActiveCol = (plVec4){0.87f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tTextCol = (plVec4){1.00f, 1.00f, 1.00f, 1.00f};
gptCtx->tColorScheme.tTextDisabledCol = (plVec4){0.50f, 0.50f, 0.50f, 1.00f};
gptCtx->tColorScheme.tProgressBarCol = (plVec4){0.90f, 0.70f, 0.00f, 1.00f};
gptCtx->tColorScheme.tCheckmarkCol = (plVec4){0.87f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tFrameBgCol = (plVec4){0.23f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tFrameBgHoveredCol = (plVec4){0.26f, 0.59f, 0.98f, 0.40f};
gptCtx->tColorScheme.tFrameBgActiveCol = (plVec4){0.26f, 0.59f, 0.98f, 0.67f};
gptCtx->tColorScheme.tHeaderCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tHeaderHoveredCol = (plVec4){0.26f, 0.59f, 0.98f, 0.80f};
gptCtx->tColorScheme.tHeaderActiveCol = (plVec4){0.26f, 0.59f, 0.98f, 1.00f};
gptCtx->tColorScheme.tScrollbarBgCol = (plVec4){0.05f, 0.05f, 0.05f, 0.85f};
gptCtx->tColorScheme.tScrollbarHandleCol = (plVec4){0.51f, 0.02f, 0.10f, 1.00f};
gptCtx->tColorScheme.tScrollbarFrameCol = (plVec4){0.00f, 0.00f, 0.00f, 0.00f};
gptCtx->tColorScheme.tScrollbarActiveCol = gptCtx->tColorScheme.tButtonActiveCol;
gptCtx->tColorScheme.tScrollbarHoveredCol = gptCtx->tColorScheme.tButtonHoveredCol;
gptCtx->tColorScheme.tSeparatorCol = gptCtx->tColorScheme.tScrollbarHandleCol;
gptCtx->tColorScheme.tTabCol = gptCtx->tColorScheme.tButtonCol;
gptCtx->tColorScheme.tTabHoveredCol = gptCtx->tColorScheme.tButtonHoveredCol;
gptCtx->tColorScheme.tTabSelectedCol = gptCtx->tColorScheme.tButtonActiveCol;
gptCtx->tColorScheme.tResizeGripCol = (plVec4){0.33f, 0.02f, 0.10f, 1.0f};
gptCtx->tColorScheme.tResizeGripHoveredCol = (plVec4){0.66f, 0.02f, 0.10f, 1.0f};
gptCtx->tColorScheme.tResizeGripActiveCol = (plVec4){0.99f, 0.02f, 0.10f, 1.0f};
gptCtx->tColorScheme.tSliderCol = gptCtx->tColorScheme.tButtonCol;
gptCtx->tColorScheme.tSliderHoveredCol = gptCtx->tColorScheme.tButtonHoveredCol;
gptCtx->tColorScheme.tSliderActiveCol = gptCtx->tColorScheme.tButtonActiveCol;
gptCtx->tColorScheme.tPopupBgColor = (plVec4){0.15f, 0.10f, 0.10f, 0.78f};
}

plDrawList2D*
Expand Down Expand Up @@ -319,13 +329,13 @@ pl_end_frame(void)
}

void
pl_push_theme_color(plUiColor tColor, const plVec4* ptColor)
pl_push_theme_color(plUiColor tColorCode, plVec4 tColor)
{
const plUiColorStackItem tPrevItem = {
.tIndex = tColor,
.tColor = gptCtx->tColorScheme.atColors[tColor]
.tIndex = tColorCode,
.tColor = gptCtx->tColorScheme.atColors[tColorCode]
};
gptCtx->tColorScheme.atColors[tColor] = *ptColor;
gptCtx->tColorScheme.atColors[tColorCode] = tColor;
pl_sb_push(gptCtx->sbtColorStack, tPrevItem);
}

Expand Down Expand Up @@ -461,7 +471,7 @@ pl_end_child(void)
}

bool
pl_begin_child(const char* pcName)
pl_begin_child(const char* pcName, plUiChildFlags tChildFlags, plUiWindowFlags tWindowFlags)
{
plUiWindow* ptParentWindow = gptCtx->ptCurrentWindow;
plUiLayoutRow* ptCurrentRow = &ptParentWindow->tTempData.tCurrentLayoutRow;
Expand Down Expand Up @@ -495,7 +505,7 @@ pl_begin_child(const char* pcName)
}

void
pl_open_popup(const char* pcName)
pl_open_popup(const char* pcName, plUiPopupFlags tFlags)
{
const uint32_t uHash = pl_str_hash(pcName, 0, pl_sb_top(gptCtx->sbuIdStack));
plUiPopupData tPopupData = {
Expand Down Expand Up @@ -1630,6 +1640,13 @@ pl__begin_window_ex(const char* pcName, bool* pbOpen, plUiWindowFlags tFlags)

const bool bScrollBarsPresent = ptWindow->bScrollbarX || ptWindow->bScrollbarY;

uint32_t uBackgroundColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tWindowBgColor);
if(ptWindow->tFlags & PL_UI_WINDOW_FLAGS_CHILD_WINDOW)
uBackgroundColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tChildBgColor);
if(ptWindow->tFlags & PL_UI_WINDOW_FLAGS_POPUP_WINDOW)
uBackgroundColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tPopupBgColor);


// autosized non collapsed
if(ptWindow->tFlags & PL_UI_WINDOW_FLAGS_AUTO_SIZE && !ptWindow->bCollapsed)
{
Expand All @@ -1649,7 +1666,10 @@ pl__begin_window_ex(const char* pcName, bool* pbOpen, plUiWindowFlags tFlags)
ptWindow->tOuterRectClipped = ptWindow->tOuterRect;

// draw background
gptDraw->add_rect_rounded_filled(ptWindow->ptBgLayer, tBgRect.tMin, tBgRect.tMax, gptCtx->tStyle.fWindowRounding, 0, PL_DRAW_RECT_FLAG_ROUND_CORNERS_BOTTOM, (plDrawSolidOptions){.uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tWindowBgColor)});
gptDraw->add_rect_rounded_filled(
ptWindow->ptBgLayer, tBgRect.tMin, tBgRect.tMax,
gptCtx->tStyle.fWindowRounding, 0, PL_DRAW_RECT_FLAG_ROUND_CORNERS_BOTTOM,
(plDrawSolidOptions){.uColor = uBackgroundColor});

ptWindow->tFullSize = ptWindow->tSize;
}
Expand Down Expand Up @@ -1681,8 +1701,14 @@ pl__begin_window_ex(const char* pcName, bool* pbOpen, plUiWindowFlags tFlags)
// draw border
if(!(tFlags & PL_UI_WINDOW_FLAGS_NO_BACKGROUND))
{
gptDraw->add_rect_rounded(ptWindow->ptFgLayer, ptWindow->tOuterRect.tMin, ptWindow->tOuterRect.tMax, gptCtx->tStyle.fWindowRounding, 0, 0, (plDrawLineOptions){.fThickness = 1.0f, .uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tWindowBorderColor)});
gptDraw->add_rect_rounded_filled(ptWindow->ptBgLayer, tBgRect.tMin, tBgRect.tMax, gptCtx->tStyle.fWindowRounding, 0, PL_DRAW_RECT_FLAG_ROUND_CORNERS_BOTTOM, (plDrawSolidOptions){.uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tWindowBgColor)});
gptDraw->add_rect_rounded(
ptWindow->ptFgLayer, ptWindow->tOuterRect.tMin, ptWindow->tOuterRect.tMax,
gptCtx->tStyle.fWindowRounding, 0, 0,
(plDrawLineOptions){.fThickness = 1.0f, .uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tWindowBorderColor)});
gptDraw->add_rect_rounded_filled(
ptWindow->ptBgLayer, tBgRect.tMin, tBgRect.tMax, gptCtx->tStyle.fWindowRounding,
0, PL_DRAW_RECT_FLAG_ROUND_CORNERS_BOTTOM,
(plDrawSolidOptions){.uColor = uBackgroundColor});
}

// vertical scroll bar
Expand Down Expand Up @@ -1712,17 +1738,17 @@ pl__begin_window_ex(const char* pcName, bool* pbOpen, plUiWindowFlags tFlags)

if(gptCtx->uActiveId == uResizeHash)
{
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_RGB(0.99f, 0.02f, 0.10f)});
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tResizeGripActiveCol)});
gptIOI->set_mouse_cursor(PL_MOUSE_CURSOR_RESIZE_NWSE);
}
else if(gptCtx->uHoveredId == uResizeHash)
{
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_RGB(0.66f, 0.02f, 0.10f)});
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tResizeGripHoveredCol)});
gptIOI->set_mouse_cursor(PL_MOUSE_CURSOR_RESIZE_NWSE);
}
else
{
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_RGB(0.33f, 0.02f, 0.10f)});
gptDraw->add_triangle_filled(ptWindow->ptFgLayer, tBottomRight, tCornerTopPos, tCornerLeftPos, (plDrawSolidOptions){.uColor = PL_COLOR_32_VEC4(gptCtx->tColorScheme.tResizeGripCol)});
}
}

Expand Down
Loading

0 comments on commit 797a363

Please sign in to comment.