mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-01 19:59:17 -05:00
Update raygui.h
This commit is contained in:
10
src/raygui.h
10
src/raygui.h
@ -1475,7 +1475,7 @@ void GuiPanel(Rectangle bounds, const char *text)
|
|||||||
// NOTE: Using GuiToggle() for the TABS
|
// NOTE: Using GuiToggle() for the TABS
|
||||||
int GuiTabBar(Rectangle bounds, const char **text, int count, int *active)
|
int GuiTabBar(Rectangle bounds, const char **text, int count, int *active)
|
||||||
{
|
{
|
||||||
#define RAYGUI_TABBAR_ITEM_WIDTH 160
|
#define RAYGUI_TABBAR_ITEM_WIDTH 160
|
||||||
|
|
||||||
GuiState state = guiState;
|
GuiState state = guiState;
|
||||||
|
|
||||||
@ -2333,7 +2333,7 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i
|
|||||||
if (editMode)
|
if (editMode)
|
||||||
{
|
{
|
||||||
// NOTE: ValueBox internal text is always centered
|
// NOTE: ValueBox internal text is always centered
|
||||||
Rectangle cursor = { bounds.x + GetTextWidth(textValue)/2 + bounds.width/2 + 2, bounds.y + 2*GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4*GuiGetStyle(VALUEBOX, BORDER_WIDTH) };
|
Rectangle cursor = { bounds.x + GetTextWidth(textValue)/2 + bounds.width/2 + 1, bounds.y + 2*GuiGetStyle(VALUEBOX, BORDER_WIDTH), 4, bounds.height - 4*GuiGetStyle(VALUEBOX, BORDER_WIDTH) };
|
||||||
GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha));
|
GuiDrawRectangle(cursor, 0, BLANK, Fade(GetColor(GuiGetStyle(VALUEBOX, BORDER_COLOR_PRESSED)), guiAlpha));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3561,9 +3561,9 @@ void GuiLoadStyleDefault(void)
|
|||||||
GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT);
|
GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_RIGHT);
|
||||||
GuiSetStyle(TEXTBOX, TEXT_PADDING, 4);
|
GuiSetStyle(TEXTBOX, TEXT_PADDING, 4);
|
||||||
GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
GuiSetStyle(VALUEBOX, TEXT_PADDING, 4);
|
GuiSetStyle(VALUEBOX, TEXT_PADDING, 0);
|
||||||
GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(VALUEBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
GuiSetStyle(SPINNER, TEXT_PADDING, 4);
|
GuiSetStyle(SPINNER, TEXT_PADDING, 0);
|
||||||
GuiSetStyle(SPINNER, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(SPINNER, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
GuiSetStyle(STATUSBAR, TEXT_PADDING, 8);
|
GuiSetStyle(STATUSBAR, TEXT_PADDING, 8);
|
||||||
GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(STATUSBAR, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
@ -3830,7 +3830,7 @@ static Rectangle GetTextBounds(int control, Rectangle bounds)
|
|||||||
switch (control)
|
switch (control)
|
||||||
{
|
{
|
||||||
case COMBOBOX: bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_SPACING)); break;
|
case COMBOBOX: bounds.width -= (GuiGetStyle(control, COMBO_BUTTON_WIDTH) + GuiGetStyle(control, COMBO_BUTTON_SPACING)); break;
|
||||||
case VALUEBOX: break; // NOTE: ValueBox text value always centered, text padding applies to label
|
//case VALUEBOX: break; // NOTE: ValueBox text value always centered, text padding applies to label
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (GuiGetStyle(control, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) textBounds.x -= GuiGetStyle(control, TEXT_PADDING);
|
if (GuiGetStyle(control, TEXT_ALIGNMENT) == TEXT_ALIGN_RIGHT) textBounds.x -= GuiGetStyle(control, TEXT_PADDING);
|
||||||
|
|||||||
Reference in New Issue
Block a user