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 | |
parent | a18172147f2c64d3bd143de0309278b7491d21f4 (diff) | |
download | wireshark-2d006a2d57316a19edc58322757537443e98c852.tar.gz |
Use the valid/invalid/deprecated backround color preferences.
svn path=/trunk/; revision=50709
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/font_color_preferences_frame.cpp | 1 | ||||
-rw-r--r-- | ui/qt/profile_dialog.cpp | 6 | ||||
-rw-r--r-- | ui/qt/syntax_line_edit.cpp | 41 | ||||
-rw-r--r-- | ui/qt/tango_colors.h | 7 |
4 files changed, 25 insertions, 30 deletions
diff --git a/ui/qt/font_color_preferences_frame.cpp b/ui/qt/font_color_preferences_frame.cpp index d5a31932bc..04b22681d8 100644 --- a/ui/qt/font_color_preferences_frame.cpp +++ b/ui/qt/font_color_preferences_frame.cpp @@ -185,7 +185,6 @@ void FontColorPreferencesFrame::changeColor(pref_t *pref) } } -#include <QDebug> void FontColorPreferencesFrame::on_fontPushButton_clicked() { bool ok; diff --git a/ui/qt/profile_dialog.cpp b/ui/qt/profile_dialog.cpp index 095f0750f4..879afb1894 100644 --- a/ui/qt/profile_dialog.cpp +++ b/ui/qt/profile_dialog.cpp @@ -32,7 +32,7 @@ #include "profile_dialog.h" #include "ui_profile_dialog.h" #include "wireshark_application.h" -#include "tango_colors.h" +#include "color_utils.h" #include <QFont> #include <QUrl> @@ -170,12 +170,10 @@ void ProfileDialog::updateWidgets() if (profile->is_global) continue; if (current_profile && !current_profile->is_global && profile != current_profile && strcmp(profile->name, current_profile->name) == 0) { item->setToolTip(0, tr("A profile already exists with that name.")); - item->setBackground(0, QColor(ws_syntax_invalid_background)); - item->setForeground(0, QColor(ws_syntax_invalid_foreground)); + item->setBackground(0, ColorUtils::fromColorT(&prefs.gui_text_invalid)); enable_ok = false; } else { item->setBackground(0, QBrush()); - item->setForeground(0, QBrush()); } } } 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_); } diff --git a/ui/qt/tango_colors.h b/ui/qt/tango_colors.h index f58a98e140..7a4432f190 100644 --- a/ui/qt/tango_colors.h +++ b/ui/qt/tango_colors.h @@ -85,13 +85,6 @@ const QRgb tango_sky_blue_4 = 0x3465a4; const QRgb tango_sky_blue_5 = 0x204a87; const QRgb tango_sky_blue_6 = 0x0a3050; -const QRgb ws_syntax_invalid_background = tango_scarlet_red_1; -const QRgb ws_syntax_invalid_foreground = tango_aluminium_6; -const QRgb ws_syntax_deprecated_background = tango_butter_1; -const QRgb ws_syntax_deprecated_foreground = tango_aluminium_6; -const QRgb ws_syntax_valid_background = tango_chameleon_1; -const QRgb ws_syntax_valid_foreground = tango_aluminium_6; - const QRgb ws_css_warn_background = tango_butter_2; const QRgb ws_css_warn_text = tango_aluminium_6; |