mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Some code tweaks
This commit is contained in:
@ -113,8 +113,11 @@ int main()
|
||||
|
||||
// First GUI column
|
||||
forceSquaredChecked = GuiCheckBox((Rectangle){ 25, 108, 15, 15 }, "Force Square", forceSquaredChecked);
|
||||
|
||||
GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);
|
||||
if (GuiSpinner((Rectangle){ 25, 135, 125, 30 }, &spinner001Value, 0, 100, spinnerEditMode)) spinnerEditMode = !spinnerEditMode;
|
||||
if (GuiValueBox((Rectangle){ 25, 175, 125, 30 }, &valueBox002Value, 0, 100, valueBoxEditMode)) valueBoxEditMode = !valueBoxEditMode;
|
||||
GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT);
|
||||
if (GuiTextBox((Rectangle){ 25, 215, 125, 30 }, textBoxText, 64, textBoxEditMode)) textBoxEditMode = !textBoxEditMode;
|
||||
|
||||
GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT);
|
||||
@ -154,7 +157,9 @@ int main()
|
||||
|
||||
Rectangle view = GuiScrollPanel((Rectangle){ 560, 25, 100, 160 }, (Rectangle){ 560, 25, 100, 400 }, &viewScroll);
|
||||
|
||||
GuiStatusBar((Rectangle){ 0, GetScreenHeight() - 20, GetScreenWidth(), 20 }, "This is a status bar.");
|
||||
GuiSetStyle(DEFAULT, INNER_PADDING, 10);
|
||||
GuiStatusBar((Rectangle){ 0, GetScreenHeight() - 20, GetScreenWidth(), 20 }, "This is a status bar");
|
||||
GuiSetStyle(DEFAULT, INNER_PADDING, 2);
|
||||
|
||||
//GuiEnable();
|
||||
GuiUnlock();
|
||||
|
||||
@ -1908,17 +1908,15 @@ RAYGUIDEF float GuiProgressBar(Rectangle bounds, const char *text, float value,
|
||||
|
||||
// Status Bar control
|
||||
RAYGUIDEF void GuiStatusBar(Rectangle bounds, const char *text)
|
||||
{
|
||||
#define STATUSBAR_TEXT_OFFSETX 10
|
||||
|
||||
GuiControlState state = guiState;
|
||||
{
|
||||
GuiControlState state = guiState;
|
||||
|
||||
// Draw control
|
||||
//--------------------------------------------------------------------
|
||||
DrawRectangleLinesEx(bounds, GuiGetStyle(DEFAULT, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED) ? BORDER_COLOR_NORMAL : 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, (state != GUI_STATE_DISABLED) ? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha));
|
||||
|
||||
GuiDrawText(text, bounds, GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha));
|
||||
GuiDrawText(text, GetTextBounds(DEFAULT, bounds), GUI_TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(DEFAULT, (state != GUI_STATE_DISABLED) ? TEXT_COLOR_NORMAL : TEXT_COLOR_DISABLED)), guiAlpha));
|
||||
//--------------------------------------------------------------------
|
||||
}
|
||||
|
||||
|
||||
@ -107,8 +107,8 @@ typedef enum {
|
||||
RICON_TARGET_MOVE_FILL,
|
||||
RICON_CURSOR_MOVE_FILL,
|
||||
RICON_CURSOR_SCALE_FILL,
|
||||
RICON_CURSOR_SCALE_RIGHT,
|
||||
RICON_CURSOR_SCALE_LEFT,
|
||||
RICON_CURSOR_SCALE_RIGHT_FILL,
|
||||
RICON_CURSOR_SCALE_LEFT_FILL,
|
||||
RICON_UNDO_FILL,
|
||||
RICON_REDO_FILL,
|
||||
RICON_REREDO_FILL,
|
||||
@ -248,7 +248,7 @@ void DrawIcon(int iconId, Vector2 position, int pixelSize, Color color);
|
||||
|
||||
#include "raylib.h" // Required for: Icons drawing function: DrawRectangle()
|
||||
|
||||
static unsigned int RICONS[1536] = {
|
||||
static const unsigned int RICONS[1536] = {
|
||||
0x40008000, 0x10002000, 0x04000800, 0x01000200, 0x00400080, 0x00100020, 0x00040008, 0x00010002, // RICON_NONE
|
||||
0x3ff80000, 0x2f082008, 0x2042207e, 0x40027fc2, 0x40024002, 0x40024002, 0x40024002, 0x00007ffe, // RICON_FOLDER_FILE_OPEN
|
||||
0x3ffe0000, 0x44226422, 0x400247e2, 0x5ffa4002, 0x57ea500a, 0x500a500a, 0x40025ffa, 0x00007ffe, // RICON_FILE_SAVE_CLASSIC
|
||||
|
||||
Reference in New Issue
Block a user