Stylish style fixes for ColorSet
This commit is contained in:
parent
968cf7c83d
commit
3e30da293d
@ -8,6 +8,7 @@
|
||||
* Rene Gollent <rene@gollent.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Catalog.h>
|
||||
#include <DefaultColors.h>
|
||||
@ -21,9 +22,11 @@
|
||||
#include <String.h>
|
||||
#include "ColorSet.h"
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "Colors tab"
|
||||
|
||||
|
||||
static ColorDescription sColorDescriptionTable[] =
|
||||
{
|
||||
{ B_PANEL_BACKGROUND_COLOR, B_TRANSLATE_MARK("Panel background") },
|
||||
@ -80,6 +83,7 @@ get_color_description(int32 index)
|
||||
return &sColorDescriptionTable[index];
|
||||
}
|
||||
|
||||
|
||||
int32
|
||||
color_description_count(void)
|
||||
{
|
||||
@ -93,6 +97,7 @@ ColorSet::ColorSet()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Copy constructor which does a massive number of assignments
|
||||
\param cs Color set to copy from
|
||||
@ -102,12 +107,14 @@ ColorSet::ColorSet(const ColorSet &cs)
|
||||
*this = cs;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Overloaded assignment operator which does a massive number of assignments
|
||||
\brief Overloaded assignment operator which does a massive number of
|
||||
assignments.
|
||||
\param cs Color set to copy from
|
||||
\return The new values assigned to the color set
|
||||
*/
|
||||
ColorSet &
|
||||
ColorSet&
|
||||
ColorSet::operator=(const ColorSet &cs)
|
||||
{
|
||||
fColors = cs.fColors;
|
||||
@ -123,7 +130,7 @@ ColorSet
|
||||
ColorSet::DefaultColorSet(void)
|
||||
{
|
||||
ColorSet set;
|
||||
|
||||
|
||||
for (int i = 0; i < sColorDescriptionCount; i++) {
|
||||
color_which which = get_color_description(i)->which;
|
||||
set.fColors[which] =
|
||||
@ -150,5 +157,3 @@ ColorSet::GetColor(int32 which)
|
||||
{
|
||||
return fColors[(color_which)which];
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,12 +17,14 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
color_which which;
|
||||
const char* text;
|
||||
const char* text;
|
||||
} ColorDescription;
|
||||
|
||||
|
||||
const ColorDescription* get_color_description(int32 index);
|
||||
int32 color_description_count(void);
|
||||
|
||||
@ -39,9 +41,9 @@ class ColorSet : public BLocker {
|
||||
|
||||
rgb_color GetColor(int32 which);
|
||||
void SetColor(color_which which, rgb_color value);
|
||||
|
||||
|
||||
static ColorSet DefaultColorSet(void);
|
||||
|
||||
|
||||
inline bool operator==(const ColorSet &other)
|
||||
{
|
||||
return fColors == other.fColors;
|
||||
@ -56,4 +58,5 @@ class ColorSet : public BLocker {
|
||||
std::map<color_which, rgb_color> fColors;
|
||||
};
|
||||
|
||||
|
||||
#endif // COLOR_SET_H
|
||||
|
Loading…
Reference in New Issue
Block a user