diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-07-17 21:55:38 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-07-17 21:55:38 +0000 |
commit | 2d006a2d57316a19edc58322757537443e98c852 (patch) | |
tree | d4dfaf10cba888a67c3fec676c8382ce509848ea /ui/qt/syntax_line_edit.cpp | |
parent | a18172147f2c64d3bd143de0309278b7491d21f4 (diff) |
Use the valid/invalid/deprecated backround color preferences.
svn path=/trunk/; revision=50709
Diffstat (limited to 'ui/qt/syntax_line_edit.cpp')
-rw-r--r-- | ui/qt/syntax_line_edit.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/ui/qt/syntax_line_edit.cpp b/ui/qt/syntax_line_edit.cpp index ac8575c15b..40a8621fc1 100644 --- a/ui/qt/syntax_line_edit.cpp +++ b/ui/qt/syntax_line_edit.cpp @@ -21,44 +21,49 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" + +#include <glib.h> + +#include <epan/prefs.h> + #include "syntax_line_edit.h" -#include "tango_colors.h" +#include "color_utils.h" #include <QDebug> SyntaxLineEdit::SyntaxLineEdit(QWidget *parent) : QLineEdit(parent) { + setSyntaxState(); +} + +void SyntaxLineEdit::setSyntaxState(SyntaxState state) { + syntax_state_ = state; state_style_sheet_ = QString( "SyntaxLineEdit[syntaxState=\"%1\"] {" - " color: #%4;" - " background-color: #%5;" + " color: %4;" + " background-color: %5;" "}" "SyntaxLineEdit[syntaxState=\"%2\"] {" - " color: #%4;" - " background-color: #%6;" + " color: %4;" + " background-color: %6;" "}" "SyntaxLineEdit[syntaxState=\"%3\"] {" - " color: #%4;" - " background-color: #%7;" + " color: %4;" + " background-color: %7;" "}" ) + .arg(Valid) .arg(Invalid) .arg(Deprecated) - .arg(Valid) - .arg(ws_syntax_invalid_foreground, 6, 16, QChar('0')) // Foreground - .arg(ws_syntax_invalid_background, 6, 16, QChar('0')) // Invalid - .arg(ws_syntax_deprecated_background, 6, 16, QChar('0')) // Deprecated - .arg(ws_syntax_valid_background, 6, 16, QChar('0')) // Valid + .arg("palette(text)") // Foreground + .arg(ColorUtils::fromColorT(&prefs.gui_text_valid).name()) // Invalid + .arg(ColorUtils::fromColorT(&prefs.gui_text_invalid).name()) // Deprecated + .arg(ColorUtils::fromColorT(&prefs.gui_text_deprecated).name()) // Valid ; - setStyleSheet(tr("")); - setSyntaxState(); -} - -void SyntaxLineEdit::setSyntaxState(SyntaxState state) { - syntax_state_ = state; setStyleSheet(style_sheet_); } |