mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 02:33:19 +00:00
Update dependencies usages
This commit is contained in:
parent
4b2356facb
commit
049353e06a
7 changed files with 9 additions and 49 deletions
|
@ -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
|
||||
)
|
||||
|
||||
|
|
2
external/evalyte-cpp-common
vendored
2
external/evalyte-cpp-common
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 20e766badc8f400ac7db8487486b5e8990cefbbe
|
||||
Subproject commit a6c20732c5392148ba5381a53e01f9e59ad30830
|
2
external/selenite
vendored
2
external/selenite
vendored
|
@ -1 +1 @@
|
|||
Subproject commit ee661221544c754f96c586db9b4b45ae777ec4bc
|
||||
Subproject commit 75b7d7cce4a61ff93e7369ab32ac988ac16f69b0
|
|
@ -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));
|
||||
}
|
|
@ -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);
|
|
@ -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;
|
||||
|
|
|
@ -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<ui::Palette>(), palette.value());
|
||||
setSelenitePalette<slint::Color, selenite::Color>(
|
||||
mainWindow_->global<ui::Palette>(), palette.value()
|
||||
);
|
||||
}
|
||||
|
||||
bindSlintUtils(mainWindow_->global<ui::Utils>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue