feat:完成设置界面和主界面的参数配置

This commit is contained in:
2025-11-25 15:58:04 +08:00
parent b2350a3b35
commit 0ec07218ab
192 changed files with 1404 additions and 56345 deletions

107
main.cc
View File

@@ -1,15 +1,19 @@
#include "component.hh"
#include "modern-qt/utility/material-icon.hh"
#include "creeper-qt/utility/material-icon.hh"
#include "creeper-qt/utility/wrapper/mutable-value.hh"
#include "dlog/dlog.hh"
#include <qstandardpaths.h>
#include <modern-qt/core/application.hh>
#include <modern-qt/layout/linear.hh>
#include <modern-qt/layout/mixer.hh>
#include <modern-qt/layout/scroll.hh>
#include <modern-qt/utility/material-icon.hh>
#include <modern-qt/utility/theme/preset/blue-miku.hh>
#include <modern-qt/utility/theme/theme.hh>
#include <modern-qt/widget/cards/filled-card.hh>
#include <modern-qt/widget/main-window.hh>
#include <creeper-qt/core/application.hh>
#include <creeper-qt/layout/linear.hh>
#include <creeper-qt/layout/mixer.hh>
#include <creeper-qt/layout/scroll.hh>
#include <creeper-qt/utility/material-icon.hh>
#include <creeper-qt/utility/theme/preset/blue-miku.hh>
#include <creeper-qt/utility/theme/theme.hh>
#include <creeper-qt/widget/cards/filled-card.hh>
#include <creeper-qt/widget/main-window.hh>
#include <creeper-qt/layout/stacked.hh>
#include <qfontdatabase.h>
using namespace creeper;
@@ -17,6 +21,7 @@ using namespace creeper;
namespace lnpro = linear::pro;
namespace mwpro = main_window::pro;
namespace capro = card::pro;
namespace stpro = stacked::pro;
auto main(int argc, char *argv[]) -> int {
app::init {
@@ -25,20 +30,32 @@ auto main(int argc, char *argv[]) -> int {
app::pro::Complete {argc, argv},
};
auto stack_index = std::make_shared<MutableValue<int>>();
stack_index->set_silent(0);
auto manager = ThemeManager {kBlueMikuThemePack};
creeper::material::FontLoader::load_font();
auto nav_component_state = NavComponentState {
.manager = manager,
.switch_callback = [&](int index, const auto& name) {
qDebug() << "switch_callback index: " << index;
},
.buttons_context = {
{"0", material::icon::kTouchSensor},
{"1", material::icon::kStar},
{"2", material::icon::kFavorite},
{"1", material::icon::kPets},
{"2", material::icon::kSettings},
{"3", material::icon::kExtension},
{"4", material::icon::kLogout},
},
.stacked_callback = [&](int index) {
*stack_index = index;
}
};
auto setting_component_state = SettingComponentState {
.manager = manager,
};
auto hand_view_component_state = HandViewComponentState {
.manager = manager,
};
auto view_component_state = ViewComponentState {.manager = manager};
auto mask_window = (MixerMask*){};
@@ -47,10 +64,10 @@ auto main(int argc, char *argv[]) -> int {
},
// mwpro::FixedSize {1080, 720},
mwpro::MinimumSize {
1080,
720
},
// mwpro::MinimumSize {
// 1080,
// 720
// },
mwpro::Central<FilledCard> {
capro::ThemeManager {manager},
capro::Radius {0},
@@ -62,21 +79,48 @@ auto main(int argc, char *argv[]) -> int {
lnpro::Item {
NavComponent(nav_component_state),
},
lnpro::Item<Col> {
lnpro::ContentsMargin{{15, 15, 15, 15}},
},
lnpro::Item<Col> {
{255},
lnpro::ContentsMargin { { 5, 15, 15, 15 } },
lnpro::Item<ScrollArea> {
scroll::pro::ThemeManager { manager },
scroll::pro::HorizontalScrollBarPolicy {
Qt::ScrollBarAlwaysOff,
},
scroll::pro::Item {
ViewComponent(view_component_state),
},
lnpro::Item<Stacked> {
{0},
MutableForward {
stpro::CurrentIndex {1},
stack_index,
},
stpro::Item<Widget> {
capro::Layout<Col> {
lnpro::ContentsMargin {{5, 15, 15, 15}},
lnpro::Item<Col> {
// {255},
// lnpro::ContentsMargin {{5, 15, 15, 15}},
lnpro::Item<ScrollArea> {
scroll::pro::ThemeManager {manager},
scroll::pro::HorizontalScrollBarPolicy {
Qt::ScrollBarAlwaysOff
},
scroll::pro::Item {
ViewComponent(view_component_state),
},
},
},
},
},
stpro::Item<Widget> {
capro::Layout<Col> {
lnpro::ContentsMargin {{5, 15, 15, 15}},
lnpro::Item {
HandViewComponent(hand_view_component_state),
}
}
},
stpro::Item<Widget> {
capro::Layout<Col> {
lnpro::ContentsMargin {{5, 15, 15, 15}},
lnpro::Item {
SettingComponent(setting_component_state)
}
}
}
}
}
},
@@ -87,6 +131,5 @@ auto main(int argc, char *argv[]) -> int {
auto const point = mask_window->mapFromGlobal(QCursor::pos());
mask_window->initiate_animation(point);
});
return app::exec();
}