Changeset a09f31733a in tspsg
- Timestamp:
- Jul 16, 2012, 1:05:35 AM (12 years ago)
- Branches:
- appveyor, imgbot, master, readme
- Children:
- 95c1897bf1
- Parents:
- ff8d0488a0
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/desktop.qrc
rff8d0488a0 ra09f31733a 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 <file>icons/128x128/format-stroke-color.png</file> 17 19 <file>icons/128x128/format-text-color.png</file> 18 20 <file>icons/128x128/go-previous.png</file> -
resources/handheld.qrc
rff8d0488a0 ra09f31733a 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 <file>icons/48x48/format-stroke-color.png</file> 10 12 <file>icons/48x48/format-text-color.png</file> 11 13 <file>icons/48x48/go-previous.png</file> -
src/defaults.h
rff8d0488a0 ra09f31733a 107 107 # define DEF_FONT_SIZE 10 108 108 #endif // Q_WS_S60 109 //! Default text color109 //! Default solution text color 110 110 #define DEF_TEXT_COLOR QPalette().color(QPalette::Text) 111 111 //! Default selected candidate color … … 114 114 #define DEF_ALTERNATE_COLOR "#A00000" 115 115 //! Default table border color 116 #define DEF_TABLE_COLOR "#EEEEEE" 116 #define DEF_TABLE_COLOR QPalette().color(QPalette::AlternateBase) 117 //! Default solution background color 118 #define DEF_BACKGROUND_COLOR QPalette().color(QPalette::Base) 117 119 118 120 #ifndef QT_NO_PRINTER -
src/settingsdialog.cpp
rff8d0488a0 ra09f31733a 31 31 */ 32 32 SettingsDialog::SettingsDialog(QWidget *parent) 33 : QDialog(parent), _ newFont(false), _newColor(false), _translucency(0)33 : QDialog(parent), _fontChanged(false), _colorChanged(false), _translucency(0) 34 34 { 35 35 setupUi(this); … … 48 48 buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor)); 49 49 50 buttonColor->setIcon(GET_ICON("format-text-color")); 50 buttonTextColor->setIcon(GET_ICON("format-text-color")); 51 buttonSelectedColor->setIcon(GET_ICON("format-text-color")); 52 buttonAlternateColor->setIcon(GET_ICON("format-text-color")); 53 buttonBorderColor->setIcon(GET_ICON("format-stroke-color")); 54 buttonBgColor->setIcon(GET_ICON("format-fill-color")); 51 55 buttonFont->setIcon(GET_ICON("preferences-desktop-font")); 52 56 buttonHelp->setIcon(GET_ICON("help-hint")); … … 212 216 connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int))); 213 217 connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked())); 214 connect(button Color, SIGNAL(clicked()), SLOT(buttonColorClicked()));218 connect(buttonTextColor, SIGNAL(clicked()), SLOT(buttonTextColorClicked())); 215 219 setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint); 216 220 #if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD) … … 288 292 289 293 font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE))); 290 color = QColor(settings->value("Colors/Text", DEF_TEXT_COLOR).toString()); 294 textColor = QColor(settings->value("Colors/Text", DEF_TEXT_COLOR).toString()); 295 selColor = QColor(settings->value("Colors/Selected", DEF_SELECTED_COLOR).toString()); 296 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()); 291 299 settings->endGroup(); 300 301 QFont f = font; 302 f.setPointSize(labelFontExample->font().pointSize()); 303 labelFontExample->setFont(f); 304 labelFontExample->setText(font.family()); 305 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); 292 325 293 326 #ifdef HANDHELD … … 304 337 bool SettingsDialog::colorChanged() const 305 338 { 306 return _ newColor;339 return _colorChanged; 307 340 } 308 341 … … 313 346 bool SettingsDialog::fontChanged() const 314 347 { 315 return _ newFont;348 return _fontChanged; 316 349 } 317 350 … … 333 366 if (QApplication::keyboardModifiers() & Qt::ShiftModifier) { 334 367 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) { 335 _ newFont= (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE));336 _ newColor = (color != DEF_TEXT_COLOR);368 _fontChanged = (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE)); 369 _colorChanged = (textColor != DEF_TEXT_COLOR); 337 370 settings->remove(""); 338 371 settings->setValue("SettingsReset", true); … … 392 425 settings->setValue("ShowMatrixLimit", spinCitiesLimit->value()); 393 426 settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked()); 394 if (_ newFont)427 if (_fontChanged) 395 428 settings->setValue("Font", font); 396 if (_ newColor)397 settings->setValue("Colors/Text", color.name());429 if (_colorChanged) 430 settings->setValue("Colors/Text", textColor.name()); 398 431 settings->endGroup(); 399 432 QDialog::accept(); 400 433 } 401 434 402 void SettingsDialog::button ColorClicked()403 { 404 QColor color = QColorDialog::getColor(this-> color,this);405 if (color.isValid() && (this-> color != color)) {406 this-> color = color;407 _ newColor= true;435 void SettingsDialog::buttonTextColorClicked() 436 { 437 QColor color = QColorDialog::getColor(this->textColor,this); 438 if (color.isValid() && (this->textColor != color)) { 439 this->textColor = color; 440 _colorChanged = true; 408 441 } 409 442 } … … 412 445 { 413 446 bool ok; 414 QFont font = QFontDialog::getFont(&ok, this->font,this);447 QFont font = QFontDialog::getFont(&ok, this->font, this); 415 448 if (ok && (this->font != font)) { 416 449 this->font = font; 417 _newFont = true; 450 QFont f = font; 451 f.setPointSize(labelFontExample->font().pointSize()); 452 labelFontExample->setFont(f); 453 labelFontExample->setText(font.family()); 454 _fontChanged = true; 418 455 } 419 456 } -
src/settingsdialog.h
rff8d0488a0 ra09f31733a 47 47 48 48 private: 49 bool _ newFont;50 bool _ newColor;49 bool _fontChanged; 50 bool _colorChanged; 51 51 qint8 _translucency; 52 52 53 QColor color;53 QColor textColor, selColor, altColor, borderColor, bgColor; 54 54 QFont font; 55 55 … … 79 79 private slots: 80 80 void accept(); 81 void button ColorClicked();81 void buttonTextColorClicked(); 82 82 void buttonFontClicked(); 83 83 #ifdef Q_WS_WINCE_WM -
ui/settingsdialog.ui
rff8d0488a0 ra09f31733a 302 302 <string>General</string> 303 303 </attribute> 304 <attribute name="toolTip"> 305 <string>General solution output settings</string> 306 </attribute> 304 307 <layout class="QVBoxLayout" name="_6"> 305 308 <item> … … 515 518 <string comment="Needs double & or it won't be displayed!">Font && Colors</string> 516 519 </attribute> 520 <attribute name="toolTip"> 521 <string>Font and color settings for solution output</string> 522 </attribute> 517 523 <layout class="QVBoxLayout" name="_11"> 518 524 <item> 519 525 <layout class="QHBoxLayout" name="_13"> 526 <item> 527 <widget class="QLabel" name="labelFont"> 528 <property name="statusTip"> 529 <string>Font used for solution output</string> 530 </property> 531 <property name="text"> 532 <string>Text font:</string> 533 </property> 534 </widget> 535 </item> 536 <item> 537 <widget class="QLabel" name="labelFontExample"> 538 <property name="sizePolicy"> 539 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> 540 <horstretch>0</horstretch> 541 <verstretch>0</verstretch> 542 </sizepolicy> 543 </property> 544 <property name="statusTip"> 545 <string>Font used for solution output</string> 546 </property> 547 </widget> 548 </item> 520 549 <item> 521 550 <widget class="QPushButton" name="buttonFont"> … … 524 553 </property> 525 554 <property name="statusTip"> 526 <string>Font face for solution output</string> 555 <string>Change output font</string> 556 </property> 557 </widget> 558 </item> 559 </layout> 560 </item> 561 <item> 562 <layout class="QHBoxLayout" name="_15"> 563 <item> 564 <widget class="QLabel" name="labelTextColor"> 565 <property name="sizePolicy"> 566 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> 567 <horstretch>0</horstretch> 568 <verstretch>0</verstretch> 569 </sizepolicy> 570 </property> 571 <property name="statusTip"> 572 <string>Font color for solution output</string> 527 573 </property> 528 574 <property name="text"> 529 <string>&Font...</string> 530 </property> 531 </widget> 532 </item> 533 <item> 534 <widget class="QPushButton" name="buttonColor"> 575 <string>Text color:</string> 576 </property> 577 </widget> 578 </item> 579 <item> 580 <widget class="QFrame" name="boxTextColor"> 581 <property name="sizePolicy"> 582 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 583 <horstretch>0</horstretch> 584 <verstretch>0</verstretch> 585 </sizepolicy> 586 </property> 587 <property name="minimumSize"> 588 <size> 589 <width>15</width> 590 <height>15</height> 591 </size> 592 </property> 593 <property name="statusTip"> 594 <string>Font color for solution output</string> 595 </property> 596 <property name="autoFillBackground"> 597 <bool>true</bool> 598 </property> 599 <property name="frameShape"> 600 <enum>QFrame::Box</enum> 601 </property> 602 </widget> 603 </item> 604 <item> 605 <widget class="QPushButton" name="buttonTextColor"> 535 606 <property name="cursor"> 536 607 <cursorShape>PointingHandCursor</cursorShape> 537 608 </property> 538 609 <property name="statusTip"> 539 <string>Font color for solution output</string> 610 <string>Change font color</string> 611 </property> 612 </widget> 613 </item> 614 </layout> 615 </item> 616 <item> 617 <layout class="QHBoxLayout" name="_17"> 618 <item> 619 <widget class="QLabel" name="labelSelectedColor"> 620 <property name="enabled"> 621 <bool>false</bool> 622 </property> 623 <property name="sizePolicy"> 624 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> 625 <horstretch>0</horstretch> 626 <verstretch>0</verstretch> 627 </sizepolicy> 628 </property> 629 <property name="statusTip"> 630 <string>Font color for the candidate that was selected for branching</string> 540 631 </property> 541 632 <property name="text"> 542 <string>&Color...</string> 543 </property> 544 </widget> 545 </item> 546 <item> 547 <spacer name="spacer_5"> 548 <property name="orientation"> 549 <enum>Qt::Horizontal</enum> 550 </property> 551 <property name="sizeHint" stdset="0"> 633 <string>Selected candidate color:</string> 634 </property> 635 </widget> 636 </item> 637 <item> 638 <widget class="QFrame" name="boxSelectedColor"> 639 <property name="enabled"> 640 <bool>false</bool> 641 </property> 642 <property name="sizePolicy"> 643 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 644 <horstretch>0</horstretch> 645 <verstretch>0</verstretch> 646 </sizepolicy> 647 </property> 648 <property name="minimumSize"> 552 649 <size> 553 <width>1 </width>554 <height> 0</height>650 <width>15</width> 651 <height>15</height> 555 652 </size> 556 653 </property> 557 </spacer> 654 <property name="statusTip"> 655 <string>Font color for the candidate that was selected for branching</string> 656 </property> 657 <property name="autoFillBackground"> 658 <bool>true</bool> 659 </property> 660 <property name="frameShape"> 661 <enum>QFrame::Box</enum> 662 </property> 663 </widget> 664 </item> 665 <item> 666 <widget class="QPushButton" name="buttonSelectedColor"> 667 <property name="enabled"> 668 <bool>false</bool> 669 </property> 670 <property name="cursor"> 671 <cursorShape>PointingHandCursor</cursorShape> 672 </property> 673 <property name="statusTip"> 674 <string>Change selected candidate color</string> 675 </property> 676 </widget> 677 </item> 678 </layout> 679 </item> 680 <item> 681 <layout class="QHBoxLayout" name="_18"> 682 <item> 683 <widget class="QLabel" name="labelAlternateColor"> 684 <property name="enabled"> 685 <bool>false</bool> 686 </property> 687 <property name="sizePolicy"> 688 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> 689 <horstretch>0</horstretch> 690 <verstretch>0</verstretch> 691 </sizepolicy> 692 </property> 693 <property name="statusTip"> 694 <string>Font color for the alternate candidate that wasn't selected for branching</string> 695 </property> 696 <property name="text"> 697 <string>Alternate candidate color:</string> 698 </property> 699 </widget> 700 </item> 701 <item> 702 <widget class="QFrame" name="boxAlternateColor"> 703 <property name="enabled"> 704 <bool>false</bool> 705 </property> 706 <property name="sizePolicy"> 707 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 708 <horstretch>0</horstretch> 709 <verstretch>0</verstretch> 710 </sizepolicy> 711 </property> 712 <property name="minimumSize"> 713 <size> 714 <width>15</width> 715 <height>15</height> 716 </size> 717 </property> 718 <property name="statusTip"> 719 <string>Font color for the alternate candidate that wasn't selected for branching</string> 720 </property> 721 <property name="autoFillBackground"> 722 <bool>true</bool> 723 </property> 724 <property name="frameShape"> 725 <enum>QFrame::Box</enum> 726 </property> 727 </widget> 728 </item> 729 <item> 730 <widget class="QPushButton" name="buttonAlternateColor"> 731 <property name="enabled"> 732 <bool>false</bool> 733 </property> 734 <property name="cursor"> 735 <cursorShape>PointingHandCursor</cursorShape> 736 </property> 737 <property name="statusTip"> 738 <string>Change alternate candidate color</string> 739 </property> 740 </widget> 741 </item> 742 </layout> 743 </item> 744 <item> 745 <layout class="QHBoxLayout" name="_19"> 746 <item> 747 <widget class="QLabel" name="labelBorderColor"> 748 <property name="enabled"> 749 <bool>false</bool> 750 </property> 751 <property name="sizePolicy"> 752 <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> 753 <horstretch>0</horstretch> 754 <verstretch>0</verstretch> 755 </sizepolicy> 756 </property> 757 <property name="statusTip"> 758 <string>Color of table borders in solution output</string> 759 </property> 760 <property name="text"> 761 <string>Table borders color:</string> 762 </property> 763 </widget> 764 </item> 765 <item> 766 <widget class="QFrame" name="boxBorderColor"> 767 <property name="enabled"> 768 <bool>false</bool> 769 </property> 770 <property name="sizePolicy"> 771 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 772 <horstretch>0</horstretch> 773 <verstretch>0</verstretch> 774 </sizepolicy> 775 </property> 776 <property name="minimumSize"> 777 <size> 778 <width>15</width> 779 <height>15</height> 780 </size> 781 </property> 782 <property name="statusTip"> 783 <string>Color of table borders in solution output</string> 784 </property> 785 <property name="autoFillBackground"> 786 <bool>true</bool> 787 </property> 788 <property name="frameShape"> 789 <enum>QFrame::Box</enum> 790 </property> 791 </widget> 792 </item> 793 <item> 794 <widget class="QPushButton" name="buttonBorderColor"> 795 <property name="enabled"> 796 <bool>false</bool> 797 </property> 798 <property name="cursor"> 799 <cursorShape>PointingHandCursor</cursorShape> 800 </property> 801 <property name="statusTip"> 802 <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 </property> 868 </widget> 558 869 </item> 559 870 </layout>
Note: See TracChangeset
for help on using the changeset viewer.