From 1bc20f0b1e8c668448d98f7aebbab61757c6dfa3 Mon Sep 17 00:00:00 2001 From: Molasses <60114762+MolassesLover@users.noreply.github.com> Date: Thu, 23 Mar 2023 21:12:00 +0100 Subject: [PATCH] Added Arctic Ice's 'Nord' theme (#653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added Arctic Ice's 'Nord' theme Updated the editor to have the 'Nord' theme as a theme option. Signed-off-by: MolassesLover <60114762+MolassesLover@users.noreply.github.com> * Fixed the knobs and sliders in the 'Nord' theme This commit adds the same check used for the 'Hacking' theme onto the 'Nord' theme, used to change `WIDGET_ID_SLIDER_KNOB_IDLE` and `WIDGET_ID_SCROLLBAR_KNOB_INACTIVE`. --------- Signed-off-by: MolassesLover <60114762+MolassesLover@users.noreply.github.com> Co-authored-by: Turánszki János --- Editor/Editor.cpp | 4 ++++ Editor/GeneralWindow.cpp | 18 ++++++++++++++++++ Editor/IconDefinitions.h | 1 + 3 files changed, 23 insertions(+) diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index ad3d9ac20..f3bbbf197 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -581,6 +581,10 @@ void EditorComponent::Load() { optionsWnd.generalWnd.themeCombo.SetSelected(3); } + else if (!theme.compare("Nord")) + { + optionsWnd.generalWnd.themeCombo.SetSelected(4); + } RenderPath2D::Load(); } diff --git a/Editor/GeneralWindow.cpp b/Editor/GeneralWindow.cpp index 7986cccb1..4b7fea751 100644 --- a/Editor/GeneralWindow.cpp +++ b/Editor/GeneralWindow.cpp @@ -256,6 +256,7 @@ void GeneralWindow::Create(EditorComponent* _editor) Bright, Soft, Hacking, + Nord, }; themeCombo.Create("Theme: "); @@ -264,6 +265,7 @@ void GeneralWindow::Create(EditorComponent* _editor) themeCombo.AddItem("Bright " ICON_BRIGHT, (uint64_t)Theme::Bright); themeCombo.AddItem("Soft " ICON_SOFT, (uint64_t)Theme::Soft); themeCombo.AddItem("Hacking " ICON_HACKING, (uint64_t)Theme::Hacking); + themeCombo.AddItem("Nord " ICON_NORD, (uint64_t)Theme::Nord); themeCombo.OnSelect([=](wi::gui::EventArgs args) { // Dark theme defaults: @@ -308,7 +310,17 @@ void GeneralWindow::Create(EditorComponent* _editor) theme.font.color = wi::Color(0, 200, 90, 255); theme.font.shadow_color = wi::Color::Shadow(); break; + case Theme::Nord: + editor->main->config.GetSection("options").Set("theme", "Nord"); + theme_color_idle = wi::Color(46, 52, 64, 255); + theme_color_focus = wi::Color(59, 66, 82, 255); + dark_point = wi::Color(46, 52, 64, 255); + theme.shadow_color = wi::Color(46, 52, 64, 200); + theme.font.color = wi::Color(236, 239, 244, 255); + theme.font.shadow_color = wi::Color::Shadow(); + break; } + editor->main->config.Commit(); theme.tooltipImage = theme.image; @@ -357,6 +369,12 @@ void GeneralWindow::Create(EditorComponent* _editor) gui.SetColor(wi::Color(0, 200, 90, 255), wi::gui::WIDGET_ID_SLIDER_KNOB_IDLE); gui.SetColor(wi::Color(0, 200, 90, 255), wi::gui::WIDGET_ID_SCROLLBAR_KNOB_INACTIVE); } + + if ((Theme)args.userdata == Theme::Nord) + { + gui.SetColor(wi::Color(136, 192, 208, 255), wi::gui::WIDGET_ID_SLIDER_KNOB_IDLE); + gui.SetColor(wi::Color(76, 86, 106, 255), wi::gui::WIDGET_ID_SCROLLBAR_KNOB_INACTIVE); + } // customize individual elements: editor->componentsWnd.materialWnd.textureSlotButton.SetColor(wi::Color::White(), wi::gui::IDLE); diff --git a/Editor/IconDefinitions.h b/Editor/IconDefinitions.h index 7913ac7bd..b17f971b8 100644 --- a/Editor/IconDefinitions.h +++ b/Editor/IconDefinitions.h @@ -71,3 +71,4 @@ #define ICON_BRIGHT ICON_FA_SUN #define ICON_SOFT ICON_FA_LEAF #define ICON_HACKING ICON_FA_COMPUTER +#define ICON_NORD ICON_FA_MOUNTAIN \ No newline at end of file