New kernel drivers and device migrations (#563)
This commit is contained in:
committed by
GitHub
parent
955416dac8
commit
8af6204ba1
@@ -8,7 +8,6 @@
|
||||
|
||||
#include <Tactility/app/App.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/settings/DisplaySettings.h>
|
||||
|
||||
@@ -24,16 +23,6 @@ static std::shared_ptr<hal::display::DisplayDevice> getHalDisplay() {
|
||||
return hal::findFirstDevice<hal::display::DisplayDevice>(hal::Device::Type::Display);
|
||||
}
|
||||
|
||||
static bool hasCalibratableTouchDevice() {
|
||||
auto touch_devices = hal::findDevices<hal::touch::TouchDevice>(hal::Device::Type::Touch);
|
||||
for (const auto& touch_device : touch_devices) {
|
||||
if (touch_device != nullptr && touch_device->supportsCalibration()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class HalDisplayApp final : public App {
|
||||
|
||||
settings::display::DisplaySettings displaySettings;
|
||||
@@ -131,10 +120,6 @@ class HalDisplayApp final : public App {
|
||||
}
|
||||
}
|
||||
|
||||
static void onCalibrateTouchClicked(lv_event_t*) {
|
||||
app::start("TouchCalibration");
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void onShow(AppContext& app, lv_obj_t* parent) override {
|
||||
@@ -294,25 +279,6 @@ public:
|
||||
lv_obj_add_state(screensaverDropdown, LV_STATE_DISABLED);
|
||||
}
|
||||
}
|
||||
|
||||
if (hasCalibratableTouchDevice()) {
|
||||
auto* calibrate_wrapper = lv_obj_create(main_wrapper);
|
||||
lv_obj_set_size(calibrate_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
|
||||
lv_obj_set_style_pad_all(calibrate_wrapper, 0, LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_border_width(calibrate_wrapper, 0, LV_STATE_DEFAULT);
|
||||
|
||||
auto* calibrate_label = lv_label_create(calibrate_wrapper);
|
||||
lv_label_set_text(calibrate_label, "Touch calibration");
|
||||
lv_obj_align(calibrate_label, LV_ALIGN_LEFT_MID, 0, 0);
|
||||
|
||||
auto* calibrate_button = lv_button_create(calibrate_wrapper);
|
||||
lv_obj_align(calibrate_button, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||
lv_obj_add_event_cb(calibrate_button, onCalibrateTouchClicked, LV_EVENT_SHORT_CLICKED, this);
|
||||
|
||||
auto* calibrate_button_label = lv_label_create(calibrate_button);
|
||||
lv_label_set_text(calibrate_button_label, "Calibrate");
|
||||
lv_obj_center(calibrate_button_label);
|
||||
}
|
||||
}
|
||||
|
||||
void onHide(AppContext& app) override {
|
||||
|
||||
Reference in New Issue
Block a user