Changeset c8ed26ddf1 in tspsg
- 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)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/desktop.qrc
r7e8e1b444d rc8ed26ddf1 15 15 <file>icons/128x128/document-save.png</file> 16 16 <file>icons/128x128/document-save-as.png</file> 17 <file>icons/128x128/format-fill-color.png</file>18 17 <file>icons/128x128/format-stroke-color.png</file> 19 18 <file>icons/128x128/format-text-color.png</file> -
resources/handheld.qrc
r7e8e1b444d rc8ed26ddf1 8 8 <file>icons/48x48/document-save.png</file> 9 9 <file>icons/48x48/document-save-as.png</file> 10 <file>icons/48x48/format-fill-color.png</file>11 10 <file>icons/48x48/format-stroke-color.png</file> 12 11 <file>icons/48x48/format-text-color.png</file> -
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 -
ui/settingsdialog.ui
r7e8e1b444d rc8ed26ddf1 618 618 <item> 619 619 <widget class="QLabel" name="labelSelectedColor"> 620 <property name="enabled">621 <bool>false</bool>622 </property>623 620 <property name="sizePolicy"> 624 621 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> … … 637 634 <item> 638 635 <widget class="QFrame" name="boxSelectedColor"> 639 <property name="enabled">640 <bool>false</bool>641 </property>642 636 <property name="sizePolicy"> 643 637 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> … … 665 659 <item> 666 660 <widget class="QPushButton" name="buttonSelectedColor"> 667 <property name="enabled">668 <bool>false</bool>669 </property>670 661 <property name="cursor"> 671 662 <cursorShape>PointingHandCursor</cursorShape> … … 682 673 <item> 683 674 <widget class="QLabel" name="labelAlternateColor"> 684 <property name="enabled">685 <bool>false</bool>686 </property>687 675 <property name="sizePolicy"> 688 676 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> … … 701 689 <item> 702 690 <widget class="QFrame" name="boxAlternateColor"> 703 <property name="enabled">704 <bool>false</bool>705 </property>706 691 <property name="sizePolicy"> 707 692 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> … … 729 714 <item> 730 715 <widget class="QPushButton" name="buttonAlternateColor"> 731 <property name="enabled">732 <bool>false</bool>733 </property>734 716 <property name="cursor"> 735 717 <cursorShape>PointingHandCursor</cursorShape> … … 746 728 <item> 747 729 <widget class="QLabel" name="labelBorderColor"> 748 <property name="enabled">749 <bool>false</bool>750 </property>751 730 <property name="sizePolicy"> 752 731 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> … … 765 744 <item> 766 745 <widget class="QFrame" name="boxBorderColor"> 767 <property name="enabled">768 <bool>false</bool>769 </property>770 746 <property name="sizePolicy"> 771 747 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> … … 793 769 <item> 794 770 <widget class="QPushButton" name="buttonBorderColor"> 795 <property name="enabled">796 <bool>false</bool>797 </property>798 771 <property name="cursor"> 799 772 <cursorShape>PointingHandCursor</cursorShape> … … 801 774 <property name="statusTip"> 802 775 <string>Change color of table borders</string> 803 </property>804 </widget>805 </item>806 </layout>807 </item>808 <item>809 <layout class="QHBoxLayout" name="_16">810 <item>811 <widget class="QLabel" name="labelBgColor">812 <property name="enabled">813 <bool>false</bool>814 </property>815 <property name="sizePolicy">816 <sizepolicy hsizetype="Expanding" vsizetype="Preferred">817 <horstretch>0</horstretch>818 <verstretch>0</verstretch>819 </sizepolicy>820 </property>821 <property name="statusTip">822 <string>Background color for solution output</string>823 </property>824 <property name="text">825 <string>Background color:</string>826 </property>827 </widget>828 </item>829 <item>830 <widget class="QFrame" name="boxBgColor">831 <property name="enabled">832 <bool>false</bool>833 </property>834 <property name="sizePolicy">835 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">836 <horstretch>0</horstretch>837 <verstretch>0</verstretch>838 </sizepolicy>839 </property>840 <property name="minimumSize">841 <size>842 <width>15</width>843 <height>15</height>844 </size>845 </property>846 <property name="statusTip">847 <string>Background color for solution output</string>848 </property>849 <property name="autoFillBackground">850 <bool>true</bool>851 </property>852 <property name="frameShape">853 <enum>QFrame::Box</enum>854 </property>855 </widget>856 </item>857 <item>858 <widget class="QPushButton" name="buttonBgColor">859 <property name="enabled">860 <bool>false</bool>861 </property>862 <property name="cursor">863 <cursorShape>PointingHandCursor</cursorShape>864 </property>865 <property name="statusTip">866 <string>Change background color</string>867 776 </property> 868 777 </widget>
Note: See TracChangeset
for help on using the changeset viewer.