fixed potential compilation issue

This commit is contained in:
kevinkoenig
2021-09-03 09:47:39 +02:00
committed by Raphael Coeffic
parent 6c16afa28b
commit 47585b8829
2 changed files with 25 additions and 27 deletions
-25
View File
@@ -18,31 +18,6 @@
*/
#include "keyboard_base.h"
void Keyboard::hide()
{
if (activeKeyboard) {
activeKeyboard->clearField();
activeKeyboard = nullptr;
}
}
void Keyboard::clearField()
{
detach();
if (fields) {
fields->setHeight(oldHeight);
fields = nullptr;
}
if (fieldContainer) {
fieldContainer->setHeight(LCD_H - 0 - fieldContainer->top());
fieldContainer = nullptr;
}
if (field) {
field->setEditMode(false);
field = nullptr;
}
}
coord_t calcScrollOffsetForField(FormField *newField, Window *topWindow)
{
// now we need to calculate the offset of the field in the fields scroll container
+25 -2
View File
@@ -29,7 +29,31 @@ class Keyboard: public FormWindow
{
}
static void hide();
void clearField()
{
detach();
if (fields) {
fields->setHeight(oldHeight);
fields = nullptr;
}
if (fieldContainer) {
fieldContainer->setHeight(LCD_H - 0 - fieldContainer->top());
fieldContainer = nullptr;
}
if (field) {
field->setEditMode(false);
field = nullptr;
}
}
static void hide()
{
if (activeKeyboard) {
activeKeyboard->clearField();
activeKeyboard = nullptr;
}
}
protected:
static Keyboard * activeKeyboard;
@@ -39,7 +63,6 @@ class Keyboard: public FormWindow
coord_t oldHeight = 0;
void setField(FormField *newField);
void clearField();
Window *getFieldContainer(FormField * field);
void attachKeyboard();
FormWindow *findFormWindow();