More improvements to GUI
This commit is contained in:
parent
30f7856815
commit
86e0999a5c
11 changed files with 72 additions and 91 deletions
|
|
@ -191,14 +191,13 @@ void DrawingProgram::toolbar_gui() {
|
|||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIT(0), .height = CLAY_SIZING_FIT(0)},
|
||||
.padding = CLAY_PADDING_ALL(t.io->theme->padding1),
|
||||
.padding = CLAY_PADDING_ALL(static_cast<uint16_t>(t.io->theme->padding1 / 2)),
|
||||
.childGap = static_cast<uint16_t>(t.io->theme->childGap1 / 2),
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP},
|
||||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(t.io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(t.io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(t.io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(t.io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(t.io->theme->windowCorners1)
|
||||
}) {
|
||||
t.gui.obstructing_window();
|
||||
if(t.gui.svg_icon_button_transparent("Brush Toolbar Button", "data/icons/brush.svg", drawTool->get_type() == DrawingProgramToolType::BRUSH)) { switch_to_tool(DrawingProgramToolType::BRUSH); }
|
||||
|
|
@ -237,8 +236,7 @@ void DrawingProgram::tool_options_gui() {
|
|||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(t.io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(t.io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(t.io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(t.io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(t.io->theme->windowCorners1)
|
||||
}) {
|
||||
t.gui.obstructing_window();
|
||||
drawTool->gui_toolbox();
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ void ScreenshotTool::draw(SkCanvas* canvas, const DrawData& drawData) {
|
|||
|
||||
path1.setFillType(SkPathFillType::kWinding);
|
||||
SkPaint paint2;
|
||||
paint2.setColor4f({0.0f, 0.0f, 0.0f, 0.9f});
|
||||
paint2.setColor4f({1.0f, 1.0f, 1.0f, 0.9f});
|
||||
paint2.setStyle(SkPaint::kStroke_Style);
|
||||
canvas->drawPath(path1, paint2);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace GUIStuff {
|
|||
std::shared_ptr<Theme> get_default_dark_mode() {
|
||||
std::shared_ptr<Theme> theme(std::make_shared<Theme>());
|
||||
theme->fillColor1 = {0.65f, 0.64f, 1.0f, 1.0f};
|
||||
theme->fillColor2 = {0.31f, 0.31f, 0.48f, 1.0f};
|
||||
theme->fillColor2 = {0.6f, 0.6f, 0.785f, 1.0f};
|
||||
theme->backColor1 = {0.156f, 0.156f, 0.18f, 1.0f};
|
||||
theme->backColor2 = {0.24f, 0.24f, 0.29f, 1.0f};
|
||||
theme->frontColor1 = {0.87f, 0.87f, 0.87f, 1.0f};
|
||||
|
|
|
|||
|
|
@ -62,9 +62,8 @@ struct Theme {
|
|||
uint16_t childGap1 = 10;
|
||||
uint16_t padding1 = 8;
|
||||
float windowCorners1 = 8;
|
||||
uint16_t windowBorders1 = 0;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Theme, fillColor1, fillColor2, backColor1, backColor2, frontColor1, frontColor2, hoverExpandTime, childGap1, padding1, windowCorners1, windowBorders1)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Theme, fillColor1, fillColor2, backColor1, backColor2, frontColor1, frontColor2, errorColor, warningColor, hoverExpandTime, childGap1, padding1, windowCorners1)
|
||||
};
|
||||
|
||||
std::shared_ptr<Theme> get_default_dark_mode();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "MovableTabList.hpp"
|
||||
#include "Helpers/ConvertVec.hpp"
|
||||
#include "../GUIManager.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace GUIStuff {
|
||||
|
|
@ -15,7 +16,7 @@ void MovableTabList::update(UpdateInputData& io, const std::vector<std::pair<std
|
|||
}
|
||||
|
||||
CLAY({.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIXED(35)},
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIXED(GUIStuff::GUIManager::BIG_BUTTON_SIZE)},
|
||||
.padding = CLAY_PADDING_ALL(0),
|
||||
.childGap = 4,
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER },
|
||||
|
|
@ -28,7 +29,7 @@ void MovableTabList::update(UpdateInputData& io, const std::vector<std::pair<std
|
|||
elemUpdate();
|
||||
for(size_t i = 0; i < buttons.size(); i++) {
|
||||
CLAY({.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIT(250), .height = CLAY_SIZING_GROW(0)},
|
||||
.sizing = {.width = CLAY_SIZING_FIT(200), .height = CLAY_SIZING_GROW(0)},
|
||||
}
|
||||
}) {
|
||||
buttons[i].update(io, SelectableButton::DrawType::FILLED, [&](SelectionHelper& s, bool iS) {
|
||||
|
|
@ -42,7 +43,7 @@ void MovableTabList::update(UpdateInputData& io, const std::vector<std::pair<std
|
|||
}) {
|
||||
if(!tabNames[i].first.empty()) {
|
||||
CLAY({.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(25), .height = CLAY_SIZING_FIXED(25)},
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(GUIStuff::GUIManager::SMALL_BUTTON_SIZE), .height = CLAY_SIZING_FIXED(GUIStuff::GUIManager::SMALL_BUTTON_SIZE)},
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_CENTER },
|
||||
.layoutDirection = CLAY_LEFT_TO_RIGHT
|
||||
}
|
||||
|
|
@ -55,7 +56,7 @@ void MovableTabList::update(UpdateInputData& io, const std::vector<std::pair<std
|
|||
selectedTab = i;
|
||||
CLAY({.layout = {.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0)}}}) {}
|
||||
CLAY({.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(25), .height = CLAY_SIZING_FIXED(25)},
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(GUIStuff::GUIManager::SMALL_BUTTON_SIZE), .height = CLAY_SIZING_FIXED(GUIStuff::GUIManager::SMALL_BUTTON_SIZE)},
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_CENTER },
|
||||
.layoutDirection = CLAY_LEFT_TO_RIGHT
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,9 +99,9 @@ void PaintCircleMenu::draw_rotate_bar(SkCanvas* canvas, UpdateInputData& io) {
|
|||
if(rotateBarSelect.held)
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor1);
|
||||
else if(rotateBarSelect.hovered)
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor1);
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor2);
|
||||
else
|
||||
rotateBarHolderFill.setColor4f(io.theme->frontColor2);
|
||||
rotateBarHolderFill.setColor4f(io.theme->frontColor1);
|
||||
float rotateBarHolderRadius = (CIRCLE_END - ROTATE_START) / 2.0f;
|
||||
Vector2f rotateBarHolderPos{std::cos(rotationAngle) * rotateBarMiddleRadius, -std::sin(rotationAngle) * rotateBarMiddleRadius};
|
||||
canvas->drawCircle(rotateBarHolderPos.x(), rotateBarHolderPos.y(), rotateBarHolderRadius, rotateBarHolderFill);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace GUIStuff {
|
||||
|
||||
constexpr float WHEEL_WIDTH = 15.0f;
|
||||
constexpr float WHEEL_WIDTH = 10.0f;
|
||||
|
||||
constexpr double ROTATE_BAR_SNAP_DISTANCE = 0.3;
|
||||
constexpr double ROTATE_BAR_SNAP_DISTRIBUTION = std::numbers::pi * 0.25;
|
||||
|
|
@ -75,7 +75,7 @@ void RotateWheel::draw_rotate_wheel(SkCanvas* canvas, UpdateInputData& io) {
|
|||
for(double snapPos = 0.0; snapPos < std::numbers::pi * 2.0; snapPos += ROTATE_BAR_SNAP_DISTRIBUTION) {
|
||||
Vector2f lineDir{std::cos(snapPos), -std::sin(snapPos)};
|
||||
SkPaint p(snapPos == 0.0 ? io.theme->fillColor1 : io.theme->frontColor2);
|
||||
p.setStrokeWidth(2.0f);
|
||||
p.setStrokeWidth(1.0f);
|
||||
canvas->drawLine(lineDir.x() * wheelStart, lineDir.y() * wheelStart, lineDir.x() * wheelEnd, lineDir.y() * wheelEnd, p);
|
||||
}
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ void RotateWheel::draw_rotate_wheel(SkCanvas* canvas, UpdateInputData& io) {
|
|||
if(selection.held)
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor1);
|
||||
else if(selection.hovered)
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor1);
|
||||
rotateBarHolderFill.setColor4f(io.theme->fillColor2);
|
||||
else
|
||||
rotateBarHolderFill.setColor4f(io.theme->frontColor2);
|
||||
float rotateBarHolderRadius = (wheelEnd - wheelStart) / 2.0f;
|
||||
|
|
@ -97,7 +97,7 @@ void RotateWheel::draw_rotate_wheel(SkCanvas* canvas, UpdateInputData& io) {
|
|||
|
||||
SkPaint rotateBarOutline(io.theme->frontColor2);
|
||||
rotateBarOutline.setStroke(true);
|
||||
rotateBarOutline.setStrokeWidth(2.0f);
|
||||
rotateBarOutline.setStrokeWidth(1.0f);
|
||||
canvas->drawCircle(0.0f, 0.0f, wheelStart, rotateBarOutline);
|
||||
canvas->drawCircle(0.0f, 0.0f, wheelEnd, rotateBarOutline);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ void GUIManager::draw(SkCanvas* canvas) {
|
|||
}
|
||||
case CLAY_RENDER_COMMAND_TYPE_SCISSOR_START: {
|
||||
canvas->save();
|
||||
SkRect clipRect = SkRect::MakeXYWH(bb.x, bb.y, bb.width, bb.height);
|
||||
SkRect clipRect = SkRect::MakeXYWH(bb.x - 1.0f, bb.y - 1.0f, bb.width + 1.0f, bb.height + 1.0f);
|
||||
canvas->clipRect(clipRect);
|
||||
break;
|
||||
}
|
||||
|
|
@ -241,7 +241,7 @@ void GUIManager::top_to_bottom_window_popup_layout(Clay_SizingAxis x, Clay_Sizin
|
|||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(10),
|
||||
.floating = { .attachTo = CLAY_ATTACH_TO_PARENT },
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(2)}
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->fillColor2), .width = CLAY_BORDER_OUTSIDE(1)}
|
||||
}) {
|
||||
if(Clay_Hovered())
|
||||
io->hoverObstructed = true;
|
||||
|
|
@ -556,10 +556,8 @@ void GUIManager::dropdown_select(const std::string& id, size_t* val, const std::
|
|||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(width), .height = CLAY_SIZING_FIT(0)},
|
||||
.padding = {.left = 2, .right = 2},
|
||||
.childAlignment = {.x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_TOP},
|
||||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(4),
|
||||
.floating = {
|
||||
.offset = {
|
||||
|
|
@ -572,35 +570,44 @@ void GUIManager::dropdown_select(const std::string& id, size_t* val, const std::
|
|||
.attachTo = CLAY_ATTACH_TO_PARENT
|
||||
},
|
||||
.border = {
|
||||
.color = convert_vec4<Clay_Color>(io->theme->backColor2),
|
||||
.width = CLAY_BORDER_OUTSIDE(4)
|
||||
.color = convert_vec4<Clay_Color>(io->theme->fillColor2),
|
||||
.width = CLAY_BORDER_OUTSIDE(1)
|
||||
}
|
||||
}) {
|
||||
obstructing_window();
|
||||
for(size_t i = 0; i < selections.size(); i++) {
|
||||
bool selectedEntry = *val == i;
|
||||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0)},
|
||||
},
|
||||
}) {
|
||||
SkColor4f entryColor;
|
||||
if(selectedEntry)
|
||||
entryColor = io->theme->backColor2;
|
||||
else if(Clay_Hovered())
|
||||
entryColor = io->theme->backColor2;
|
||||
else
|
||||
entryColor = io->theme->backColor1;
|
||||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0)},
|
||||
.childAlignment = {.x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_TOP},
|
||||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
}
|
||||
}) {
|
||||
for(size_t i = 0; i < selections.size(); i++) {
|
||||
bool selectedEntry = *val == i;
|
||||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0)},
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0)}
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(entryColor)
|
||||
}) {
|
||||
text_label(selections[i]);
|
||||
if(io->mouse.leftClick && Clay_Hovered()) {
|
||||
*val = i;
|
||||
dropDownOpen = false;
|
||||
SkColor4f entryColor;
|
||||
if(selectedEntry)
|
||||
entryColor = io->theme->backColor2;
|
||||
else if(Clay_Hovered())
|
||||
entryColor = io->theme->backColor2;
|
||||
else
|
||||
entryColor = io->theme->backColor1;
|
||||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0)},
|
||||
.padding = {.left = 2, .right = 2},
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(entryColor)
|
||||
}) {
|
||||
text_label(selections[i]);
|
||||
if(io->mouse.leftClick && Clay_Hovered()) {
|
||||
*val = i;
|
||||
dropDownOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -677,7 +684,7 @@ void GUIManager::scroll_bar_area(const std::string& uniqueId, const std::functio
|
|||
if(sD.isMoving)
|
||||
scrollerColor = io->theme->fillColor1;
|
||||
else if(Clay_Hovered())
|
||||
scrollerColor = io->theme->fillColor1;
|
||||
scrollerColor = io->theme->fillColor2;
|
||||
else
|
||||
scrollerColor = io->theme->backColor2;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace GUIStuff {
|
|||
class GUIManager {
|
||||
public:
|
||||
constexpr static float BIG_BUTTON_SIZE = 30;
|
||||
constexpr static float SMALL_BUTTON_SIZE = 20;
|
||||
|
||||
struct ElementContainer {
|
||||
std::unique_ptr<Element> elem;
|
||||
|
|
|
|||
|
|
@ -404,14 +404,13 @@ void Toolbar::top_toolbar() {
|
|||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_FIT(0) },
|
||||
.padding = CLAY_PADDING_ALL(io->theme->padding1),
|
||||
.padding = CLAY_PADDING_ALL(static_cast<uint16_t>(io->theme->padding1 / 2)),
|
||||
.childGap = static_cast<uint16_t>(io->theme->childGap1 / 2),
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_LEFT, .y = CLAY_ALIGN_Y_CENTER},
|
||||
.layoutDirection = CLAY_LEFT_TO_RIGHT
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1)
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.push_id("menu top toolbar");
|
||||
|
|
@ -469,8 +468,7 @@ void Toolbar::top_toolbar() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_LEFT_TOP, .parent = CLAY_ATTACH_POINT_LEFT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.offset = {.x = 0, .y = static_cast<float>(io->theme->padding1)}, .attachPoints = {.element = CLAY_ATTACH_POINT_LEFT_TOP, .parent = CLAY_ATTACH_POINT_LEFT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
if(gui.text_button_left_transparent("new file local", "New File")) {
|
||||
|
|
@ -554,8 +552,7 @@ void Toolbar::web_version_welcome() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.push_id("web version welcome gui");
|
||||
|
|
@ -628,8 +625,7 @@ void Toolbar::update_notification_gui() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.push_id("update notification gui");
|
||||
|
|
@ -661,8 +657,7 @@ void Toolbar::grid_menu(bool justOpened) {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.offset = {.x = 0, .y = static_cast<float>(io->theme->padding1)}, .attachPoints = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.text_label_centered("Grids");
|
||||
|
|
@ -755,8 +750,7 @@ void Toolbar::bookmark_menu(bool justOpened) {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.offset = {.x = 0, .y = static_cast<float>(io->theme->padding1)}, .attachPoints = {.element = CLAY_ATTACH_POINT_RIGHT_TOP, .parent = CLAY_ATTACH_POINT_RIGHT_BOTTOM}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
float entryHeight = 25.0f;
|
||||
|
|
@ -987,8 +981,7 @@ void Toolbar::global_log() {
|
|||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(color_mul_alpha(io->theme->backColor1, a)),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(color_mul_alpha(io->theme->backColor2, a)), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1)
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
SkColor4f c{0, 0, 0, 0};
|
||||
|
|
@ -1029,8 +1022,7 @@ void Toolbar::drawing_program_gui() {
|
|||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1)
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.color_picker_items("colorpickerleft", colorLeft, true);
|
||||
|
|
@ -1055,8 +1047,7 @@ void Toolbar::drawing_program_gui() {
|
|||
.layoutDirection = CLAY_TOP_TO_BOTTOM
|
||||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1)
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.color_picker_items("colorpickerright", colorRight, true);
|
||||
|
|
@ -1204,8 +1195,7 @@ void Toolbar::player_list() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.push_id("client list");
|
||||
|
|
@ -1294,8 +1284,7 @@ void Toolbar::options_menu() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
if(optionsMenuType == HOST_MENU) {
|
||||
|
|
@ -1350,8 +1339,7 @@ void Toolbar::options_menu() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.push_id("gsettings");
|
||||
CLAY({
|
||||
|
|
@ -1375,7 +1363,6 @@ void Toolbar::options_menu() {
|
|||
}) {
|
||||
auto oldOption = generalSettingsOptions;
|
||||
if(gui.text_button_left_transparent("Generalbutton", "General", generalSettingsOptions == GSETTINGS_GENERAL)) generalSettingsOptions = GSETTINGS_GENERAL;
|
||||
if(gui.text_button_left_transparent("Appearancebutton", "Appearance", generalSettingsOptions == GSETTINGS_APPEARANCE)) generalSettingsOptions = GSETTINGS_APPEARANCE;
|
||||
if(gui.text_button_left_transparent("Tabletbutton", "Tablet", generalSettingsOptions == GSETTINGS_TABLET)) generalSettingsOptions = GSETTINGS_TABLET;
|
||||
if(gui.text_button_left_transparent("Themebutton", "Theme", generalSettingsOptions == GSETTINGS_THEME)) generalSettingsOptions = GSETTINGS_THEME;
|
||||
if(gui.text_button_left_transparent("Keybindsbutton", "Keybinds", generalSettingsOptions == GSETTINGS_KEYBINDS)) generalSettingsOptions = GSETTINGS_KEYBINDS;
|
||||
|
|
@ -1420,11 +1407,6 @@ void Toolbar::options_menu() {
|
|||
gui.checkbox_field("flip zoom tool direction", "Flip zoom tool direction", &flipZoomToolDirection);
|
||||
gui.input_scalar_field("jump transition time", "Jump transition time", &jumpTransitionTime, 0.01f, 1000.0f, 2);
|
||||
gui.checkbox_field("changebrushwidthwithspeed", "Change brush size with mouse speed", &velocityAffectsBrushWidth);
|
||||
gui.pop_id();
|
||||
break;
|
||||
}
|
||||
case GSETTINGS_APPEARANCE: {
|
||||
gui.push_id("appearance settings");
|
||||
gui.input_scalar_field("Max GUI Scale", "Max GUI Scale", &guiScale, 0.5f, 3.0f, 1);
|
||||
gui.pop_id();
|
||||
break;
|
||||
|
|
@ -1505,7 +1487,6 @@ void Toolbar::options_menu() {
|
|||
gui.input_scalar_field<uint16_t>("childGap1", "Gap between child elements", &io->theme->childGap1, 0, 30);
|
||||
gui.input_scalar_field<uint16_t>("padding1", "Window padding", &io->theme->padding1, 0, 30);
|
||||
gui.slider_scalar_field<float>("windowCorners1", "Window corner radius", &io->theme->windowCorners1, 0, 30);
|
||||
gui.input_scalar_field<uint16_t>("windowBorders1", "Window border thickness", &io->theme->windowBorders1, 0, 20);
|
||||
gui.pop_id();
|
||||
break;
|
||||
}
|
||||
|
|
@ -1588,8 +1569,7 @@ void Toolbar::options_menu() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.push_id("lobby info menu");
|
||||
gui.obstructing_window();
|
||||
|
|
@ -1621,8 +1601,7 @@ void Toolbar::options_menu() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.push_id("canvas settings menu");
|
||||
gui.obstructing_window();
|
||||
|
|
@ -1646,8 +1625,7 @@ void Toolbar::options_menu() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.push_id("set download name menu");
|
||||
gui.obstructing_window();
|
||||
|
|
@ -1676,7 +1654,7 @@ void Toolbar::options_menu() {
|
|||
void Toolbar::about_menu_gui() {
|
||||
CLAY({
|
||||
.layout = {
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(850), .height = CLAY_SIZING_FIXED(600) },
|
||||
.sizing = {.width = CLAY_SIZING_FIXED(700), .height = CLAY_SIZING_FIXED(600) },
|
||||
.padding = CLAY_PADDING_ALL(io->theme->padding1),
|
||||
.childGap = io->theme->childGap1,
|
||||
.childAlignment = { .x = CLAY_ALIGN_X_CENTER, .y = CLAY_ALIGN_Y_TOP},
|
||||
|
|
@ -1684,8 +1662,7 @@ void Toolbar::about_menu_gui() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.push_id("about menu popup");
|
||||
gui.obstructing_window();
|
||||
|
|
@ -1772,8 +1749,7 @@ void Toolbar::file_picker_gui() {
|
|||
},
|
||||
.backgroundColor = convert_vec4<Clay_Color>(io->theme->backColor1),
|
||||
.cornerRadius = CLAY_CORNER_RADIUS(io->theme->windowCorners1),
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT},
|
||||
.border = {.color = convert_vec4<Clay_Color>(io->theme->backColor2), .width = CLAY_BORDER_OUTSIDE(io->theme->windowBorders1)}
|
||||
.floating = {.attachPoints = {.element = CLAY_ATTACH_POINT_CENTER_CENTER, .parent = CLAY_ATTACH_POINT_CENTER_CENTER}, .attachTo = CLAY_ATTACH_TO_PARENT}
|
||||
}) {
|
||||
gui.obstructing_window();
|
||||
gui.text_label_centered(filePicker.filePickerWindowName);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,6 @@ class Toolbar {
|
|||
} optionsMenuType;
|
||||
enum GeneralSettingsOptions {
|
||||
GSETTINGS_GENERAL = 0,
|
||||
GSETTINGS_APPEARANCE,
|
||||
GSETTINGS_TABLET,
|
||||
GSETTINGS_THEME,
|
||||
GSETTINGS_KEYBINDS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue