static void setRotate() { bool rotate = !watchConfig.display180; watchConfig.display180 = rotate; setMenuOptions(); oled_set180(rotate); }
static void setInvert() { bool invert = !watchConfig.invert; watchConfig.invert = invert; setMenuOptions(); oled_setInvert(invert); }
static void setBrightness() { byte brightness = watchConfig.brightness; brightness++; if(brightness > 3) brightness = 0; watchConfig.brightness = brightness; setMenuOptions(); oled_setBrightness(brightness * 85); }
void mDisplayOpen() { setMenuInfo(OPTION_COUNT, PSTR(" < DISPLAY >"), MENU_TYPE_ICON, mSelect, upOption, downOption); setMenuOptions(); setMenuOption_P(OPTION_EXIT, menuBack, menu_exit, back); setPrevMenuOpen(&prevMenuData, mDisplayOpen); beginAnimation2(NULL); }
void ShowMenuEditorWidget::updateData(GameObject * action) { ActionEditorWidget::updateData(action); ShowMenu* showMenu = qobject_cast<ShowMenu*>(action); if (! showMenu) return; QList<GameObject*> resources = ResourceManager::instance()->objects(GameObjectMetaType::Menu); mMenuComboBox->clear(); foreach(GameObject* menu, resources) { if (menu) mMenuComboBox->addObject(qobject_cast<Menu*>(menu)); } mMenuComboBox->setCurrentIndex(-1); Object* obj = showMenu->sceneObject(); if (obj) { mMenuComboBox->setCurrentObject(qobject_cast<Menu*>(obj->resource())); } int index = mMenuHAlignmentComboBox->findData(showMenu->menuHAlignment()); mMenuHAlignmentComboBox->setCurrentIndex(index); index = mMenuVAlignmentComboBox->findData(showMenu->menuVAlignment()); mMenuVAlignmentComboBox->setCurrentIndex(index); //clear all data foreach(QLineEdit* lineEditor, mTextEdits) lineEditor->clear(); foreach(QTextEdit* conditionEditor, mConditionEdits) conditionEditor->clear(); foreach(ActionManagerButton* button, mActionButtons) button->clear(); if (! showMenu->sceneObject()) return; Menu* menu = static_cast<Menu*>(showMenu->sceneObject()); QList<MenuOption*> options = menu->options(); int optionsSize = options.size(); //realign menu in case it was moved by the user menu->alignHorizontally(showMenu->menuHAlignment()); menu->alignVertically(showMenu->menuVAlignment()); index = optionsSize >= 2 ? optionsSize-2 : 0; mChooseNumberOfOptions->setCurrentIndex(index); setMenuOptions(options); }
void ShowMenuEditorWidget::onNumberOfOptionsChanged(int index) { ShowMenu* showMenu = qobject_cast<ShowMenu*>(mGameObject); if (! sender() || ! showMenu || ! showMenu->sceneObject()) return; Menu* menu = static_cast<Menu*>(showMenu->sceneObject()); QComboBox *comboBox = static_cast<QComboBox*>(sender()); bool ok; int number = comboBox->currentText().toInt(&ok); if (! ok) return; menu->setNumberOfOptions(number); setMenuOptions(menu->options()); _updateTexts(menu); }
static void setAnimations() { bool anims = !watchConfig.animations; watchConfig.animations = anims; setMenuOptions(); }