diff --git a/src/preferences/time/NetworkTimeView.cpp b/src/preferences/time/NetworkTimeView.cpp index 82ce72050b..336a60bdb9 100644 --- a/src/preferences/time/NetworkTimeView.cpp +++ b/src/preferences/time/NetworkTimeView.cpp @@ -277,6 +277,8 @@ NetworkTimeView::NetworkTimeView(const char* name) fTryAllServersCheckBox(NULL), fSynchronizeAtBootCheckBox(NULL), fSynchronizeButton(NULL), + fTextColor(ui_color(B_CONTROL_TEXT_COLOR)), + fInvalidColor(ui_color(B_FAILURE_COLOR)), fUpdateThread(-1) { fSettings.Load(); @@ -315,13 +317,11 @@ NetworkTimeView::MessageReceived(BMessage* message) case kMsgServerEdited: { - rgb_color defaultColor = ui_color(B_CONTROL_TEXT_COLOR); - rgb_color invalid = ui_color(B_FAILURE_COLOR); bool isValidServerName = _IsValidServerName(fServerTextControl->Text()); fServerTextControl->TextView()->SetFontAndColor(0, fServerTextControl->TextView()->TextLength(), NULL, 0, - isValidServerName ? &defaultColor : &invalid); + isValidServerName ? &fTextColor : &fInvalidColor); fAddButton->SetEnabled(isValidServerName); break; } diff --git a/src/preferences/time/NetworkTimeView.h b/src/preferences/time/NetworkTimeView.h index 3a494555c8..842c570536 100644 --- a/src/preferences/time/NetworkTimeView.h +++ b/src/preferences/time/NetworkTimeView.h @@ -108,6 +108,9 @@ private: BCheckBox* fSynchronizeAtBootCheckBox; BButton* fSynchronizeButton; + rgb_color fTextColor; + rgb_color fInvalidColor; + thread_id fUpdateThread; };