Beispiel #1
0
void client_togglefullscreen(struct WM_t *W, struct wmclient *C)
{
    if (!C->fullscreen)
        maximise(W, C);
    else
        unmaximise(W, C);
}
Beispiel #2
0
/*!
  Main view's constructor, full of important stuff.

  Sets all global properties, sizing policy, connects important
  signals and slots, reads config file(s).
  */
CcfMain::CcfMain(CcfCommandLineParser *cmd, QWindow *parent) :
    QQuickView(parent), CcfError(), mCmdLnParser(cmd)
{
    qmlRegisterType<CcfQmlBaseRosterMenu>("QmlBase", 0, 1, "BaseRosterMenu");
    qmlRegisterType<CcfQmlBaseScenario>("QmlBase", 0, 1, "BaseScenario");
    qmlRegisterType<CcfQmlBaseMap>("QmlBase", 0, 1, "Map");
    qmlRegisterType<CcfQmlBaseUnit>("QmlBase", 0, 1, "BaseUnit");
    qmlRegisterType<CcfQmlBaseSoldier>("QmlBase", 0, 1, "Soldier");

    mLogger = new CcfLogger(this, mCmdLnParser->isDebug());
    mGlobal = new CcfGlobal(this);
    mGameManager = new CcfGameManager(this);
    mEngineHelpers = new CcfEngineHelpers(this);
    initConfiguration();

    rootContext()->setContextProperty("Global", mGlobal);
    rootContext()->setContextProperty("Config", mConfiguration);
    rootContext()->setContextProperty("GameManager", mGameManager);
    rootContext()->setContextProperty("EngineHelpers", mEngineHelpers);
    rootContext()->setContextProperty("Logger", mLogger);

    QString pwd = qApp->applicationDirPath() + "/";
    rootContext()->setContextProperty("PWD", pwd);

    setResizeMode(QQuickView::SizeRootObjectToView);
//    connect(this, SIGNAL(sceneResized(QSize)), configuration, SLOT(windowResized(QSize)));
    connect(mConfiguration, SIGNAL(sizeModifiedInGame(int,int)), this, SLOT(forceViewportResize(int,int)));
    connect(engine(), SIGNAL(quit()), this, SLOT(quit()));
    connect(mConfiguration, SIGNAL(maximise()), this, SLOT(showMaximized()));
    connect(mConfiguration, SIGNAL(demaximise()), this, SLOT(showNormal()));
    connect(mGlobal, SIGNAL(disableQrc(QObject*)), this, SLOT(disableQrc(QObject*)));
}
Beispiel #3
0
/*!
  Sets maximised configuration value to \a newValue.

  \sa maximised
  */
void CcfConfig::setMaximised(bool newValue)
{
//    QString current = configuration->value("maximised").first;
//    bool currentBool = stringToBool(current);
    bool currentBool = isMaximised();

    if (currentBool != newValue) {
        mConfiguration->replace("maximised", boolToString(newValue));
        emit maximisedChanged();
        if (newValue)
            emit maximise();
        else
            emit demaximise();
    }
}