Beispiel #1
0
void DialogVersionCheck::setup(QString localAppVersion, QString remoteAppVersion, QString localEngineVersion, QString remoteEngineVersion, QString note){


    QString appFont("<font color=\"red\">");
    if(localAppVersion == remoteAppVersion)
        appFont = "<font color=\"green\">";

    ui->label_localAppVersion->setText(appFont + localAppVersion + "</font>");
    ui->label_remoteAppVersion->setText(appFont + remoteAppVersion + "</font>");

    QString engineFont("<font color=\"red\">");
    if(localEngineVersion == remoteEngineVersion)
        engineFont = "<font color=\"green\">";

    ui->label_localEngineVersion->setText(engineFont + localEngineVersion + "</font>");
    ui->label_remoteEngineVersion->setText(engineFont + remoteEngineVersion + "</font>");
    ui->label_note->setText(note);

    ui->label_application->setVisible(localAppVersion != remoteAppVersion);

    ui->updateEngineButton->setVisible(localEngineVersion != remoteEngineVersion);
    ui->progressBar->setVisible( false );
    ui->finishUpdateButton->setVisible( false );
    ui->label_error->setVisible( false );
}
Beispiel #2
0
QFont Style::getFont(Style::Font font)
{
    // fonts as defined in
    // https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md

    static int defSize = QFontInfo(QFont()).pixelSize();

    static QFont fonts[] = {
        appFont(defSize + 3, QFont::Bold),   // extra big
        appFont(defSize + 1, QFont::Normal), // big
        appFont(defSize + 1, QFont::Bold),   // big bold
        appFont(defSize, QFont::Normal),     // medium
        appFont(defSize, QFont::Bold),       // medium bold
        appFont(defSize - 1, QFont::Normal), // small
        appFont(defSize - 1, QFont::Light),  // small light
    };

    return fonts[font];
}
Beispiel #3
0
QFont Style::getFont(Style::Font font)
{
    // fonts as defined in
    // https://github.com/ItsDuke/Tox-UI/blob/master/UI%20GUIDELINES.md

    static int defSize = QFontInfo(QFont()).pixelSize();

    static QFont fonts[] = {
        appFont(defSize + 2, QFont::Bold),
        appFont(defSize    , QFont::Normal),
        appFont(defSize    , QFont::Bold),
        appFont(defSize - 1, QFont::Normal),
        appFont(defSize - 1, QFont::Bold),
        appFont(defSize - 2, QFont::Normal),
        appFont(defSize - 2, QFont::Light),
    };

    return fonts[font];
}