|
@@ -207,7 +207,7 @@ typedef enum {
|
|
TEXTBOX, // VALUEBOX, SPINNER
|
|
TEXTBOX, // VALUEBOX, SPINNER
|
|
LISTVIEW,
|
|
LISTVIEW,
|
|
COLORPICKER
|
|
COLORPICKER
|
|
-} GuiControl;
|
|
|
|
|
|
+} GuiControlStandard;
|
|
|
|
|
|
// Gui default properties for every control
|
|
// Gui default properties for every control
|
|
typedef enum {
|
|
typedef enum {
|
|
@@ -565,8 +565,7 @@ RAYGUIDEF int GuiGetStyle(int control, int property)
|
|
// Window Box control
|
|
// Window Box control
|
|
RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *text)
|
|
RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *text)
|
|
{
|
|
{
|
|
- #define WINDOWBOX_PADDING 2
|
|
|
|
- #define WINDOWBOX_BORDER_WIDTH 1
|
|
|
|
|
|
+ #define CLOSE_BUTTON_PADDING 2
|
|
|
|
|
|
GuiControlState state = guiState;
|
|
GuiControlState state = guiState;
|
|
bool clicked = false;
|
|
bool clicked = false;
|
|
@@ -601,34 +600,34 @@ RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *text)
|
|
{
|
|
{
|
|
case GUI_STATE_NORMAL:
|
|
case GUI_STATE_NORMAL:
|
|
{
|
|
{
|
|
- DrawRectangleLinesEx(bounds, WINDOWBOX_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
- DrawRectangleRec((Rectangle){ bounds.x + WINDOWBOX_BORDER_WIDTH, bounds.y + WINDOWBOX_BORDER_WIDTH, bounds.width - WINDOWBOX_BORDER_WIDTH*2, bounds.height - WINDOWBOX_BORDER_WIDTH*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleLinesEx(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
+ DrawRectangleRec((Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2, bounds.height - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
- DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + WINDOWBOX_PADDING*2, statusBar.y + 1 + WINDOWBOX_PADDING, 25 - WINDOWBOX_PADDING*3, statusBar.height - 2 - WINDOWBOX_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_NORMAL)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + CLOSE_BUTTON_PADDING*2, statusBar.y + 1 + CLOSE_BUTTON_PADDING, 25 - CLOSE_BUTTON_PADDING*3, statusBar.height - 2 - CLOSE_BUTTON_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_NORMAL)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_NORMAL)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_NORMAL)), guiAlpha));
|
|
} break;
|
|
} break;
|
|
case GUI_STATE_FOCUSED:
|
|
case GUI_STATE_FOCUSED:
|
|
{
|
|
{
|
|
- DrawRectangleLinesEx(bounds, WINDOWBOX_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
- DrawRectangleRec((Rectangle){ bounds.x + WINDOWBOX_BORDER_WIDTH, bounds.y + WINDOWBOX_BORDER_WIDTH, bounds.width - WINDOWBOX_BORDER_WIDTH*2, bounds.height - WINDOWBOX_BORDER_WIDTH*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleLinesEx(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
+ DrawRectangleRec((Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2, bounds.height - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
- DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + WINDOWBOX_PADDING*2, statusBar.y + 1 + WINDOWBOX_PADDING, 25 - WINDOWBOX_PADDING*3, statusBar.height - 2 - WINDOWBOX_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_FOCUSED)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + CLOSE_BUTTON_PADDING*2, statusBar.y + 1 + CLOSE_BUTTON_PADDING, 25 - CLOSE_BUTTON_PADDING*3, statusBar.height - 2 - CLOSE_BUTTON_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_FOCUSED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_FOCUSED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_FOCUSED)), guiAlpha));
|
|
} break;
|
|
} break;
|
|
case GUI_STATE_PRESSED:
|
|
case GUI_STATE_PRESSED:
|
|
{
|
|
{
|
|
- DrawRectangleLinesEx(bounds, WINDOWBOX_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
- DrawRectangleRec((Rectangle){ bounds.x + WINDOWBOX_BORDER_WIDTH, bounds.y + WINDOWBOX_BORDER_WIDTH, bounds.width - WINDOWBOX_BORDER_WIDTH*2, bounds.height - WINDOWBOX_BORDER_WIDTH*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleLinesEx(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_NORMAL)), guiAlpha));
|
|
|
|
+ DrawRectangleRec((Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2, bounds.height - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
- DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + WINDOWBOX_PADDING*2, statusBar.y + 1 + WINDOWBOX_PADDING, 25 - WINDOWBOX_PADDING*3, statusBar.height - 2 - WINDOWBOX_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_PRESSED)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + CLOSE_BUTTON_PADDING*2, statusBar.y + 1 + CLOSE_BUTTON_PADDING, 25 - CLOSE_BUTTON_PADDING*3, statusBar.height - 2 - CLOSE_BUTTON_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_PRESSED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_PRESSED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_PRESSED)), guiAlpha));
|
|
} break;
|
|
} break;
|
|
case GUI_STATE_DISABLED:
|
|
case GUI_STATE_DISABLED:
|
|
{
|
|
{
|
|
- DrawRectangleLinesEx(bounds, WINDOWBOX_BORDER_WIDTH, Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha));
|
|
|
|
- DrawRectangleRec((Rectangle){ bounds.x + WINDOWBOX_BORDER_WIDTH, bounds.y + WINDOWBOX_BORDER_WIDTH, bounds.width - WINDOWBOX_BORDER_WIDTH*2, bounds.height - WINDOWBOX_BORDER_WIDTH*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleLinesEx(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DEFAULT, BORDER_COLOR_DISABLED)), guiAlpha));
|
|
|
|
+ DrawRectangleRec((Rectangle){ bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), bounds.width - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2, bounds.height - GuiGetStyle(DEFAULT, BORDER_WIDTH)*2 }, Fade(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)), guiAlpha));
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
GuiStatusBar(statusBar, text, offsetX);
|
|
- DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + WINDOWBOX_PADDING*2, statusBar.y + 1 + WINDOWBOX_PADDING, 25 - WINDOWBOX_PADDING*3, statusBar.height - 2 - WINDOWBOX_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_DISABLED)), guiAlpha));
|
|
|
|
|
|
+ DrawRectangleRec((Rectangle){statusBar.x + statusBar.width - 27 + CLOSE_BUTTON_PADDING*2, statusBar.y + 1 + CLOSE_BUTTON_PADDING, 25 - CLOSE_BUTTON_PADDING*3, statusBar.height - 2 - CLOSE_BUTTON_PADDING*2}, Fade(GetColor(GuiGetStyle(DEFAULT, BASE_COLOR_DISABLED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_DISABLED)), guiAlpha));
|
|
GuiDrawText("x", statusBar.x + statusBar.width - 16, statusBar.y + statusBar.height/2 - GuiGetStyle(DEFAULT, TEXT_SIZE)/2, Fade(GetColor(GuiGetStyle(DEFAULT, TEXT_COLOR_DISABLED)), guiAlpha));
|
|
} break;
|
|
} break;
|
|
default: break;
|
|
default: break;
|