Changeset 119 in tspsg-svn for trunk/src


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.
Location:
trunk/src
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/qttoolbardialog-2.2_1-opensource/src/images/icons/go-up.png

  • trunk/src/3rdparty/qttoolbardialog-2.2_1-opensource/src/qttoolbardialog.qrc

    r118 r119  
    33        <file>images/icons/go-down.png</file>
    44        <file>images/icons/go-next.png</file>
    5         <file>images/icons/go-previous.png</file>
     5        <file>images/icons/go-up.png</file>
    66        <file>images/icons/list-add.png</file>
    77        <file>images/icons/list-remove.png</file>
  • trunk/src/defaults.h

    r116 r119  
    7878#define DEF_SCROLL_TO_END false
    7979/*!
    80  * \def DEF_FONT_FAMILY
    81  * \brief Default font name.
    82  */
    83 #ifdef Q_OS_WINCE_WM
    84         #define DEF_FONT_FAMILY "Tahoma"
    85 #else
    86         #define DEF_FONT_FAMILY "monospace"
    87 #endif // Q_OS_WINCE_WM
    88 /*!
    8980 * \def DEF_FONT_SIZE
    9081 * \brief Default font size
  • trunk/src/globals.h

    r118 r119  
    108108}
    109109
     110/*!
     111 * \brief Returns the default font for solution output.
     112 * \return The family name of the default font.
     113 */
     114inline QString getDefaultFont()
     115{
     116QFont f;
     117#ifdef HANDHELD
     118        f.setStyleHint(QFont::SansSerif);
     119#else // HANDHELD
     120        f.setStyleHint(QFont::TypeWriter);
     121#endif // HANDHELD
     122        return f.defaultFamily();
     123}
     124
    110125#ifdef Q_OS_WIN32
    111126/*!
  • 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
  • trunk/src/settingsdialog.cpp

    r117 r119  
    223223        cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
    224224
    225         font = settings->value("Font",QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE)).value<QFont>();
     225        font = settings->value("Font", QFont(getDefaultFont(), DEF_FONT_SIZE)).value<QFont>();
    226226        color = settings->value("Colors/Text", DEF_TEXT_COLOR).value<QColor>();
    227227        settings->endGroup();
     
    269269        if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
    270270                if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
    271                         _newFont = (font != QFont(DEF_FONT_FAMILY, DEF_FONT_SIZE));
     271                        _newFont = (font != QFont(getDefaultFont(), DEF_FONT_SIZE));
    272272                        _newColor = (color != DEF_TEXT_COLOR);
    273273                        settings->remove("");
Note: See TracChangeset for help on using the changeset viewer.