| 954 | } |
| 955 | |
| 956 | void |
| 957 | KnobGuiString::colorFontButtonClicked() |
| 958 | { |
| 959 | assert(_textEdit); |
| 960 | KnobStringPtr knob = _knob.lock(); |
| 961 | QColorDialog dialog(_textEdit); |
| 962 | dialog.setOption(QColorDialog::DontUseNativeDialog); |
| 963 | QObject::connect( &dialog, SIGNAL(currentColorChanged(QColor)), this, SLOT(updateFontColorIcon(QColor)) ); |
| 964 | dialog.setCurrentColor(_fontColor); |
| 965 | if ( dialog.exec() ) { |
| 966 | _fontColor = dialog.currentColor(); |
| 967 | |
| 968 | QString text = QString::fromUtf8( knob->getValue(0).c_str() ); |
| 969 | findReplaceColorName( text, _fontColor.name() ); |
| 970 | pushUndoCommand( new KnobUndoCommand<std::string>( shared_from_this(), knob->getValue(0), text.toStdString() ) ); |
| 971 | } |
| 972 | updateFontColorIcon(_fontColor); |
| 973 | } |
| 974 | |
| 975 | void |
| 976 | KnobGuiString::findReplaceColorName(QString& text, |
nothing calls this directly
no test coverage detected