Dialog now themeable

This commit is contained in:
Bertrand Songis
2019-11-29 17:58:33 +01:00
parent 6927c52429
commit c856f13913
4 changed files with 16 additions and 5 deletions
+7 -2
View File
@@ -149,12 +149,12 @@ class FailSafePage : public Page {
class RegisterDialog: public Dialog {
public:
explicit RegisterDialog(uint8_t moduleIdx):
Dialog(STR_REGISTER, {50, 73, LCD_W - 100, LCD_H - 146}),
Dialog(STR_REGISTER, {50, 73, LCD_W - 100, 0}),
moduleIdx(moduleIdx)
{
FormGridLayout grid(form.width());
grid.setLabelWidth(150);
grid.spacer(PAGE_LINE_HEIGHT + 8);
grid.spacer(PAGE_PADDING);
// Register ID
new StaticText(&form, grid.getLabelSlot(), STR_REG_ID);
@@ -179,7 +179,12 @@ class RegisterDialog: public Dialog {
return 0;
});
exitButton->setFocus();
grid.nextLine();
grid.spacer(PAGE_PADDING);
FormField::link(exitButton, edit);
form.setHeight(grid.getWindowHeight());
content->adjustHeight();
start();
+7 -1
View File
@@ -19,7 +19,8 @@
*/
#include "opentx.h"
#include "checkbox.h"
//#include "checkbox.h"
//#include "modal_window.h"
extern ThemeBase * defaultTheme;
const BitmapBuffer * ThemeBase::asterisk = NULL;
@@ -238,3 +239,8 @@ MenuWindowContent * createMenuWindow(Menu * menu)
{
return new MenuWindowContent(menu);
}
ModalWindowContent * createDialogWindow(Dialog * dialog, const rect_t & rect)
{
return new ModalWindowContent(dialog, rect);
}
+1 -1
View File
@@ -153,7 +153,7 @@ constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT;
constexpr coord_t MENUS_LINE_HEIGHT = 30;
constexpr coord_t MENUS_WIDTH = 200;
constexpr coord_t MENUS_OFFSET_TOP = 20;
constexpr coord_t MENUS_HEADER_HEIGHT = 30;
constexpr coord_t POPUP_HEADER_HEIGHT = 30;
constexpr coord_t MENUS_MIN_HEIGHT = 2 * MENUS_LINE_HEIGHT - 1;
constexpr coord_t MENUS_MAX_HEIGHT = 7 * MENUS_LINE_HEIGHT - 1;
constexpr coord_t MODEL_SELECT_FOOTER_HEIGHT = 24;
+1 -1
View File
@@ -153,7 +153,7 @@ constexpr coord_t INPUT_EDIT_CURVE_TOP = MENU_HEADER_HEIGHT;
constexpr coord_t MENUS_LINE_HEIGHT = 40;
constexpr coord_t MENUS_WIDTH = 200;
constexpr coord_t MENUS_OFFSET_TOP = 20;
constexpr coord_t MENUS_HEADER_HEIGHT = 40;
constexpr coord_t POPUP_HEADER_HEIGHT = 40;
constexpr coord_t MENUS_MIN_HEIGHT = 2 * MENUS_LINE_HEIGHT - 1;
constexpr coord_t MENUS_MAX_HEIGHT = 7 * MENUS_LINE_HEIGHT - 1;
constexpr coord_t MODEL_SELECT_FOOTER_HEIGHT = 24;