finish touch ui
This commit is contained in:
@@ -55,8 +55,7 @@ private:
|
||||
QSize get_matrix_size();
|
||||
private:
|
||||
friend class Impl;
|
||||
// QSize matrix_size = {3, 4};
|
||||
QSize matrix_size;
|
||||
QSize matrix_size = {3, 4};
|
||||
};
|
||||
} // namespace plot_widget::internal
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#include <qsize.h>
|
||||
#include <qsizepolicy.h>
|
||||
#include <random>
|
||||
|
||||
#include "component.hh"
|
||||
@@ -38,7 +39,7 @@ static auto ComConfigComponent(ThemeManager& manager, auto&& callback) {
|
||||
slogen_context->set_silent("BanG Bream! It's MyGo!!!");
|
||||
|
||||
auto select_com_context = std::make_shared<MutableValue<QStringList>>();
|
||||
select_com_context->set_silent(QStringList {});
|
||||
select_com_context->set_silent(QStringList {"COM1", "COM2", "COM3", "COM4", "COM5"});
|
||||
|
||||
auto select_baud_context = std::make_shared<MutableValue<QStringList>>();
|
||||
select_baud_context->set_silent(QStringList {"9600", "115200"});
|
||||
@@ -57,6 +58,10 @@ static auto ComConfigComponent(ThemeManager& manager, auto&& callback) {
|
||||
slpro::LeadingIcon {material::icon::kArrowDropDown, material::regular::font},
|
||||
slpro::IndexChanged {[&](auto& self){ qDebug() << self.currentIndex();}},
|
||||
slpro::LeadingText {"COM"},
|
||||
MutableForward {
|
||||
slpro::SelectItems {},
|
||||
select_com_context,
|
||||
}
|
||||
},
|
||||
lnpro::Item<MatSelect> {
|
||||
slpro::ThemeManager {manager },
|
||||
@@ -145,6 +150,9 @@ static auto ComConfigComponent(ThemeManager& manager, auto&& callback) {
|
||||
static auto DisplayComponent(ThemeManager& manager, int index = 0) noexcept {
|
||||
const auto row = new Row{
|
||||
lnpro::Item<HeatMapPlot> {
|
||||
plot_widget::pro::SizePolicy {
|
||||
QSizePolicy::Expanding,
|
||||
},
|
||||
pwpro::MatrixSize {
|
||||
QSize{3, 4}
|
||||
},
|
||||
@@ -190,8 +198,13 @@ auto ViewComponent(ViewComponentState& state) noexcept -> raw_pointer<QWidget> {
|
||||
}),
|
||||
},
|
||||
|
||||
lnpro::Item {
|
||||
DisplayComponent(state.manager),
|
||||
lnpro::Item<Row> {
|
||||
lnpro::Item {
|
||||
DisplayComponent(state.manager),
|
||||
},
|
||||
lnpro::Item {
|
||||
DisplayComponent(state.manager),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
3
main.cc
3
main.cc
@@ -1,4 +1,5 @@
|
||||
#include "component.hh"
|
||||
#include "modern-qt/utility/material-icon.hh"
|
||||
#include <qstandardpaths.h>
|
||||
#include <modern-qt/core/application.hh>
|
||||
#include <modern-qt/layout/linear.hh>
|
||||
@@ -32,7 +33,7 @@ auto main(int argc, char *argv[]) -> int {
|
||||
|
||||
},
|
||||
.buttons_context = {
|
||||
{"0", material::icon::kHome},
|
||||
{"0", material::icon::kTouchSensor},
|
||||
{"1", material::icon::kStar},
|
||||
{"2", material::icon::kFavorite},
|
||||
{"3", material::icon::kExtension},
|
||||
|
||||
@@ -161,6 +161,9 @@ namespace material {
|
||||
// link
|
||||
constexpr auto kAddLink = "add_link";
|
||||
constexpr auto kLinkOff = "link_off";
|
||||
|
||||
// sensor icon
|
||||
constexpr auto kTouchSensor = "touch_app";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user