Changeset c8ed26ddf1 in tspsg for src
- Timestamp:
- Jul 17, 2012, 8:11:11 PM (12 years ago)
- Branches:
- appveyor, imgbot, master, readme
- Children:
- 50b614b0ea
- Parents:
- 7e8e1b444d
- git-author:
- Oleksii Serdiuk <contacts@…> (07/17/12 20:11:11)
- git-committer:
- Oleksii Serdiuk <contacts@…> (07/17/12 20:24:34)
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/defaults.h
r7e8e1b444d rc8ed26ddf1 115 115 //! Default table border color 116 116 #define DEF_TABLE_COLOR QPalette().color(QPalette::AlternateBase) 117 // ! Default solution background color118 #define DEF_BACKGROUND_COLOR QPalette().color(QPalette::Base)117 ////! Default solution background color 118 //#define DEF_BACKGROUND_COLOR QPalette().color(QPalette::Base) 119 119 120 120 #ifndef QT_NO_PRINTER -
src/mainwindow.cpp
r7e8e1b444d rc8ed26ddf1 303 303 304 304 html.replace(QRegExp("font-family:([^;]*);"), "font-family:\\1, 'DejaVu Sans Mono', 'Courier New', Courier, monospace;"); 305 html.replace(QRegExp("<style ([^>]*)>"), QString("<style \\1>\n" 306 "body { color: %1 }\n" 307 "td { border-style: solid; border-width: 1px; border-color: %2; }") 308 .arg(settings->value("Output/Colors/Font", DEF_TEXT_COLOR).toString(), 309 settings->value("Output/Colors/TableBorder", DEF_TABLE_COLOR).toString())); 305 310 306 311 if (!graph.isNull()) { … … 1002 1007 pic.end(); 1003 1008 1004 QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_RGB32);1005 i.fill( 0xFFFFFF);1009 QImage i(graph.width() + 2, graph.height() + 2, QImage::Format_ARGB32); 1010 i.fill(QColor(255, 255, 255, 0)); 1006 1011 pic.begin(&i); 1007 1012 pic.drawPicture(1, 1, graph); … … 1319 1324 1320 1325 settings->endGroup(); 1321 1322 solutionText->setTextColor(color);1323 1326 } 1324 1327 -
src/settingsdialog.cpp
r7e8e1b444d rc8ed26ddf1 52 52 buttonAlternateColor->setIcon(GET_ICON("format-text-color")); 53 53 buttonBorderColor->setIcon(GET_ICON("format-stroke-color")); 54 buttonBgColor->setIcon(GET_ICON("format-fill-color"));54 // buttonBgColor->setIcon(GET_ICON("format-fill-color")); 55 55 buttonFont->setIcon(GET_ICON("preferences-desktop-font")); 56 56 buttonHelp->setIcon(GET_ICON("help-hint")); … … 217 217 connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked())); 218 218 connect(buttonTextColor, SIGNAL(clicked()), SLOT(buttonTextColorClicked())); 219 connect(buttonSelectedColor, SIGNAL(clicked()), SLOT(buttonSelectedColorClicked())); 220 connect(buttonAlternateColor, SIGNAL(clicked()), SLOT(buttonAlternateColorClicked())); 221 connect(buttonBorderColor, SIGNAL(clicked()), SLOT(buttonBorderColorClicked())); 222 // connect(buttonBgColor, SIGNAL(clicked()), SLOT(buttonBgColorClicked())); 219 223 setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); 220 224 #if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD) … … 295 299 selColor = QColor(settings->value("Colors/Selected", DEF_SELECTED_COLOR).toString()); 296 300 altColor = QColor(settings->value("Colors/Alternate", DEF_ALTERNATE_COLOR).toString()); 297 borderColor = QColor(settings->value("Colors/ Border", DEF_TABLE_COLOR).toString());298 bgColor = QColor(settings->value("Colors/Background", DEF_BACKGROUND_COLOR).toString());301 borderColor = QColor(settings->value("Colors/TableBorder", DEF_TABLE_COLOR).toString()); 302 // bgColor = QColor(settings->value("Colors/Background", DEF_BACKGROUND_COLOR).toString()); 299 303 settings->endGroup(); 300 304 … … 304 308 labelFontExample->setText(font.family()); 305 309 306 p = boxTextColor->palette(); 307 p.setColor(QPalette::Window, textColor); 308 boxTextColor->setPalette(p); 309 310 p = boxSelectedColor->palette(); 311 p.setColor(QPalette::Window, selColor); 312 boxSelectedColor->setPalette(p); 313 314 p = boxAlternateColor->palette(); 315 p.setColor(QPalette::Window, altColor); 316 boxAlternateColor->setPalette(p); 317 318 p = boxBorderColor->palette(); 319 p.setColor(QPalette::Window, borderColor); 320 boxBorderColor->setPalette(p); 321 322 p = boxBgColor->palette(); 323 p.setColor(QPalette::Window, bgColor); 324 boxBgColor->setPalette(p); 310 setBgColor(boxTextColor, textColor); 311 setBgColor(boxSelectedColor, selColor); 312 setBgColor(boxAlternateColor, altColor); 313 setBgColor(boxBorderColor, borderColor); 314 // setBgColor(boxBgColor, bgColor); 325 315 326 316 #ifdef HANDHELD … … 427 417 if (_fontChanged) 428 418 settings->setValue("Font", font); 429 if (_colorChanged) 430 settings->setValue("Colors/Text", textColor.name()); 419 if (_colorChanged) { 420 settings->beginGroup("Colors"); 421 if (textColor != DEF_TEXT_COLOR) 422 settings->setValue("Text", textColor.name()); 423 else 424 settings->remove("Text"); 425 if (selColor != QColor(DEF_SELECTED_COLOR)) 426 settings->setValue("Selected", selColor.name()); 427 else 428 settings->remove("Selected"); 429 if (altColor != DEF_ALTERNATE_COLOR) 430 settings->setValue("Alternate",altColor.name()); 431 else 432 settings->remove("Alternate"); 433 if (borderColor != DEF_TABLE_COLOR) 434 settings->setValue("TableBorder", borderColor.name()); 435 else 436 settings->remove("TableColor"); 437 // if (bgColor != DEF_BACKGROUND_COLOR) 438 // settings->setValue("Background", bgColor.name()); 439 // else 440 // settings->remove("Background"); 441 settings->endGroup(); 442 } 431 443 settings->endGroup(); 432 444 QDialog::accept(); 433 445 } 434 446 447 void SettingsDialog::pickColor(QColor &where) 448 { 449 QColor color = QColorDialog::getColor(where, this); 450 if (color.isValid() && (where != color)) { 451 where = color; 452 _colorChanged = true; 453 } 454 } 455 456 void SettingsDialog::setBgColor(QWidget *widget, const QColor &color) 457 { 458 QPalette p = widget->palette(); 459 p.setColor(QPalette::Window, color); 460 widget->setPalette(p); 461 } 462 435 463 void SettingsDialog::buttonTextColorClicked() 436 464 { 437 QColor color = QColorDialog::getColor(this->textColor,this); 438 if (color.isValid() && (this->textColor != color)) { 439 this->textColor = color; 440 _colorChanged = true; 441 } 442 } 465 pickColor(textColor); 466 setBgColor(boxTextColor, textColor); 467 } 468 469 void SettingsDialog::buttonSelectedColorClicked() 470 { 471 pickColor(selColor); 472 setBgColor(boxSelectedColor, selColor); 473 } 474 475 void SettingsDialog::buttonAlternateColorClicked() 476 { 477 pickColor(altColor); 478 setBgColor(boxAlternateColor, altColor); 479 } 480 481 void SettingsDialog::buttonBorderColorClicked() 482 { 483 pickColor(borderColor); 484 setBgColor(boxBorderColor, borderColor); 485 } 486 487 //void SettingsDialog::buttonBgColorClicked() 488 //{ 489 // pickColor(bgColor); 490 // setBgColor(boxBgColor, bgColor); 491 //} 443 492 444 493 void SettingsDialog::buttonFontClicked() -
src/settingsdialog.h
r7e8e1b444d rc8ed26ddf1 72 72 QLabel *labelHint; 73 73 74 void pickColor(QColor &where); 75 void setBgColor(QWidget *widget, const QColor &color); 76 74 77 #ifndef QT_NO_STATUSTIP 75 78 bool event(QEvent *ev); … … 80 83 void accept(); 81 84 void buttonTextColorClicked(); 85 void buttonSelectedColorClicked(); 86 void buttonAlternateColorClicked(); 87 void buttonBorderColorClicked(); 88 // void buttonBgColorClicked(); 82 89 void buttonFontClicked(); 83 90 #ifdef Q_WS_WINCE_WM
Note: See TracChangeset
for help on using the changeset viewer.