void ofxImGui::setup(BaseTheme* theme_) { io = &ImGui::GetIO(); io->DisplaySize = ImVec2((float)ofGetWidth(), (float)ofGetHeight()); io->MouseDrawCursor = false; #if defined(TARGET_OPENGLES) engine = new EngineOpenGLES(); #else engine = new EngineGLFW(); #endif engine->setup(io); if(theme_) { setTheme(theme_); }else { setTheme(new BaseTheme()); } }
void KGameRendererPrivate::_k_setTheme(const KgTheme* theme) { QLoggingCategory::setFilterRules(QStringLiteral("games.lib.debug = true")); const KgTheme* oldTheme = m_currentTheme; if (oldTheme == theme) { return; } qCDebug(GAMES_LIB) << "Setting theme:" << theme->name(); if (!setTheme(theme)) { const KgTheme* defaultTheme = m_provider->defaultTheme(); if (theme != defaultTheme) { qCDebug(GAMES_LIB) << "Falling back to default theme:" << defaultTheme->name(); setTheme(defaultTheme); m_provider->setCurrentTheme(defaultTheme); } } //announce change to KGameRendererClients QHash<KGameRendererClient*, QString>::iterator it1 = m_clients.begin(), it2 = m_clients.end(); for (; it1 != it2; ++it1) { it1.value().clear(); //because the pixmap is outdated it1.key()->d->fetchPixmap(); } emit m_parent->themeChanged(m_currentTheme); }
void HWMapContainer::setMapInfo(MapModel::MapInfo mapInfo) { m_mapInfo = mapInfo; m_curMap = m_mapInfo.name; // the map has no pre-defined theme, so let's use the selected one if (m_mapInfo.theme.isEmpty()) { if (!selectedTheme.isEmpty()) { setTheme(selectedTheme); emit themeChanged(selectedTheme); } } else { setTheme(m_mapInfo.theme); emit themeChanged(m_mapInfo.theme); } lblDesc->setText(mapInfo.desc); updatePreview(); emit mapChanged(m_curMap); }
PhoebetriaApp::PhoebetriaApp(int &argc, char **argv) : QApplication(argc, argv), m_currentStyle_filename() { setOrganizationName("Phoebetria"); setApplicationName("Phoebetria"); QSettings::setDefaultFormat(QSettings::IniFormat); DatabaseManager db; db.initAllDatabases(); if (!setTheme(m_prefs.stylesheet())) { QMessageBox::critical( NULL, tr("Could not set style."), tr("Could not set the application style." " It may not exist. Please check preferences.\n\n" "Style filename: %1\n\n" "Setting to the standard profile instead." ).arg(m_prefs.stylesheet()) ); setTheme(Themes::getBuiltInStyleSheetName()); } m_globalTimer.start(200); m_dispatcher.start(200); m_fanControllerIO.connect(); // Connect to the IO device m_fanControllerIO.connectSignals(); m_fanControllerIO.fanControllerData().connectSignals(); }
void Theme::setTheme(const QString theme) { if (theme.compare("blue", Qt::CaseInsensitive) == 0) { setTheme(Theme::Blue); } else if (theme.compare("lime", Qt::CaseInsensitive) == 0) { setTheme(Theme::Lime); } else { qDebug() << "Unknown theme"; } }
void CThemes::saveFile(const char *themename) { setTheme(themefile); if (!themefile.saveConfig(themename)) printf("[neutrino theme] %s write error\n", themename); }
void Level::initialize(Theme aTheme, DimLevel aDimLevel, uint32_t aUpdateFreq) { _updateFreq = aUpdateFreq; _timeElapsed = 0; setTheme(aTheme); setDimLevel(aDimLevel); clearLevel(); }
bool Themes::applyConfigured() { boost::optional<ThemeInfo::StyleInfo> style = Themes::getConfiguredStyle(g.s); if (!style) { return false; } const QFileInfo qssFile(style->getPlatformQss()); qWarning() << "Theme:" << style->themeName; qWarning() << "Style:" << style->name; qWarning() << "--> qss:" << qssFile.absoluteFilePath(); QFile file(qssFile.absoluteFilePath()); if (!file.open(QFile::ReadOnly)) { qWarning() << "Failed to open theme stylesheet:" << file.errorString(); return false; } QStringList skinPaths; skinPaths << qssFile.path(); skinPaths << QLatin1String(":/themes/Mumble"); // Some skins might want to fall-back on our built-in resources QString themeQss = QString::fromUtf8(file.readAll()); setTheme(themeQss, skinPaths); return true; }
mapboxApplication::mapboxApplication(const WEnvironment & env) : WApplication(env) { if (appRoot().empty()) { std::cerr << "!!!!!!!!!!" << std::endl << "!! Warning: read the README.md file for hints on deployment," << " the approot looks suspect!" << std::endl << "!!!!!!!!!!" << std::endl; } setTheme(new WBootstrapTheme()); this->useStyleSheet(WLink("wtMapExample.css")); setTitle("Mapbox Examples"); WContainerWidget * mainContent = new WContainerWidget(root()); mainContent->setStyleClass("examplemap"); map = new MapBox::Map(mainContent, true); map->setMapStyle(MapBox::MAPSTYLE::Streets); map->zoom(14).center(MapBox::Coordinate(51.515823, -0.124331)); // add all controls // map->addNavigationControl(); // map->addGeoLocateControl(); // map->addGeoCoderControl(); menuBar = new MenuBar(root()); }
void randomiseTheme() { buildThemesList(); int minimum_number = 2; int max_number = themesMenu.numEntries - 1; int r = rand() % (max_number + 1 - minimum_number) + minimum_number; menuEntry_s * randomEntry = getMenuEntry(&themesMenu, r); setTheme(randomEntry->executablePath); }
void Level::nextTheme() { if (_currentTheme == THEME_THREE) { _currentTheme = THEME_ONE; } else { _currentTheme = (Theme)(_currentTheme + 1); } setTheme(_currentTheme); }
void ScenarioInfo::clear() { setName( "" ); setTheme( THEME_DEFAULT ); setNbPlayer( 2 ); setMapWidth( 50 ); setMapHeight( 50 ); setDescription( "" ); }
void Themes::applyFallback() { qWarning() << "Applying fallback style sheet"; QStringList skinPaths; skinPaths << QLatin1String(":/themes/Mumble"); QString defaultTheme = getDefaultStylesheet(); setTheme(defaultTheme, skinPaths); }
void MainWindow::readSettings() { mSettings->beginGroup(settingsGroup); const QVariant geom = mSettings->value(geometryKey); if(geom.isValid()) setGeometry(geom.toRect()); if (mSettings->value(maximizeKey, false).toBool()) setWindowState(Qt::WindowMaximized); const QVariant theme = mSettings->value(themeKey); mSettings->endGroup(); mOptions->readSettings(mSettings); if(theme.isValid()) setTheme(theme.toString()); else setTheme("clean"); }
App::App(const Wt::WEnvironment& env) : wittyPlus::App(env) { setTheme(new Wt::WCssTheme("polished", this)); messageResourceBundle().use(appRoot() + "messages/MainWindow"); useStyleSheet("/css/footprint.css"); // Ensure that any users from the config file exist std::string users; readConfigurationProperty("users", users); ensureUsers(users); // Run! new widgets::MainWindow(root()); };
// Themes void frmListIconCfg::on_cbxThemes_activated(int index) { if( index > -1 ) { int id_theme = ui->cbxThemes->itemData(index, Qt::UserRole).toInt(); fGrl->setTheme( themes[id_theme].key ); setTheme(); ui->cbxListFiles->setCurrentIndex(0); emit on_cbxListFiles_activated(0); cargarIconConfig(); } }
void PropertySheetIconValue::assign(const PropertySheetIconValue &other, uint mask) { for (int i = 0; i < 8; i++) { uint flag = 1 << i; if (mask & flag) { const ModeStateKey state = subPropertyFlagToIconModeState(flag); setPixmap(state.first, state.second, other.pixmap(state.first, state.second)); } } if (mask & ThemeIconMask) setTheme(other.theme()); }
frmAcercaD::frmAcercaD(stGrlCfg m_cfg, QWidget *parent) : QDialog(parent), ui(new Ui::frmAcercaD) { ui->setupUi(this); fGrl = new Funciones; grlCfg = m_cfg; cargarConfig(); setTheme(); // centra la aplicacion en el escritorio this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry())); }
void ofxGuiContainer::setup() { filename.set("filename","settings.xml"); exclusiveToggles.set("exclusive toggles", false); ofAddListener(resize, this, &ofxGuiContainer::onResize); ofAddListener(childAdded, this, &ofxGuiContainer::onChildAdded); ofAddListener(addedTo, this, &ofxGuiContainer::onParentAdded); setTheme(); registerMouseEvents(); }
App::App(const Wt::WEnvironment& env) : Wt::WApplication(env) { setTheme(new Wt::WBootstrapTheme()); useStyleSheet("style.css"); root()->addWidget(config_wdgt = new Config_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(stat_wdgt = new Stat_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(line_wdgt = new Line_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(prog_wdgt = new Prog_wdgt(session)); enableUpdates(true); worker_connect(this); }
MainWidget::MainWidget(QWidget *parent) : QWidget(parent) { // INITIALIZE UI ui.setupUi(this); setWindowTitle(qAppName()); setAttribute(Qt::WA_TranslucentBackground); setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::WindowCloseButtonHint // No close event w/o this | Qt::FramelessWindowHint); ui.bottomLayout->setSizeConstraint(QLayout::SetFixedSize); ui.bottomLayout->setAlignment (Qt::AlignHCenter | Qt::AlignTop); ui.topLayout->setAlignment (Qt::AlignHCenter | Qt::AlignTop); ui.contentLayout->setAlignment(Qt::AlignHCenter | Qt::AlignTop); ui.bottomFrame->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed); ui.topFrame->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed); ui.inputLine->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed); ui.proposalList->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); // Do not allow context menues (they cause focus out events) ui.inputLine->setContextMenuPolicy(Qt::NoContextMenu); ui.proposalList->setContextMenuPolicy(Qt::NoContextMenu); // Let proposalList not accept keyboard focus ui.proposalList->setFocusPolicy(Qt::NoFocus); // Let inputLine get focus when proposallist gets it. ui.proposalList->setFocusProxy(ui.inputLine); // Proposallistview intercepts inputline's events (Navigation with keys, pressed modifiers, etc) ui.inputLine->installEventFilter(ui.proposalList); // Hide list ui.proposalList->hide(); // Settings QSettings s; _showCentered = s.value(CFG_CENTERED, CFG_CENTERED_DEF).toBool(); _theme = s.value(CFG_THEME, CFG_THEME_DEF).toString(); if (!setTheme(_theme)){ qFatal("FATAL: Stylefile not found: %s", _theme.toStdString().c_str()); exit(EXIT_FAILURE); } }
frmInstalarJuego::frmInstalarJuego(stGrlCfg m_cfg, QWidget *parent) : QDialog(parent), ui(new Ui::frmInstalarJuego) { ui->setupUi(this); fGrl = new Funciones; grlCfg = m_cfg; grlDir.Home = fGrl->GRlidaHomePath(); grlDir.Temp = grlDir.Home +"temp/"; cargarConfig(); setTheme(); // centra la aplicación en el escritorio this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry())); }
void ofxGuiInputField<Type>::setup(){ bChangedInternally = false; bMousePressed = false; mouseInside = false; bRegisteredForKeyEvents = false; hasFocus = false; mousePressedPos = -1; selectStartX = -1; selectStartPos = -1; selectEndPos = -1; pressCounter = 0; inputWidth = 0; selectionWidth = 0; setTheme(); registerMouseEvents(); registerKeyEvents(); }
frmInfo::frmInfo(dbSql *m_sql, stGrlCfg m_cfg, QWidget *parent) : QDialog(parent), ui(new Ui::frmInfo) { ui->setupUi(this); fGrl = new Funciones; sql = m_sql; grlCfg = m_cfg; grlDir.Home = fGrl->GRlidaHomePath(); grlDir.Datos = grlDir.Home +"datos/"; cargarConfig(); setTheme(); cargarListaCategorias(); // centra la aplicacion en el escritorio this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry())); }
frmWizardVdmSound::frmWizardVdmSound(dbSql *m_sql, stGrlCfg m_cfg, stGrlCats m_categoria, QWidget *parent) : QDialog(parent), ui(new Ui::frmWizardVdmSound) { ui->setupUi(this); fGrl = new Funciones; sql = m_sql; grlCfg = m_cfg; categoria = m_categoria; grlDir.Home = fGrl->GRlidaHomePath(); grlDir.Confvdms = grlDir.Home +"confvdms/"+ categoria.tabla +"/"; cargarConfig(); setTheme(); // centra la aplicación en el escritorio this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry())); }
QtChatHistoryWidget::QtChatHistoryWidget(QWidget * parent) : QWebView(parent) { //setLineWrapMode(QTextEdit::WidgetWidth); Config & config = ConfigManager::getInstance().getCurrentConfig(); String themeDir = config.getChatTheme(); String variant = config.getChatThemeVariant(); variant.decodeFromXMLSpecialCharacters(); _theme = new QtChatTheme(this); setTheme(QString::fromUtf8(themeDir.c_str()),QString::fromUtf8(variant.c_str())); //VOXOX - CJC - 2009.05.06 Force Keyboard copyng _copy = new QShortcut(QKeySequence::Copy,this); SAFE_CONNECT(_copy, SIGNAL(activated()), SLOT(copySlot())); page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks); SAFE_CONNECT(this, SIGNAL(linkClicked(const QUrl &)), SLOT(urlClicked(const QUrl &))); //QWebSettings *defaultSettings = QWebSettings::globalSettings(); // ////Add support for flash and other pluggins //defaultSettings->setAttribute(QWebSettings::PluginsEnabled, true); //defaultSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); //defaultSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, false); //defaultSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, false); //defaultSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, false); // // ////Add support for flash and other pluggins //defaultSettings->setObjectCacheCapacities(1024,0,1024); //defaultSettings->clearIconDatabase(); //clear(); }
frmConfigInicial::frmConfigInicial(stGrlCfg m_cfg, QWidget *parent) : QDialog(parent), ui(new Ui::frmConfigInicial) { ui->setupUi(this); fGrl = new Funciones; grlCfg = m_cfg; grlDir.Home = fGrl->GRlidaHomePath(); grlDir.Idiomas = grlDir.Home +"idiomas/"; fGrl->setTheme(grlCfg.NameDirTheme); fGrl->setIdioma(grlCfg.IdiomaSelect); cargarConfig(); setTheme(); // centra la aplicacion en el escritorio this->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, this->size(), qApp->desktop()->availableGeometry())); }
AuthApplication(const Wt::WEnvironment& env) : WApplication(env), session_(appRoot() + "auth.db") { session_.login().changed().connect(this, &AuthApplication::authEvent); root()->addStyleClass("container"); setTheme(std::make_shared<Wt::WBootstrapTheme>()); useStyleSheet("css/style.css"); std::unique_ptr<Wt::Auth::AuthWidget> authWidget = Wt::cpp14::make_unique<Wt::Auth::AuthWidget>(Session::auth(), session_.users(), session_.login()); authWidget->model()->addPasswordAuth(&Session::passwordAuth()); authWidget->model()->addOAuth(Session::oAuth()); authWidget->setRegistrationEnabled(true); authWidget->processEnvironment(); root()->addWidget(std::move(authWidget)); }
int Knob::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QColor*>(_v) = theme(); break; } _id -= 1; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setTheme(*reinterpret_cast< QColor*>(_v)); break; } _id -= 1; } else if (_c == QMetaObject::ResetProperty) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 1; } #endif // QT_NO_PROPERTIES return _id; }
void FacebookWidget::loadApplicationState() { QDir configDir = QDir::home(); configDir.cd(".config/Socializer"); QFile *configFile = new QFile(configDir.absoluteFilePath("WindowState")); if(!configFile->open(QIODevice::ReadOnly)) { firstRun = true; webView->setUrl(QUrl("qrc:/res/pages/index.html")); return; } else { firstRun = false; webView->setUrl(QUrl("https://www.facebook.com/")); } QDataStream configFileDataStream(configFile); QByteArray windowGeometry; configFileDataStream >> windowGeometry; configFileDataStream >> windowSizeIndex; switch(windowSizeIndex) { case 0: ui->maximizeButton->setIcon(QIcon("://res/toolbar/fullscreen.png")); break; case 1: ui->maximizeButton->setIcon(QIcon("://res/toolbar/fullscreen.png")); break; case 2: ui->maximizeButton->setIcon(QIcon("://res/toolbar/fullscreen.png")); break; case 3: ui->maximizeButton->setIcon(QIcon("://res/toolbar/return_fullscreen.png")); }; restoreGeometry(windowGeometry); QFile *themeFile =new QFile(configDir.absoluteFilePath("ThemeState")); if(!themeFile->open(QIODevice::ReadOnly)) return; QDataStream themeFileDataStream(themeFile); QStringList themeParams; themeFileDataStream >> themeParams; setTheme(themeParams); }