mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Changed imguiTabs() active color to be consistent with imguiButton().
This commit is contained in:
parent
7b03d93336
commit
5c77bc941f
1 changed files with 17 additions and 9 deletions
|
@ -1503,16 +1503,13 @@ struct Imgui
|
|||
const bool over = enabled && inRect(buttonX, yy, tabWidth, _height);
|
||||
const bool res = buttonLogic(id, over);
|
||||
|
||||
if (res)
|
||||
{
|
||||
selected = ii;
|
||||
}
|
||||
const uint32_t textColor = (ii == selected)
|
||||
? (enabled ? imguiRGBA(0,0,0,255) : imguiRGBA(255,255,255,100) )
|
||||
: (isHot(id) ? imguiRGBA(255,196,0,enabled?255:100) : imguiRGBA(255,255,255,enabled?200:100) )
|
||||
;
|
||||
|
||||
uint32_t textColor;
|
||||
if (ii == selected)
|
||||
{
|
||||
textColor = enabled?imguiRGBA(0,0,0,255):imguiRGBA(255,255,255,100);
|
||||
|
||||
drawRoundedRect( (float)buttonX
|
||||
, (float)yy
|
||||
, (float)tabWidth
|
||||
|
@ -1521,9 +1518,15 @@ struct Imgui
|
|||
, enabled?imguiRGBA(255,196,0,200):imguiRGBA(128,128,128,32)
|
||||
);
|
||||
}
|
||||
else
|
||||
else if (isActive(id))
|
||||
{
|
||||
textColor = isHot(id) ? imguiRGBA(255, 196, 0, enabled?255:100) : imguiRGBA(255, 255, 255, enabled?200:100);
|
||||
drawRoundedRect( (float)buttonX
|
||||
, (float)yy
|
||||
, (float)tabWidth
|
||||
, (float)_height
|
||||
, (float)_r
|
||||
, imguiRGBA(128,128,128,196)
|
||||
);
|
||||
}
|
||||
|
||||
drawText(textX
|
||||
|
@ -1532,6 +1535,11 @@ struct Imgui
|
|||
, titles[ii]
|
||||
, textColor
|
||||
);
|
||||
|
||||
if (res)
|
||||
{
|
||||
selected = ii;
|
||||
}
|
||||
}
|
||||
|
||||
return selected;
|
||||
|
|
Loading…
Reference in a new issue