Changeset 0a4e16b182 in tspsg


Ignore:
Timestamp:
May 31, 2011, 2:01:38 PM (13 years ago)
Author:
Oleksii Serdiuk
Branches:
appveyor, imgbot, master, readme
Children:
b2be4c19a1
Parents:
9f5cc00f29
git-author:
Oleksii Serdiuk <contacts@…> (05/31/11 14:01:38)
git-committer:
Oleksii Serdiuk <contacts@…> (06/29/12 19:46:00)
Message:

Added a border to tables in the solution output. Looks more readable
with long numbers, now. The border color can be controlled through
Output/Colors/TableBorder? setting in tspsg.ini. It is in #RRGGBB format.

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/defaults.h

    r9f5cc00f29 r0a4e16b182  
    110110#define DEF_TEXT_COLOR QPalette().color(QPalette::Text)
    111111//! Default selected candidate color
    112 #define DEF_SELECTED_COLOR QColor(0x008000)
     112#define DEF_SELECTED_COLOR "#008000"
    113113//! Default alternate candidate color
    114 #define DEF_ALTERNATE_COLOR QColor(0xA00000)
     114#define DEF_ALTERNATE_COLOR "#A00000"
     115//! Default table border color
     116#define DEF_TABLE_COLOR "#EEEEEE"
    115117
    116118#ifndef QT_NO_PRINTER
  • src/mainwindow.cpp

    r9f5cc00f29 r0a4e16b182  
    12831283    fmt_lastparagraph.setLeftMargin(10);
    12841284
     1285    settings->beginGroup("Output/Colors");
     1286
    12851287    fmt_table.setTopMargin(5);
    12861288    fmt_table.setRightMargin(10);
    12871289    fmt_table.setBottomMargin(0);
    12881290    fmt_table.setLeftMargin(10);
    1289     fmt_table.setBorder(0);
    1290     fmt_table.setBorderStyle(QTextFrameFormat::BorderStyle_None);
    1291     fmt_table.setCellSpacing(5);
     1291    fmt_table.setBorder(1);
     1292    fmt_table.setBorderBrush(QBrush(QColor(settings->value("TableBorder", DEF_TABLE_COLOR).toString())));
     1293    fmt_table.setBorderStyle(QTextFrameFormat::BorderStyle_Solid);
     1294    fmt_table.setCellSpacing(0);
     1295    fmt_table.setCellPadding(2);
    12921296
    12931297    fmt_cell.setAlignment(Qt::AlignHCenter);
    12941298
    1295     settings->beginGroup("Output/Colors");
    1296 
    1297 QColor color = qvariant_cast<QColor>(settings->value("Text", DEF_TEXT_COLOR));
     1299QColor color = QColor(settings->value("Text", DEF_TEXT_COLOR).toString());
    12981300QColor hilight;
    12991301    if (color.value() < 192)
     
    13051307    fmt_default.setForeground(QBrush(color));
    13061308
    1307     fmt_selected.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Selected", DEF_SELECTED_COLOR))));
     1309    fmt_selected.setForeground(QBrush(QColor(settings->value("Selected", DEF_SELECTED_COLOR).toString())));
    13081310    fmt_selected.setFontWeight(QFont::Bold);
    13091311
    1310     fmt_alternate.setForeground(QBrush(qvariant_cast<QColor>(settings->value("Alternate", DEF_ALTERNATE_COLOR))));
     1312    fmt_alternate.setForeground(QBrush(QColor(settings->value("Alternate", DEF_ALTERNATE_COLOR).toString())));
    13111313    fmt_alternate.setFontWeight(QFont::Bold);
    13121314    fmt_altlist.setForeground(QBrush(hilight));
  • src/settingsdialog.cpp

    r9f5cc00f29 r0a4e16b182  
    288288
    289289    font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)));
    290     color = qvariant_cast<QColor>(settings->value("Colors/Text", DEF_TEXT_COLOR));
     290    color = QColor(settings->value("Colors/Text", DEF_TEXT_COLOR).toString());
    291291    settings->endGroup();
    292292
     
    395395        settings->setValue("Font", font);
    396396    if (_newColor)
    397         settings->setValue("Colors/Text", color);
     397        settings->setValue("Colors/Text", color.name());
    398398    settings->endGroup();
    399399    QDialog::accept();
Note: See TracChangeset for help on using the changeset viewer.