From 3e30da293d60f2c31b6121935a0d29b2b084f0f5 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 8 Apr 2013 21:40:49 -0400 Subject: [PATCH] Stylish style fixes for ColorSet --- src/preferences/appearance/ColorSet.cpp | 15 ++++++++++----- src/preferences/appearance/ColorSet.h | 11 +++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/preferences/appearance/ColorSet.cpp b/src/preferences/appearance/ColorSet.cpp index ab2a167e6e..350b45a578 100644 --- a/src/preferences/appearance/ColorSet.cpp +++ b/src/preferences/appearance/ColorSet.cpp @@ -8,6 +8,7 @@ * Rene Gollent */ + #include #include #include @@ -21,9 +22,11 @@ #include #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]; } - - diff --git a/src/preferences/appearance/ColorSet.h b/src/preferences/appearance/ColorSet.h index e260f480ad..4d3a6ed91b 100644 --- a/src/preferences/appearance/ColorSet.h +++ b/src/preferences/appearance/ColorSet.h @@ -17,12 +17,14 @@ #include -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 fColors; }; + #endif // COLOR_SET_H