Time prefs: Set text colors in constructor
This commit is contained in:
@@ -277,6 +277,8 @@ NetworkTimeView::NetworkTimeView(const char* name)
|
|||||||
fTryAllServersCheckBox(NULL),
|
fTryAllServersCheckBox(NULL),
|
||||||
fSynchronizeAtBootCheckBox(NULL),
|
fSynchronizeAtBootCheckBox(NULL),
|
||||||
fSynchronizeButton(NULL),
|
fSynchronizeButton(NULL),
|
||||||
|
fTextColor(ui_color(B_CONTROL_TEXT_COLOR)),
|
||||||
|
fInvalidColor(ui_color(B_FAILURE_COLOR)),
|
||||||
fUpdateThread(-1)
|
fUpdateThread(-1)
|
||||||
{
|
{
|
||||||
fSettings.Load();
|
fSettings.Load();
|
||||||
@@ -315,13 +317,11 @@ NetworkTimeView::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
case kMsgServerEdited:
|
case kMsgServerEdited:
|
||||||
{
|
{
|
||||||
rgb_color defaultColor = ui_color(B_CONTROL_TEXT_COLOR);
|
|
||||||
rgb_color invalid = ui_color(B_FAILURE_COLOR);
|
|
||||||
bool isValidServerName
|
bool isValidServerName
|
||||||
= _IsValidServerName(fServerTextControl->Text());
|
= _IsValidServerName(fServerTextControl->Text());
|
||||||
fServerTextControl->TextView()->SetFontAndColor(0,
|
fServerTextControl->TextView()->SetFontAndColor(0,
|
||||||
fServerTextControl->TextView()->TextLength(), NULL, 0,
|
fServerTextControl->TextView()->TextLength(), NULL, 0,
|
||||||
isValidServerName ? &defaultColor : &invalid);
|
isValidServerName ? &fTextColor : &fInvalidColor);
|
||||||
fAddButton->SetEnabled(isValidServerName);
|
fAddButton->SetEnabled(isValidServerName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,9 @@ private:
|
|||||||
BCheckBox* fSynchronizeAtBootCheckBox;
|
BCheckBox* fSynchronizeAtBootCheckBox;
|
||||||
BButton* fSynchronizeButton;
|
BButton* fSynchronizeButton;
|
||||||
|
|
||||||
|
rgb_color fTextColor;
|
||||||
|
rgb_color fInvalidColor;
|
||||||
|
|
||||||
thread_id fUpdateThread;
|
thread_id fUpdateThread;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user