Update dependencies usages

This commit is contained in:
Vyn 2025-07-02 18:43:33 +02:00
parent 4b2356facb
commit 049353e06a
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
7 changed files with 9 additions and 49 deletions

View file

@ -9,7 +9,6 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
add_executable(mirai add_executable(mirai
src/main.cpp src/main.cpp
src/windows/AppWindow/AppWindow.cpp src/windows/AppWindow/AppWindow.cpp
src/SeleniteSetup.cpp
src/shared/Utils.cpp src/shared/Utils.cpp
) )

@ -1 +1 @@
Subproject commit 20e766badc8f400ac7db8487486b5e8990cefbbe Subproject commit a6c20732c5392148ba5381a53e01f9e59ad30830

2
external/selenite vendored

@ -1 +1 @@
Subproject commit ee661221544c754f96c586db9b4b45ae777ec4bc Subproject commit 75b7d7cce4a61ff93e7369ab32ac988ac16f69b0

View file

@ -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));
}

View file

@ -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);

View file

@ -13,9 +13,9 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
evalyte::createRequiredDirectories("mirai"); evalyte::create_required_directories("mirai");
const auto configFilePath = evalyte::configDirectoryPath("mirai") + "/config.json"; const auto config_file_path = evalyte::config_directory_path("mirai") + "/config.json";
mirai::core mirai{configFilePath}; mirai::core mirai{config_file_path};
AppWindow appWindow{&mirai}; AppWindow appWindow{&mirai};
appWindow.run(); appWindow.run();
return 0; return 0;

View file

@ -5,7 +5,6 @@
*/ */
#include "AppWindow.h" #include "AppWindow.h"
#include "../../SeleniteSetup.h"
#include "../../shared/Utils.h" #include "../../shared/Utils.h"
#include "mirai-core/core.h" #include "mirai-core/core.h"
#include "mirai-core/date.h" #include "mirai-core/date.h"
@ -13,6 +12,7 @@
#include "mirai-core/markdown_data_provider.h" #include "mirai-core/markdown_data_provider.h"
#include "mirai-core/source.h" #include "mirai-core/source.h"
#include "selenite/palette.h" #include "selenite/palette.h"
#include "selenite/selenite.h"
#include "slint_color.h" #include "slint_color.h"
#include "slint_models.h" #include "slint_models.h"
#include "slint_string.h" #include "slint_string.h"
@ -47,7 +47,9 @@ AppWindow::AppWindow(mirai::core *miraiInstance) : miraiInstance_(miraiInstance)
const auto palette = selenite::parseJson(palettePath); const auto palette = selenite::parseJson(palettePath);
if (palette.has_value()) { if (palette.has_value()) {
std::println(std::cerr, "Warning, no {} found", palettePath); std::println(std::cerr, "Warning, no {} found", palettePath);
setSelenitePalette(mainWindow_->global<ui::Palette>(), palette.value()); setSelenitePalette<slint::Color, selenite::Color>(
mainWindow_->global<ui::Palette>(), palette.value()
);
} }
bindSlintUtils(mainWindow_->global<ui::Utils>()); bindSlintUtils(mainWindow_->global<ui::Utils>());