raygui 2.6 release

GuiLabelButton() - Small tweak
This commit is contained in:
Ray
2019-09-09 21:54:17 +02:00
parent 227805c4ef
commit a9744a2fab

View File

@ -1,11 +1,11 @@
/******************************************************************************************* /*******************************************************************************************
* *
* raygui v2.6-dev - A simple and easy-to-use immediate-mode gui library * raygui v2.6 - A simple and easy-to-use immediate-mode gui library
* *
* DESCRIPTION: * DESCRIPTION:
* *
* raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also possible * raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also
* to be used as a standalone library, as long as input and drawing functions are provided. * available as a standalone library, as long as input and drawing functions are provided.
* *
* Controls provided: * Controls provided:
* *
@ -71,9 +71,12 @@
* Enables advance GuiTextBox()implementation with text selection and copy/cut/paste support * Enables advance GuiTextBox()implementation with text selection and copy/cut/paste support
* *
* VERSIONS HISTORY: * VERSIONS HISTORY:
* 2.6 (25-Aug-2019) Redesigned GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox(), GuiTextInputBox() * 2.6 (09-Sep-2019) ADDED: GuiTextInputBox()
* Reviewed GuiTextBox*(), GuiSpinner(), GuiValueBox(), GuiLoadStyle() * REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox()
* REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle()
* Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties
* Added 8 new custom styles ready to use * Added 8 new custom styles ready to use
* Multiple minor tweaks and bugs corrected
* 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner() * 2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner()
* 2.3 (29-Apr-2019) Added rIcons auxiliar library and support for it, multiple controls reviewed * 2.3 (29-Apr-2019) Added rIcons auxiliar library and support for it, multiple controls reviewed
* Refactor all controls drawing mechanism to use control state * Refactor all controls drawing mechanism to use control state
@ -1139,6 +1142,10 @@ RAYGUIDEF bool GuiLabelButton(Rectangle bounds, const char *text)
GuiControlState state = guiState; GuiControlState state = guiState;
bool pressed = false; bool pressed = false;
// NOTE: We force bounds.width to be all text
int textWidth = MeasureTextEx(guiFont, text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)).x;
if (bounds.width < textWidth) bounds.width = textWidth;
// Update control // Update control
//-------------------------------------------------------------------- //--------------------------------------------------------------------
if ((state != GUI_STATE_DISABLED) && !guiLocked) if ((state != GUI_STATE_DISABLED) && !guiLocked)