From 049353e06a7d000b22090d0f58384624b70002df Mon Sep 17 00:00:00 2001 From: Vyn Date: Wed, 2 Jul 2025 18:43:33 +0200 Subject: [PATCH] Update dependencies usages --- CMakeLists.txt | 1 - external/evalyte-cpp-common | 2 +- external/selenite | 2 +- src/SeleniteSetup.cpp | 28 ---------------------------- src/SeleniteSetup.h | 13 ------------- src/main.cpp | 6 +++--- src/windows/AppWindow/AppWindow.cpp | 6 ++++-- 7 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 src/SeleniteSetup.cpp delete mode 100644 src/SeleniteSetup.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b8f9f38..366e6f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) add_executable(mirai src/main.cpp src/windows/AppWindow/AppWindow.cpp - src/SeleniteSetup.cpp src/shared/Utils.cpp ) diff --git a/external/evalyte-cpp-common b/external/evalyte-cpp-common index 20e766b..a6c2073 160000 --- a/external/evalyte-cpp-common +++ b/external/evalyte-cpp-common @@ -1 +1 @@ -Subproject commit 20e766badc8f400ac7db8487486b5e8990cefbbe +Subproject commit a6c20732c5392148ba5381a53e01f9e59ad30830 diff --git a/external/selenite b/external/selenite index ee66122..75b7d7c 160000 --- a/external/selenite +++ b/external/selenite @@ -1 +1 @@ -Subproject commit ee661221544c754f96c586db9b4b45ae777ec4bc +Subproject commit 75b7d7cce4a61ff93e7369ab32ac988ac16f69b0 diff --git a/src/SeleniteSetup.cpp b/src/SeleniteSetup.cpp deleted file mode 100644 index f56f865..0000000 --- a/src/SeleniteSetup.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Mirai. Copyright (C) 2024 Vyn - * This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only) - * The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt - */ - -#include "SeleniteSetup.h" -#include "selenite/palette.h" - -slint::Color seleniteColorToSlint(const selenite::Color &color) -{ - return slint::Color::from_rgb_uint8(color.r, color.g, color.b); -} - -void setSelenitePalette(const ui::Palette &uiPalette, const selenite::Palette &palette) -{ - uiPalette.set_accent(seleniteColorToSlint(palette.primary)); - uiPalette.set_background(seleniteColorToSlint(palette.background)); - uiPalette.set_pane(seleniteColorToSlint(palette.pane)); - uiPalette.set_foreground(seleniteColorToSlint(palette.foreground)); - uiPalette.set_foreground_hint(seleniteColorToSlint(palette.foregroundHint)); - uiPalette.set_control_background(seleniteColorToSlint(palette.background3)); - uiPalette.set_control_foreground(seleniteColorToSlint(palette.foreground)); - uiPalette.set_card_background(seleniteColorToSlint(palette.background2)); - uiPalette.set_green(seleniteColorToSlint(palette.green)); - uiPalette.set_orange(seleniteColorToSlint(palette.orange)); - uiPalette.set_red(seleniteColorToSlint(palette.red)); -} diff --git a/src/SeleniteSetup.h b/src/SeleniteSetup.h deleted file mode 100644 index fbb085d..0000000 --- a/src/SeleniteSetup.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Mirai. Copyright (C) 2024 Vyn - * This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only) - * The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt - */ - -#pragma once - -#include "selenite/palette.h" -#include "ui.h" - -slint::Color seleniteColorToSlint(const selenite::Color &color); -void setSelenitePalette(const ui::Palette &uiPalette, const selenite::Palette &palette); diff --git a/src/main.cpp b/src/main.cpp index e5af5c8..6f2ab2c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,9 +13,9 @@ int main(int argc, char **argv) { - evalyte::createRequiredDirectories("mirai"); - const auto configFilePath = evalyte::configDirectoryPath("mirai") + "/config.json"; - mirai::core mirai{configFilePath}; + evalyte::create_required_directories("mirai"); + const auto config_file_path = evalyte::config_directory_path("mirai") + "/config.json"; + mirai::core mirai{config_file_path}; AppWindow appWindow{&mirai}; appWindow.run(); return 0; diff --git a/src/windows/AppWindow/AppWindow.cpp b/src/windows/AppWindow/AppWindow.cpp index 47c0076..a6041dd 100644 --- a/src/windows/AppWindow/AppWindow.cpp +++ b/src/windows/AppWindow/AppWindow.cpp @@ -5,7 +5,6 @@ */ #include "AppWindow.h" -#include "../../SeleniteSetup.h" #include "../../shared/Utils.h" #include "mirai-core/core.h" #include "mirai-core/date.h" @@ -13,6 +12,7 @@ #include "mirai-core/markdown_data_provider.h" #include "mirai-core/source.h" #include "selenite/palette.h" +#include "selenite/selenite.h" #include "slint_color.h" #include "slint_models.h" #include "slint_string.h" @@ -47,7 +47,9 @@ AppWindow::AppWindow(mirai::core *miraiInstance) : miraiInstance_(miraiInstance) const auto palette = selenite::parseJson(palettePath); if (palette.has_value()) { std::println(std::cerr, "Warning, no {} found", palettePath); - setSelenitePalette(mainWindow_->global(), palette.value()); + setSelenitePalette( + mainWindow_->global(), palette.value() + ); } bindSlintUtils(mainWindow_->global());