void Scene1105::upClosePanel() { Scene::update(); if (_backgroundIndex != 0) { _backgroundIndex--; if (_backgroundIndex == 14) { showMouse(false); _ssSymbols[0]->hide(); _ssSymbols[1]->hide(); _ssSymbols[2]->hide(); _ssSymbolDice[0]->hide(); _ssSymbolDice[1]->hide(); _ssSymbolDice[2]->hide(); } if (_backgroundIndex < 6 && _backgroundIndex % 2 == 0) { uint32 backgroundFileHash = kScene1105BackgroundFileHashes[3 - _backgroundIndex / 2]; // CHECKME if (_backgroundIndex == 4) { playSound(1); _asTeddyBear->hide(); } changeBackground(backgroundFileHash); _palette->addPalette(backgroundFileHash, 0, 256, 0); } if (_backgroundIndex == 0) { SetUpdateHandler(&Scene1105::update); _isClosePanelDone = true; } } }
ColorSettingsWidget::ColorSettingsWidget(GenomeVector* g, QWidget* parent) : QWidget(parent), genome(g) { setupUi(this); m_colorSelector->setGenomeVector(genome); m_colorLineEdit->setWheelEventUpdate(true); m_colorLineEdit->restoreSettings(); connect(m_colorLineEdit, SIGNAL(valueUpdated()), this, SLOT(colorChangedAction())); connect(m_colorLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal())); m_speedLineEdit->setWheelEventUpdate(true); m_speedLineEdit->restoreSettings(); connect(m_speedLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction())); connect(m_speedLineEdit, SIGNAL(valueUpdated()), m_colorSelector, SLOT(repaintLabel())); connect(m_speedLineEdit, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal())); m_opacityLineEdit->setWheelEventUpdate(true); m_opacityLineEdit->restoreSettings(); connect(m_opacityLineEdit, SIGNAL(valueUpdated()), this, SLOT(fieldEditedAction())); connect(m_backgroundLabel, SIGNAL(colorSelected(QColor)), this, SLOT(changeBackground(QColor))); connect(m_backgroundLabel, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal())); connect(m_colorSelector, SIGNAL(colorSelected(double)), this, SLOT(colorSelectedAction(double))); connect(m_colorSelector, SIGNAL(undoStateSignal()), this, SIGNAL(undoStateSignal())); }
void MainWindow::gotoScene(QGraphicsScene *scene){ view->setScene(scene); if(this->scene) this->scene->deleteLater(); this->scene = scene; changeBackground(); }
void MainWindow::gotoScene(QGraphicsScene *scene){ if(this->scene) this->scene->deleteLater(); this->scene = scene; view->setScene(scene); QResizeEvent e(view->size(), view->size()); view->resizeEvent(&e); changeBackground(); }
void MainWindow::gotoScene(QGraphicsScene *scene){ QGraphicsView *view = qobject_cast<QGraphicsView *>(centralWidget()); view->setScene(scene); if(this->scene) this->scene->deleteLater(); this->scene = scene; changeBackground(); }
void MainWindow::gotoScene(QGraphicsScene *scene) { if (this->scene) this->scene->deleteLater(); this->scene = scene; view->setScene(scene); QResizeEvent e(QSize(view->size().width() - 4, view->size().height() - 4), view->size()); // WARNING: Magic Number view->resizeEvent(&e); changeBackground(); }
void MainWindow::gotoScene(QGraphicsScene *scene) { if (this->scene) this->scene->deleteLater(); this->scene = scene; view->setScene(scene); /* @todo: Need a better way to replace the magic number '4' */ QResizeEvent e(QSize(view->size().width() - 4, view->size().height() - 4), view->size()); view->resizeEvent(&e); changeBackground(); }
bool SetBackgroundLogic::evaluate(gkScalar tick) { if (GET_SOCKET_VALUE(ENABLE) == SET_BACKGROUND) { enterSetBackground(); quitSetBackground(); focusMove(); changeBackground(); } return false; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), server(NULL) { ui->setupUi(this); setWindowTitle(tr("Sanguosha") + " " + Sanguosha->getVersionNumber()); scene = NULL; connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui->actionAcknowledgement_2, SIGNAL(triggered()), this, SLOT(on_actionAcknowledgement_triggered())); StartScene *start_scene = new StartScene; QList<QAction *> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionScenario_Overview << ui->actionAbout; foreach(QAction *action, actions) start_scene->addButton(action); view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); BackLoader::preload(); gotoScene(start_scene); addAction(ui->actionShow_Hide_Menu); addAction(ui->actionFullscreen); connect(ui->actionRestart_Game, SIGNAL(triggered()), this, SLOT(startConnection())); connect(ui->actionReturn_to_Main_Menu, SIGNAL(triggered()), this, SLOT(gotoStartScene())); systray = NULL; }
MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); scene = NULL; // initialize random seed for later use qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); StartScene *start_scene = new StartScene; QList<QAction*> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionPC_Console_Start << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionScenario_Overview << ui->actionAbout << ui->actionAcknowledgement; foreach(QAction *action, actions) start_scene->addButton(action); view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); gotoScene(start_scene); addAction(ui->actionShow_Hide_Menu); addAction(ui->actionFullscreen); addAction(ui->actionMinimize_to_system_tray); systray = NULL; }
int SetWidget::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) { switch (_id) { case 0: saveAll(); break; case 1: chooseColor(); break; case 2: changeBackground(); break; default: ; } _id -= 3; } return _id; }
void Scene1105::upOpenPanel() { Scene::update(); if (_backgroundIndex != 0) { _backgroundIndex--; if (_backgroundIndex < 6 && _backgroundIndex % 2 == 0) { uint32 backgroundFileHash = kScene1105BackgroundFileHashes[_backgroundIndex / 2]; changeBackground(backgroundFileHash); _palette->addPalette(backgroundFileHash, 0, 256, 0); } if (_backgroundIndex == 10) playSound(0); if (_backgroundIndex == 0) { SetUpdateHandler(&Scene1105::update); _countdown = 2; } } }
WHotSpotList::WHotSpotList( WWindow * prt, const WRect & r, const char * text, WHotSpots* hs, WStyle wstyle, WExStyle wexstyle ) : WWindow( prt, r, text, wstyle, wexstyle ) , _topIndex( 0 ) , _selected( -1 ) , _leftDown( FALSE ) , _hotPressIdx( -1 ) , _inHotZone( FALSE ) , _changedClient( NULL ) , _changed( NULL ) , _dblClickClient( NULL ) , _dblClick( NULL ) , _hotPressClient( NULL ) , _hotPress( NULL ) , _hs( hs ) //-------------------------------------------------------------- { changeBackground( WPaintAttrControlBackground ); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), isLeftPressDown(false), scene(NULL), ui(new Ui::MainWindow), server(NULL), about_window(NULL), minButton(NULL), maxButton(NULL), normalButton(NULL), closeButton(NULL), versionInfomationReply(NULL), changeLogReply(NULL) { ui->setupUi(this); setWindowTitle(tr("QSanguosha-Hegemony") + " " + Sanguosha->getVersion()); #ifdef Q_OS_WIN setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); #endif setAttribute(Qt::WA_TranslucentBackground); setMouseTracking(true); setMinimumWidth(800); setMinimumHeight(580); fetchUpdateInformation(); connection_dialog = new ConnectionDialog(this); connect(ui->actionStart_Game, SIGNAL(triggered()), connection_dialog, SLOT(exec())); connect(connection_dialog, SIGNAL(accepted()), this, SLOT(startConnection())); config_dialog = new ConfigDialog(this); connect(ui->actionConfigure, SIGNAL(triggered()), config_dialog, SLOT(show())); connect(config_dialog, SIGNAL(bg_changed()), this, SLOT(changeBackground())); connect(config_dialog, SIGNAL(tableBg_changed()), this, SLOT(changeBackground())); connect(ui->actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui->actionAcknowledgement_2, SIGNAL(triggered()), this, SLOT(on_actionAcknowledgement_triggered())); StartScene *start_scene = new StartScene(this); QList<QAction *> actions; actions << ui->actionStart_Game << ui->actionStart_Server << ui->actionPC_Console_Start << ui->actionReplay << ui->actionConfigure << ui->actionGeneral_Overview << ui->actionCard_Overview << ui->actionAbout; foreach(QAction *action, actions) start_scene->addButton(action); #if defined(Q_OS_WIN) || defined(Q_OS_ANDROID) ui->menuSumMenu->setAttribute(Qt::WA_TranslucentBackground); ui->menuGame->setAttribute(Qt::WA_TranslucentBackground); ui->menuView->setAttribute(Qt::WA_TranslucentBackground); ui->menuOptions->setAttribute(Qt::WA_TranslucentBackground); ui->menuDIY->setAttribute(Qt::WA_TranslucentBackground); ui->menuCheat->setAttribute(Qt::WA_TranslucentBackground); ui->menuHelp->setAttribute(Qt::WA_TranslucentBackground); #endif view = new FitView(scene); setCentralWidget(view); restoreFromConfig(); roundCorners(); BackLoader::preload(); gotoScene(start_scene); addAction(ui->actionFullscreen); #if defined(Q_OS_WIN) || defined(Q_OS_ANDROID) menu = new QPushButton(this); menu->setMenu(ui->menuSumMenu); menu->setProperty("control", true); StyleHelper::getInstance()->setIcon(menu, QChar(0xf0c9), 15); menu->setToolTip(tr("<font color=%1>Config</font>").arg(Config.SkillDescriptionInToolTipColor.name())); #endif #if defined(Q_OS_WIN) minButton = new QPushButton(this); minButton->setProperty("control", true); maxButton = new QPushButton(this); maxButton->setProperty("bold", true); maxButton->setProperty("control", true); normalButton = new QPushButton(this); normalButton->setProperty("bold", true); normalButton->setProperty("control", true); closeButton= new QPushButton(this); closeButton->setObjectName("closeButton"); closeButton->setProperty("control", true); StyleHelper::getInstance()->setIcon(minButton, QChar(0xf068), 15); StyleHelper::getInstance()->setIcon(maxButton, QChar(0xf106), 15); StyleHelper::getInstance()->setIcon(normalButton, QChar(0xf107), 15); StyleHelper::getInstance()->setIcon(closeButton, QChar(0xf00d), 15); minButton->setToolTip(tr("<font color=%1>Minimize</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(minButton, SIGNAL(clicked()), this, SLOT(showMinimized())); maxButton->setToolTip(tr("<font color=%1>Maximize</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(maxButton, SIGNAL(clicked()), this, SLOT(showMaximized())); normalButton->setToolTip(tr("<font color=%1>Restore downward</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(normalButton, SIGNAL(clicked()), this, SLOT(showNormal())); closeButton->setToolTip(tr("<font color=%1>Close</font>").arg(Config.SkillDescriptionInToolTipColor.name())); connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); menuBar()->hide(); #elif defined(Q_OS_ANDROID) ui->menuSumMenu->removeAction(ui->menuView->menuAction()); #endif repaintButtons(); #ifndef Q_OS_ANDROID QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); animation->setDuration(1000); animation->setStartValue(0); animation->setEndValue(1); animation->setEasingCurve(QEasingCurve::OutCurve); animation->start(QAbstractAnimation::DeleteWhenStopped); #endif start_scene->showOrganization(); systray = NULL; }