Changeset 119 in tspsg-svn for trunk/src/mainwindow.cpp


Ignore:
Timestamp:
May 3, 2010, 4:35:38 PM (15 years ago)
Author:
laleppa
Message:
  • Improved the default font selection logic: The system default monospace (desktop systems)/sans-serif (handheld devices) font is now selected.
  • Two icons were mixed. Corrected this.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mainwindow.cpp

    r118 r119  
    621621                pic.begin(&graph);
    622622                pic.setRenderHint(QPainter::Antialiasing);
    623                 pic.setFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, 9)).value<QFont>());
     623                pic.setFont(settings->value("Output/Font", QFont(getDefaultFont(), 9)).value<QFont>());
    624624                pic.setBrush(QBrush(QColor(Qt::white)));
    625625                pic.setBackgroundMode(Qt::OpaqueMode);
     
    936936void MainWindow::initDocStyleSheet()
    937937{
    938         solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>());
     938        solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(getDefaultFont(), DEF_FONT_SIZE)).value<QFont>());
    939939
    940940        fmt_paragraph.setTopMargin(0);
     
    953953        fmt_cell.setAlignment(Qt::AlignHCenter);
    954954
    955 QColor color = settings->value("Output/Colors/Text", DEF_TEXT_COLOR).value<QColor>();
     955        settings->beginGroup("Output/Colors");
     956
     957QColor color = settings->value("Text", DEF_TEXT_COLOR).value<QColor>();
    956958QColor hilight;
    957959        if (color.value() < 192)
     
    963965        fmt_default.setForeground(QBrush(color));
    964966
    965         fmt_selected.setForeground(QBrush(settings->value("Output/Colors/Selected", DEF_SELECTED_COLOR).value<QColor>()));
     967        fmt_selected.setForeground(QBrush(settings->value("Selected", DEF_SELECTED_COLOR).value<QColor>()));
    966968        fmt_selected.setFontWeight(QFont::Bold);
    967969
    968         fmt_alternate.setForeground(QBrush(settings->value("Output/Colors/Alternate", DEF_ALTERNATE_COLOR).value<QColor>()));
     970        fmt_alternate.setForeground(QBrush(settings->value("Alternate", DEF_ALTERNATE_COLOR).value<QColor>()));
    969971        fmt_alternate.setFontWeight(QFont::Bold);
    970972        fmt_altlist.setForeground(QBrush(hilight));
     973
     974        settings->endGroup();
    971975
    972976        solutionText->setTextColor(color);
     
    11661170        loadToolbarList();
    11671171
    1168 #ifndef HANDHELD
    1169         actionSettingsToolbarsConfigure->setText(tr("Configure..."));
    1170         actionSettingsToolbarsConfigure->setToolTip(tr("Customize toolbars"));
    1171 #endif // HANDHELD
    1172 
    11731172#ifndef QT_NO_PRINTER
    11741173        actionFilePrintPreview->setText(tr("P&rint Preview..."));
     
    11891188        actionFilePrint->setShortcut(tr("Ctrl+P"));
    11901189#endif // QT_NO_PRINTER
     1190
     1191#ifndef HANDHELD
     1192        actionSettingsToolbarsConfigure->setText(tr("Configure..."));
     1193#ifndef QT_NO_STATUSTIP
     1194        actionSettingsToolbarsConfigure->setStatusTip(tr("Customize toolbars"));
     1195#endif // QT_NO_STATUSTIP
     1196#endif // HANDHELD
     1197
    11911198#ifdef Q_OS_WIN32
    11921199        actionHelpCheck4Updates->setText(tr("Check for &Updates..."));
    1193 #ifndef QT_NO_TOOLTIP
    1194         actionHelpCheck4Updates->setToolTip(tr("Check for %1 updates").arg(QApplication::applicationName()));
    1195 #endif // QT_NO_TOOLTIP
    11961200#ifndef QT_NO_STATUSTIP
    11971201        actionHelpCheck4Updates->setStatusTip(tr("Check for %1 updates").arg(QApplication::applicationName()));
     
    12651269        }
    12661270
    1267         solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>());
     1271//      solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>());
    12681272        solutionText->setWordWrapMode(QTextOption::WordWrap);
    12691273
Note: See TracChangeset for help on using the changeset viewer.