Eliminated _UpdateControls(), some style fixes

This commit is contained in:
John Scipione
2013-04-08 23:11:42 -04:00
parent 4600a90cd0
commit 7ef12e5cad
2 changed files with 18 additions and 16 deletions
+18 -15
View File
@@ -1,10 +1,11 @@
/*
* Copyright 2002-2011, Haiku. All rights reserved.
* Copyright 2002-2013 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* DarkWyrm ([email protected])
* Rene Gollent ([email protected])
* DarkWyrm, [email protected]
* Rene Gollent, [email protected]
* John Scipione, [email protected]
*/
@@ -134,8 +135,8 @@ void
APRView::MessageReceived(BMessage *msg)
{
if (msg->WasDropped()) {
rgb_color *color;
ssize_t size;
rgb_color* color = NULL;
ssize_t size = 0;
if (msg->FindData("RGBColor", (type_code)'RGBC', (const void**)&color,
&size) == B_OK) {
@@ -153,6 +154,7 @@ APRView::MessageReceived(BMessage *msg)
Window()->PostMessage(kMsgUpdate);
break;
}
case ATTRIBUTE_CHOSEN:
{
// Received when the user chooses a GUI fAttribute from the list
@@ -169,6 +171,7 @@ APRView::MessageReceived(BMessage *msg)
Window()->PostMessage(kMsgUpdate);
break;
}
default:
BView::MessageReceived(msg);
break;
@@ -194,9 +197,13 @@ APRView::SetDefaults()
{
fCurrentSet = ColorSet::DefaultColorSet();
_UpdateControls();
_UpdateAllColors();
rgb_color color = fCurrentSet.GetColor(fWhich);
fPicker->SetValue(color);
fColorPreview->SetColor(color);
fColorPreview->Invalidate();
Window()->PostMessage(kMsgUpdate);
}
@@ -206,9 +213,13 @@ APRView::Revert()
{
fCurrentSet = fPrevSet;
_UpdateControls();
_UpdateAllColors();
rgb_color color = fCurrentSet.GetColor(fWhich);
fPicker->SetValue(color);
fColorPreview->SetColor(color);
fColorPreview->Invalidate();
Window()->PostMessage(kMsgUpdate);
}
@@ -246,14 +257,6 @@ APRView::_SetCurrentColor(rgb_color color)
{
fCurrentSet.SetColor(fWhich, color);
set_ui_color(fWhich, color);
_UpdateControls();
}
void
APRView::_UpdateControls()
{
rgb_color color = fCurrentSet.GetColor(fWhich);
int32 currentIndex = fAttrList->CurrentSelection();
ColorWhichItem* item = (ColorWhichItem*)fAttrList->ItemAt(currentIndex);
-1
View File
@@ -52,7 +52,6 @@ public:
private:
void _SetCurrentColor(rgb_color color);
void _UpdateControls();
void _UpdateAllColors();
private: