From 15f0d47ee0f0643c40ba743e197ac684b4599c0d Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 21 Jul 2024 16:35:50 +0200 Subject: [PATCH] Adjust some theme colors --- SurrealEngine/EditorApp.cpp | 4 ++-- SurrealEngine/UI/Editor/Editor2DViewport.cpp | 6 +++--- SurrealEngine/UI/Editor/Editor3DViewport.cpp | 2 +- SurrealEngine/UI/Editor/EditorViewportFrame.cpp | 2 +- SurrealEngine/UI/Editor/EditorViewportHeader.cpp | 2 +- Thirdparty/ZWidget/src/core/theme.cpp | 2 +- Thirdparty/ZWidget/src/widgets/menubar/menubar.cpp | 2 +- Thirdparty/ZWidget/src/widgets/statusbar/statusbar.cpp | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SurrealEngine/EditorApp.cpp b/SurrealEngine/EditorApp.cpp index f78661b7..91a1f3e7 100644 --- a/SurrealEngine/EditorApp.cpp +++ b/SurrealEngine/EditorApp.cpp @@ -15,7 +15,7 @@ int EditorApp::main(Array args) auto backend = DisplayBackend::TryCreateBackend(); DisplayBackend::Set(std::move(backend)); InitWidgetResources(); - WidgetTheme::SetTheme(std::make_unique()); + WidgetTheme::SetTheme(std::make_unique()); try { @@ -29,7 +29,7 @@ int EditorApp::main(Array args) auto editorWindow = std::make_unique(); editorWindow->SetFrameGeometry(Rect::xywh(0.0, 0.0, 1024.0, 768.0)); - editorWindow->Show(); + editorWindow->ShowMaximized(); DisplayWindow::RunLoop(); } diff --git a/SurrealEngine/UI/Editor/Editor2DViewport.cpp b/SurrealEngine/UI/Editor/Editor2DViewport.cpp index 8bbcd961..191ef642 100644 --- a/SurrealEngine/UI/Editor/Editor2DViewport.cpp +++ b/SurrealEngine/UI/Editor/Editor2DViewport.cpp @@ -15,7 +15,7 @@ Editor2DViewport::~Editor2DViewport() void Editor2DViewport::OnPaint(Canvas* canvas) { - Colorf background(160 / 255.0f, 160 / 255.0f, 160 / 255.0f); + Colorf background = Colorf::fromRgba8(40, 40, 40); canvas->fillRect(Rect::xywh(0.0, 0.0, GetWidth(), GetHeight()), background); DrawGrid(canvas); if (engine && engine->Level) @@ -87,7 +87,7 @@ void Editor2DViewport::DrawNodeSurface(Canvas* canvas, BspNode* node) BspVert* v = &model->Vertices[node->VertPool]; - Colorf linecolor(80 / 255.0f, 80 / 255.0f, 220 / 255.0f); + Colorf linecolor = Colorf::fromRgba8(150, 150, 150); Point center(GetWidth() * 0.5, GetHeight() * 0.5); int numverts = node->NumVertices; @@ -106,7 +106,7 @@ void Editor2DViewport::DrawNodeSurface(Canvas* canvas, BspNode* node) void Editor2DViewport::DrawGrid(Canvas* canvas) { - Colorf linecolor(128 / 255.0f, 128 / 255.0f, 128 / 255.0f); + Colorf linecolor = Colorf::fromRgba8(75, 75, 75); Point center(GetWidth() * 0.5, GetHeight() * 0.5); for (double y = -32767.0; y < 32767.0; y += 1000.0) diff --git a/SurrealEngine/UI/Editor/Editor3DViewport.cpp b/SurrealEngine/UI/Editor/Editor3DViewport.cpp index eb25f510..01350bce 100644 --- a/SurrealEngine/UI/Editor/Editor3DViewport.cpp +++ b/SurrealEngine/UI/Editor/Editor3DViewport.cpp @@ -16,7 +16,7 @@ Editor3DViewport::~Editor3DViewport() void Editor3DViewport::OnPaint(Canvas* canvas) { - canvas->fillRect(Rect::xywh(0.0, 0.0, GetWidth(), GetHeight()), Colorf(40 / 255.0f, 40 / 255.0f, 40 / 255.0f)); + canvas->fillRect(Rect::xywh(0.0, 0.0, GetWidth(), GetHeight()), Colorf::fromRgba8(0, 0, 0)); if (!engine) return; diff --git a/SurrealEngine/UI/Editor/EditorViewportFrame.cpp b/SurrealEngine/UI/Editor/EditorViewportFrame.cpp index 15cc4b60..54e7bc03 100644 --- a/SurrealEngine/UI/Editor/EditorViewportFrame.cpp +++ b/SurrealEngine/UI/Editor/EditorViewportFrame.cpp @@ -64,7 +64,7 @@ void EditorViewportFrame::Set3DMode() void EditorViewportFrame::OnPaint(Canvas* canvas) { - Colorf bordercolor(200 / 255.0f, 200 / 255.0f, 200 / 255.0f); + Colorf bordercolor(80 / 255.0f, 80 / 255.0f, 80 / 255.0f); double headerHeight = 24.0; double w = GetWidth(); diff --git a/SurrealEngine/UI/Editor/EditorViewportHeader.cpp b/SurrealEngine/UI/Editor/EditorViewportHeader.cpp index e329ca7f..968616a5 100644 --- a/SurrealEngine/UI/Editor/EditorViewportHeader.cpp +++ b/SurrealEngine/UI/Editor/EditorViewportHeader.cpp @@ -19,5 +19,5 @@ void EditorViewportHeader::SetTitle(const std::string& title) void EditorViewportHeader::OnPaint(Canvas* canvas) { - canvas->drawText({ 7.0, 17.0 }, Colorf(0.0f, 0.0f, 0.0f), Title); + canvas->drawText({ 7.0, 17.0 }, Colorf::fromRgba8(226, 223, 219), Title); } diff --git a/Thirdparty/ZWidget/src/core/theme.cpp b/Thirdparty/ZWidget/src/core/theme.cpp index 78c84a06..bb1d5b2e 100644 --- a/Thirdparty/ZWidget/src/core/theme.cpp +++ b/Thirdparty/ZWidget/src/core/theme.cpp @@ -236,7 +236,7 @@ DarkWidgetTheme::DarkWidgetTheme() checkbox_label->SetColor("unchecked-outer-border-color", Colorf::fromRgba8(99, 99, 99)); checkbox_label->SetColor("unchecked-inner-border-color", Colorf::fromRgba8(51, 51, 51)); - menubar->SetColor("background-color", Colorf::fromRgba8(70, 70, 70)); + menubar->SetColor("background-color", Colorf::fromRgba8(33, 33, 33)); menubaritem->SetColor("color", Colorf::fromRgba8(226, 223, 219)); menubaritem->SetColor("hover", "background-color", Colorf::fromRgba8(78, 78, 78)); diff --git a/Thirdparty/ZWidget/src/widgets/menubar/menubar.cpp b/Thirdparty/ZWidget/src/widgets/menubar/menubar.cpp index aecf97fd..37353756 100644 --- a/Thirdparty/ZWidget/src/widgets/menubar/menubar.cpp +++ b/Thirdparty/ZWidget/src/widgets/menubar/menubar.cpp @@ -386,5 +386,5 @@ MenuItemSeparator::MenuItemSeparator(Widget* parent) : Widget(parent) void MenuItemSeparator::OnPaint(Canvas* canvas) { - canvas->fillRect(Rect::xywh(0.0, GridFitPoint(GetHeight() * 0.5), GetWidth(), GridFitSize(1.0)), Colorf::fromRgba8(200, 200, 200)); + canvas->fillRect(Rect::xywh(0.0, GridFitPoint(GetHeight() * 0.5), GetWidth(), GridFitSize(1.0)), Colorf::fromRgba8(75, 75, 75)); } diff --git a/Thirdparty/ZWidget/src/widgets/statusbar/statusbar.cpp b/Thirdparty/ZWidget/src/widgets/statusbar/statusbar.cpp index fd914298..667fb7f9 100644 --- a/Thirdparty/ZWidget/src/widgets/statusbar/statusbar.cpp +++ b/Thirdparty/ZWidget/src/widgets/statusbar/statusbar.cpp @@ -15,5 +15,5 @@ Statusbar::~Statusbar() void Statusbar::OnPaint(Canvas* canvas) { - canvas->drawText(Point(16.0, 21.0), Colorf::fromRgba8(0, 0, 0), "Command:"); + canvas->drawText(Point(16.0, 21.0), Colorf::fromRgba8(226, 223, 219), "Command:"); }