HorizontalSlider::HorizontalSlider(QWidget *parent) : QWidget(parent) { m_skin = Skin::instance(); m_min = 0; m_max = 100; m_value = 0; connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); updateSkin(); }
EqTitleBar::EqTitleBar(QWidget *parent) : PixmapWidget(parent) { m_volumeBar = 0; m_balanceBar = 0; m_shade2 = 0; m_left = 0; m_right = 0; m_shaded = false; m_align = false; m_skin = Skin::instance(); m_eq = parentWidget(); m_mw = qobject_cast<MainWindow*>(m_eq->parent()); m_close = new Button(this, Skin::EQ_BT_CLOSE_N, Skin::EQ_BT_CLOSE_P, Skin::CUR_EQCLOSE); connect(m_close, SIGNAL(clicked()),m_eq, SIGNAL(closed())); m_shade = new Button(this, Skin::EQ_BT_SHADE1_N, Skin::EQ_BT_SHADE1_P, Skin::CUR_EQNORMAL); connect(m_shade, SIGNAL(clicked()), SLOT(shade())); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); if (settings.value("Skinned/eq_shaded", false).toBool()) shade(); m_align = true; setActive(false); setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); updatePositions(); }
PlaylistControl::PlaylistControl(QWidget* parent) : PixmapWidget(parent) { m_skin = Skin::instance(); setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); m_ratio = m_skin->ratio(); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); }
void NewGame::on_ok_clicked() { if(!okAccepted) return; okAccepted=false; timer.start(20); if(step==Step1) { if(ui->pseudo->text().isEmpty()) { QMessageBox::warning(this,tr("Error"),tr("Your pseudo can't be empty")); return; } step=Step2; ui->pseudo->hide(); updateSkin(); if(monstergroup.size()<2) on_ok_clicked(); } else if(step==Step2) { step=StepOk; accept(); } else return; }
bool Skin::loadSkin( File &skinFile, int numberOfChannels) { updateSkin(numberOfChannels); return loadFromXml(skinFile, "squeezer-skin", "1.0"); }
void NewGame::on_previousSkin_clicked() { if(step==Step1) { if(currentSkin<=0) return; currentSkin--; updateSkin(); } else if(step==Step2) { if(currentMonsterGroup<=0) return; currentMonsterGroup--; updateSkin(); } else return; }
void NewGame::on_nextSkin_clicked() { if(step==Step1) { if(currentSkin<(skinList.size()-1)) currentSkin++; else return; updateSkin(); } else if(step==Step2) { if(currentMonsterGroup<(monstergroup.size()-1)) currentMonsterGroup++; else return; updateSkin(); } else return; }
bool Skin::loadSkin( File &skinFile, int numberOfChannels, int crestFactor, int meterType) { updateSkin(numberOfChannels, crestFactor, meterType); return loadFromXml(skinFile, "trakmeter-skin", "1.1"); }
NewGame::NewGame(const std::string &skinPath, const std::string &monsterPath, std::vector<std::vector<CatchChallenger::Profile::Monster> > monstergroup, const std::vector<uint8_t> &forcedSkin, QWidget *parent) : QDialog(parent), ui(new Ui::NewGame) { srand(static_cast<uint32_t>(time(NULL))); ui->setupUi(this); this->forcedSkin=forcedSkin; this->monsterPath=monsterPath; this->monstergroup=monstergroup; okAccepted=true; step=Step1; currentMonsterGroup=0; if(!monstergroup.empty()) currentMonsterGroup=static_cast<uint8_t>(rand()%monstergroup.size()); this->skinPath=skinPath; uint8_t index=0; while(index<CatchChallenger::CommonDatapack::commonDatapack.skins.size()) { if(forcedSkin.empty() || vectorcontainsAtLeastOne(forcedSkin,(uint8_t)index)) { const std::string ¤tPath=skinPath+CatchChallenger::CommonDatapack::commonDatapack.skins.at(index); if(QFile::exists(QString::fromStdString(currentPath+"/back.png")) && QFile::exists(QString::fromStdString(currentPath+"/front.png")) && QFile::exists(QString::fromStdString(currentPath+"/trainer.png"))) { skinList.push_back(CatchChallenger::CommonDatapack::commonDatapack.skins.at(index)); skinListId.push_back(index); } } index++; } ui->pseudo->setMaxLength(CommonSettingsCommon::commonSettingsCommon.max_pseudo_size); ui->previousSkin->setVisible(skinList.size()>=2); ui->nextSkin->setVisible(skinList.size()>=2); currentSkin=0; if(!skinList.empty()) currentSkin=static_cast<uint8_t>(rand()%skinList.size()); updateSkin(); ui->pseudo->setFocus(); if(skinList.empty()) { QMessageBox::critical(this,tr("Error"),tr("No skin to select!")); close(); return; } if(!connect(&timer,&QTimer::timeout, this,&NewGame::timerSlot, Qt::QueuedConnection)) abort(); }
void FontEngine::readSettings() { m_default_size[FM_Standard] = m_settings->getU16("font_size"); m_default_size[FM_Fallback] = m_settings->getU16("fallback_font_size"); m_default_size[FM_Mono] = m_settings->getU16("mono_font_size"); if (is_yes(_("needs_fallback_font"))) { m_currentMode = FM_Fallback; } else { m_currentMode = FM_Standard; } m_default_size[FM_Simple] = m_settings->getU16("font_size"); m_default_size[FM_SimpleMono] = m_settings->getU16("mono_font_size"); cleanCache(); updateFontCache(); updateSkin(); }
void FontEngine::readSettings() { #if USE_FREETYPE if (g_settings->getBool("freetype")) { m_default_size[FM_Standard] = m_settings->getU16("font_size"); m_default_size[FM_Fallback] = m_settings->getU16("fallback_font_size"); m_default_size[FM_Mono] = m_settings->getU16("mono_font_size"); if (is_yes(gettext("needs_fallback_font"))) { m_currentMode = FM_Fallback; } else { m_currentMode = FM_Standard; } } #endif m_default_size[FM_Simple] = m_settings->getU16("font_size"); m_default_size[FM_SimpleMono] = m_settings->getU16("mono_font_size"); cleanCache(); updateFontCache(); updateSkin(); }
FontEngine::FontEngine(Settings* main_settings, gui::IGUIEnvironment* env) : m_settings(main_settings), m_env(env), m_font_cache(), m_currentMode(FM_Standard), m_lastMode(), m_lastSize(0), m_lastFont(NULL) { for (unsigned int i = 0; i < FM_MaxMode; i++) { m_default_size[i] = (FontMode) FONT_SIZE_UNSPECIFIED; } assert(m_settings != NULL); // pre-condition assert(m_env != NULL); // pre-condition assert(m_env->getSkin() != NULL); // pre-condition m_currentMode = FM_Simple; #if USE_FREETYPE if (g_settings->getBool("freetype")) { m_default_size[FM_Standard] = m_settings->getU16("font_size"); m_default_size[FM_Fallback] = m_settings->getU16("fallback_font_size"); m_default_size[FM_Mono] = m_settings->getU16("mono_font_size"); if (is_yes(gettext("needs_fallback_font"))) { m_currentMode = FM_Fallback; } else { m_currentMode = FM_Standard; } } // having freetype but not using it is quite a strange case so we need to do // special handling for it if (m_currentMode == FM_Simple) { std::stringstream fontsize; fontsize << DEFAULT_FONT_SIZE; m_settings->setDefault("font_size", fontsize.str()); m_settings->setDefault("mono_font_size", fontsize.str()); } #endif m_default_size[FM_Simple] = m_settings->getU16("font_size"); m_default_size[FM_SimpleMono] = m_settings->getU16("mono_font_size"); updateSkin(); if (m_currentMode == FM_Standard) { m_settings->registerChangedCallback("font_size", font_setting_changed, NULL); m_settings->registerChangedCallback("font_path", font_setting_changed, NULL); m_settings->registerChangedCallback("font_shadow", font_setting_changed, NULL); m_settings->registerChangedCallback("font_shadow_alpha", font_setting_changed, NULL); } else if (m_currentMode == FM_Fallback) { m_settings->registerChangedCallback("fallback_font_size", font_setting_changed, NULL); m_settings->registerChangedCallback("fallback_font_path", font_setting_changed, NULL); m_settings->registerChangedCallback("fallback_font_shadow", font_setting_changed, NULL); m_settings->registerChangedCallback("fallback_font_shadow_alpha", font_setting_changed, NULL); } m_settings->registerChangedCallback("mono_font_path", font_setting_changed, NULL); m_settings->registerChangedCallback("mono_font_size", font_setting_changed, NULL); m_settings->registerChangedCallback("screen_dpi", font_setting_changed, NULL); m_settings->registerChangedCallback("gui_scaling", font_setting_changed, NULL); }
void Skin::loadSkin(File &fileSkin, int nNumChannels, int nCrestFactor, int nAverageAlgorithm, bool bExpanded, bool bDisplayPeakMeter) { updateSkin(nNumChannels, nCrestFactor, nAverageAlgorithm, bExpanded, bDisplayPeakMeter); loadFromXml(fileSkin, "kmeter-skin"); }