139 lines
5.0 KiB
C++
139 lines
5.0 KiB
C++
#include "component.hh"
|
|
#include "creeper-qt/utility/material-icon.hh"
|
|
#include "creeper-qt/utility/wrapper/mutable-value.hh"
|
|
#include "dlog/dlog.hh"
|
|
|
|
#include <qstandardpaths.h>
|
|
#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>
|
|
#include <iostream>
|
|
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 {
|
|
app::pro::Attribute {Qt::AA_EnableHighDpiScaling},
|
|
app::pro::Attribute {Qt::AA_UseHighDpiPixmaps},
|
|
app::pro::Complete {argc, argv},
|
|
};
|
|
std::cout << "========begin========" << std::endl;
|
|
auto stack_index = std::make_shared<MutableValue<int>>();
|
|
stack_index->set_silent(0);
|
|
|
|
auto manager = ThemeManager {kBlueMikuThemePack, ColorMode::DARK};
|
|
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::kPets},
|
|
{"2", material::icon::kSettings},
|
|
{"3", material::icon::kExtension},
|
|
{"4", material::icon::kLogout},
|
|
},
|
|
.stacked_callback = [&](int index) {
|
|
*stack_index = index;
|
|
},
|
|
.heatmap_show_numbers = HeatmapNumberVisibilityContext(),
|
|
};
|
|
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*){};
|
|
creeper::ShowWindow<MainWindow> {
|
|
[&](MainWindow& window) noexcept {
|
|
|
|
},
|
|
// mwpro::FixedSize {1080, 720},
|
|
// mwpro::MinimumSize {
|
|
// 1080,
|
|
// 720
|
|
// },
|
|
mwpro::Central<FilledCard> {
|
|
capro::ThemeManager {manager},
|
|
capro::Radius {0},
|
|
capro::Level {CardLevel::HIGHEST},
|
|
|
|
capro::Layout<Row> {
|
|
lnpro::Margin{0},
|
|
lnpro::Spacing{0},
|
|
lnpro::Item {
|
|
NavComponent(nav_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)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
mixer::pro::SetMixerMask {mask_window},
|
|
};
|
|
manager.apply_theme();
|
|
manager.append_begin_callback([=](const auto&) {
|
|
auto const point = mask_window->mapFromGlobal(QCursor::pos());
|
|
mask_window->initiate_animation(point);
|
|
});
|
|
return app::exec();
|
|
}
|