diff --git a/src/GUIStuff/Elements/RotateWheel.cpp b/src/GUIStuff/Elements/RotateWheel.cpp index 5ec2d8d..d307890 100644 --- a/src/GUIStuff/Elements/RotateWheel.cpp +++ b/src/GUIStuff/Elements/RotateWheel.cpp @@ -3,7 +3,7 @@ namespace GUIStuff { -constexpr float WHEEL_WIDTH = 10.0f; +constexpr float WHEEL_WIDTH = 13.0f; constexpr double ROTATE_BAR_SNAP_DISTANCE = 0.3; constexpr double ROTATE_BAR_SNAP_DISTRIBUTION = std::numbers::pi * 0.25; diff --git a/src/GUIStuff/Elements/SelectableButton.cpp b/src/GUIStuff/Elements/SelectableButton.cpp index d41fdfa..96bb189 100644 --- a/src/GUIStuff/Elements/SelectableButton.cpp +++ b/src/GUIStuff/Elements/SelectableButton.cpp @@ -4,12 +4,17 @@ namespace GUIStuff { void SelectableButton::update(UpdateInputData& io, DrawType drawType, const std::function& elemUpdate, bool isSelected) { - bool hasBorders = selection.held || ((isSelected || selection.hovered) && drawType == DrawType::TRANSPARENT_BORDER); - - SkColor4f borderColor = hasBorders ? io.theme->fillColor1 : SkColor4f{0.0f, 0.0f, 0.0f, 0.0f}; + SkColor4f borderColor; SkColor4f backgroundColorHighlight; SkColor4f backgroundColor; + if(selection.held || ((isSelected || selection.hovered) && drawType == DrawType::TRANSPARENT_BORDER)) + borderColor = io.theme->fillColor1; + else if(drawType == DrawType::TRANSPARENT_BORDER) + borderColor = io.theme->backColor2; + else + borderColor = SkColor4f{0.0f, 0.0f, 0.0f, 0.0f}; + if(isSelected) backgroundColorHighlight = color_mul_alpha(io.theme->fillColor1, 0.4f); else if(selection.hovered || selection.held) diff --git a/src/GUIStuff/Elements/TextBox.hpp b/src/GUIStuff/Elements/TextBox.hpp index f03c7df..7836bfa 100644 --- a/src/GUIStuff/Elements/TextBox.hpp +++ b/src/GUIStuff/Elements/TextBox.hpp @@ -21,7 +21,7 @@ template class TextBox : public Element { CLAY({ .layout = { - .sizing = {.width = CLAY_SIZING_GROW(static_cast(io.fontSize * 2)), .height = CLAY_SIZING_GROW(static_cast(io.fontSize * 1.25f))} + .sizing = {.width = CLAY_SIZING_GROW(static_cast(io.fontSize * 2)), .height = singleLine ? CLAY_SIZING_FIXED(static_cast(io.fontSize * 1.25f)) : CLAY_SIZING_GROW(static_cast(io.fontSize * 1.25f))} }, .custom = { .customData = this } }) { diff --git a/src/GUIStuff/GUIManager.cpp b/src/GUIStuff/GUIManager.cpp index 8475b0b..eaa3841 100644 --- a/src/GUIStuff/GUIManager.cpp +++ b/src/GUIStuff/GUIManager.cpp @@ -545,7 +545,7 @@ void GUIManager::dropdown_select(const std::string& id, size_t* val, const std:: CLAY({.layout = {.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0)}}}) {} CLAY({ .layout = { - .sizing = {.width = CLAY_SIZING_FIT(20), .height = CLAY_SIZING_FIT(20)} + .sizing = {.width = CLAY_SIZING_FIT(SMALL_BUTTON_SIZE), .height = CLAY_SIZING_FIT(SMALL_BUTTON_SIZE)} } }) { svg_icon("dropico", "data/icons/droparrow.svg", dropDownOpen); diff --git a/src/Toolbar.cpp b/src/Toolbar.cpp index b1fdd7d..a8043af 100644 --- a/src/Toolbar.cpp +++ b/src/Toolbar.cpp @@ -719,7 +719,7 @@ void Toolbar::grid_menu(bool justOpened) { gui.input_text("grid text input", &gridMenu.newName, [&](GUIStuff::SelectionHelper& s) { addByEnter = s.selected && io->key.enter; }); - if(gui.svg_icon_button("grid add button", "data/icons/plus.svg", false, 25.0f) || (addByEnter && !gridMenu.newName.empty())) { + if(gui.svg_icon_button("grid add button", "data/icons/plus.svg", false, GUIStuff::GUIManager::SMALL_BUTTON_SIZE) || (addByEnter && !gridMenu.newName.empty())) { main.world->drawProg.modify_grid(main.world->gridMan.add_default_grid(gridMenu.newName)); stop_displaying_grid_menu(); } @@ -805,7 +805,7 @@ void Toolbar::bookmark_menu(bool justOpened) { addByEnter = s.selected && io->key.enter; }); if(!bookmarkExists) { - if((gui.svg_icon_button("bookmark add button", "data/icons/plus.svg", false, 25.0f) || addByEnter) && !bookMenu.newName.empty()) + if((gui.svg_icon_button("bookmark add button", "data/icons/plus.svg", false, GUIStuff::GUIManager::SMALL_BUTTON_SIZE) || addByEnter) && !bookMenu.newName.empty()) main.world->bMan.add_bookmark(bookMenu.newName); } }); @@ -1015,7 +1015,7 @@ void Toolbar::drawing_program_gui() { if(colorLeft) { CLAY({ .layout = { - .sizing = {.width = CLAY_SIZING_FIT(250), .height = CLAY_SIZING_FIT(0)}, + .sizing = {.width = CLAY_SIZING_FIT(300), .height = CLAY_SIZING_FIT(0)}, .padding = CLAY_PADDING_ALL(io->theme->padding1), .childGap = io->theme->childGap1, .childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP}, @@ -1040,7 +1040,7 @@ void Toolbar::drawing_program_gui() { if(colorRight) { CLAY({ .layout = { - .sizing = {.width = CLAY_SIZING_FIT(250), .height = CLAY_SIZING_FIT(0)}, + .sizing = {.width = CLAY_SIZING_FIT(300), .height = CLAY_SIZING_FIT(0)}, .padding = CLAY_PADDING_ALL(io->theme->padding1), .childGap = io->theme->childGap1, .childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP},