cleanup & formatting
This commit is contained in:
committed by
Raphael Coeffic
parent
23ef7a9609
commit
8639a7829d
@@ -117,7 +117,6 @@ class FlashDialog: public FullScreenDialog
|
||||
device(device),
|
||||
progress(this, {LCD_W / 2 - 50, LCD_H / 2, 100, 15})
|
||||
{
|
||||
// setFocus();
|
||||
}
|
||||
|
||||
void deleteLater(bool detach = true, bool trash = true) override
|
||||
|
||||
@@ -160,28 +160,33 @@ class DateTimeWindow : public FormGroup {
|
||||
}
|
||||
};
|
||||
|
||||
class WindowButtonGroup : public FormGroup {
|
||||
public:
|
||||
WindowButtonGroup(FormGroup * parent, const rect_t & rect, std::vector<std::pair<const char*, std::function<void()> >> windows) :
|
||||
class WindowButtonGroup : public FormGroup
|
||||
{
|
||||
public:
|
||||
WindowButtonGroup(
|
||||
FormGroup* parent, const rect_t& rect,
|
||||
std::vector<std::pair<const char*, std::function<void()>>> windows) :
|
||||
FormGroup(parent, rect, FORWARD_SCROLL | FORM_FORWARD_FOCUS),
|
||||
windows(windows)
|
||||
{
|
||||
build();
|
||||
}
|
||||
{
|
||||
build();
|
||||
}
|
||||
|
||||
protected:
|
||||
std::vector<std::pair<const char*, std::function<void()> >> windows;
|
||||
protected:
|
||||
std::vector<std::pair<const char*, std::function<void()>>> windows;
|
||||
|
||||
void build()
|
||||
{
|
||||
FormGridLayout grid;
|
||||
void build()
|
||||
{
|
||||
FormGridLayout grid;
|
||||
|
||||
for(auto entry: windows)
|
||||
{
|
||||
new TextButton(this, grid.getLabelSlot(), entry.first, [&, entry](){entry.second(); return 1;});
|
||||
grid.nextLine();
|
||||
}
|
||||
for (auto entry : windows) {
|
||||
new TextButton(this, grid.getLabelSlot(), entry.first, [&, entry]() {
|
||||
entry.second();
|
||||
return 0;
|
||||
});
|
||||
grid.nextLine();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static const lv_coord_t line_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1),
|
||||
|
||||
@@ -259,12 +259,6 @@ void ViewMain::onEvent(event_t event)
|
||||
new ScreenMenu();
|
||||
break;
|
||||
|
||||
// // do not use KEY_FIRST as it would
|
||||
// // interfere with the menu CLICKED event
|
||||
// case EVT_KEY_FIRST(KEY_ENTER):
|
||||
// openMenu();
|
||||
// break;
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PGUP)
|
||||
case EVT_KEY_FIRST(KEY_PGDN):
|
||||
#else
|
||||
@@ -284,6 +278,8 @@ void ViewMain::onEvent(event_t event)
|
||||
previousMainView();
|
||||
break;
|
||||
|
||||
// TODO: find something to activate widget selection via keys
|
||||
|
||||
// case EVT_ROTARY_LEFT:
|
||||
// // decrement
|
||||
// case EVT_ROTARY_RIGHT:
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 1ae025f640...e5398e9b8d
Reference in New Issue
Block a user