[haiku-commits] BRANCH looncraz-github.setviewuicolor [c8f6a36ebcd2] src/kits/interface src/servers/app/decorator headers/os/interface src/servers/app src/servers/app/stackandtile

  • From: looncraz-github.setviewuicolor <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 24 Nov 2015 06:32:04 +0100 (CET)

added 7 changesets to branch 'refs/remotes/looncraz-github/setviewuicolor'
old head: c60b1f65251e60da8955cf2f10a99fb877859b6e
new head: c8f6a36ebcd2f5498717a1b0ffc15796e11ac4e1
overview: https://github.com/looncraz/haiku/compare/c60b1f65251e...c8f6a36ebcd2

----------------------------------------------------------------------------

6d5d090bb4e1: Remove Stray Newline

22966cab915d: Correct SetFlags() and Clarify Intentions in use of ViewUIColor()

SetFlags() contained remnant from testing and would squash any existing flags,
but this had no observable negative effects.

ViewUIColor() contained a pointer to tint, which was not required and was
doing unneeded work.

Thanks to Stephan Aßmus for pointing these out.

2016d7b82f9a: Rename B_FOLLOW_DEFAULT to B_FOLLOW_LEFT_TOP

This change is more communicative and was suggested by Stephan Aßmus.

3a28f8914084: Remove Experiment Remnants

This code was a nop as NULL was passed to View::ColorUpdated()'s BRegion*
parameter, however this should have never been left behind.

Thanks to Axel for pointing this out!

c556f3f3f050: BColorMap - use B_RGB_32_BIT_TYPE instead of integer

This eliminates endianness issues and makes retrieval computationally
less complex, even though the code is more complex.

86751e605d74: Direct-to-Desktop Color Setting (set_ui_color and
BColorMap::SetUIColors)

Using DesktopLink in set_ui_color reduces an extra message bounce and
allows the Deskop to directly handle all color settings, as would be
expected.

In addition, this patch modifies BColorMap::SetUIColors() to send the
relevant colors to the Desktop thread directly, removing the repeated
set_ui_color calls and the checks and complexity related to doing that.

c8f6a36ebcd2: Rename "Virtual" Constant colors

Turns out there was less effort involved in doing this properly than
I expected from a quick glance.

[ looncraz <looncraz@xxxxxxxxxxxx> ]

----------------------------------------------------------------------------

37 files changed, 263 insertions(+), 243 deletions(-)
docs/user/interface/View.dox | 2 +-
headers/os/interface/Box.h | 2 +-
headers/os/interface/Button.h | 2 +-
headers/os/interface/ChannelControl.h | 2 +-
headers/os/interface/ChannelSlider.h | 4 +-
headers/os/interface/CheckBox.h | 2 +-
headers/os/interface/ColorMap.h | 5 +-
headers/os/interface/ListView.h | 2 +-
headers/os/interface/MenuField.h | 4 +-
headers/os/interface/MultiChannelControl.h | 2 +-
headers/os/interface/OptionControl.h | 2 +-
headers/os/interface/OptionPopUp.h | 4 +-
headers/os/interface/OutlineListView.h | 2 +-
headers/os/interface/PictureButton.h | 2 +-
headers/os/interface/RadioButton.h | 2 +-
headers/os/interface/ScrollView.h | 2 +-
headers/os/interface/Slider.h | 4 +-
headers/os/interface/StringView.h | 2 +-
headers/os/interface/TextControl.h | 2 +-
headers/os/interface/View.h | 10 +-
headers/private/interface/AbstractSpinner.h | 2 +-
headers/private/interface/ColorMapPrivate.h | 4 +-
headers/private/interface/DecimalSpinner.h | 2 +-
headers/private/shared/CalendarView.h | 2 +-
src/add-ons/translators/png/PNGView.cpp | 3 +-
src/apps/haikudepot/ui/PackageInfoView.cpp | 6 +-
src/kits/interface/ColorMap.cpp | 203 +++++++++++++--------
src/kits/interface/InterfaceDefs.cpp | 3 +-
src/servers/app/Desktop.cpp | 36 ++--
src/servers/app/ServerApp.cpp | 29 ---
src/servers/app/View.cpp | 7 +-
src/servers/app/View.h | 3 +-
src/servers/app/decorator/DefaultDecorator.cpp | 60 +++---
src/servers/app/decorator/TabDecorator.cpp | 24 +--
src/servers/app/decorator/TabDecorator.h | 33 ++--
src/servers/app/stackandtile/SATDecorator.cpp | 22 +--
src/servers/app/stackandtile/SATDecorator.h | 8 +-

############################################################################

Commit: 6d5d090bb4e1e29c391053be64a79fa124dfcf03
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Mon Nov 23 01:02:27 2015 UTC

Remove Stray Newline

----------------------------------------------------------------------------

diff --git a/src/add-ons/translators/png/PNGView.cpp
b/src/add-ons/translators/png/PNGView.cpp
index a92253a..71489c8 100644
--- a/src/add-ons/translators/png/PNGView.cpp
+++ b/src/add-ons/translators/png/PNGView.cpp
@@ -70,8 +70,7 @@ PNGView::PNGView(const BRect &frame, const char *name, uint32
resizeMode,
menuField->ResizeToPreferred();

fCopyrightView = new BTextView("PNG copyright");
- fCopyrightView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR)
- ;
+ fCopyrightView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
fCopyrightView->SetLowColor(fCopyrightView->ViewColor());
fCopyrightView->MakeEditable(false);
fCopyrightView->SetWordWrap(false);

############################################################################

Commit: 22966cab915da4675fea274edd856e3e00c971f5
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 01:34:16 2015 UTC

Correct SetFlags() and Clarify Intentions in use of ViewUIColor()

SetFlags() contained remnant from testing and would squash any existing flags,
but this had no observable negative effects.

ViewUIColor() contained a pointer to tint, which was not required and was
doing unneeded work.

Thanks to Stephan Aßmus for pointing these out.

----------------------------------------------------------------------------

diff --git a/src/apps/haikudepot/ui/PackageInfoView.cpp
b/src/apps/haikudepot/ui/PackageInfoView.cpp
index 698777e..4a127ee 100644
--- a/src/apps/haikudepot/ui/PackageInfoView.cpp
+++ b/src/apps/haikudepot/ui/PackageInfoView.cpp
@@ -961,7 +961,7 @@ public:
.SetInsets(B_USE_DEFAULT_SPACING)
;

- SetFlags(Flags() & B_DRAW_ON_CHILDREN | B_WILL_DRAW);
+ SetFlags(Flags() | B_WILL_DRAW);
}

void AllAttached()
@@ -1013,7 +1013,7 @@ public:
label.SetToFormat("%" B_PRId32, 5 - i);
fLabelViews[i] = new BStringView("", label);
fLabelViews[i]->SetFont(&smallFont);
- fLabelViews[i]->SetViewUIColor(ViewUIColor(&tint),
tint);
+ fLabelViews[i]->SetViewUIColor(ViewUIColor(), tint);
layoutBuilder.Add(fLabelViews[i], 0, i);

fDiagramBarViews[i] = new DiagramBarView();
@@ -1021,7 +1021,7 @@ public:

fCountViews[i] = new BStringView("", "");
fCountViews[i]->SetFont(&smallFont);
- fCountViews[i]->SetViewUIColor(ViewUIColor(&tint),
tint);
+ fCountViews[i]->SetViewUIColor(ViewUIColor(), tint);
fCountViews[i]->SetAlignment(B_ALIGN_RIGHT);
layoutBuilder.Add(fCountViews[i], 2, i);
}

############################################################################

Commit: 2016d7b82f9ab45977a49fad1d5e2c298127948b
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 01:44:00 2015 UTC

Rename B_FOLLOW_DEFAULT to B_FOLLOW_LEFT_TOP

This change is more communicative and was suggested by Stephan Aßmus.

----------------------------------------------------------------------------

diff --git a/docs/user/interface/View.dox b/docs/user/interface/View.dox
index fd8abbb..ff12d3c 100644
--- a/docs/user/interface/View.dox
+++ b/docs/user/interface/View.dox
@@ -525,7 +525,7 @@


/*!
- \var B_FOLLOW_DEFAULT
+ \var B_FOLLOW_LEFT_TOP
\brief The margins between the left and top sides of the view and the
left
and top sides of its parent remain constant.

diff --git a/headers/os/interface/Box.h b/headers/os/interface/Box.h
index cd8b60e..a3020d3 100644
--- a/headers/os/interface/Box.h
+++ b/headers/os/interface/Box.h
@@ -12,7 +12,7 @@
class BBox : public BView {
public:
BBox(BRect frame, const
char* name = NULL,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32 flags =
B_WILL_DRAW | B_FRAME_EVENTS
|
B_NAVIGABLE_JUMP,
border_style
border = B_FANCY_BORDER);
diff --git a/headers/os/interface/Button.h b/headers/os/interface/Button.h
index d630d00..71dfac5 100644
--- a/headers/os/interface/Button.h
+++ b/headers/os/interface/Button.h
@@ -20,7 +20,7 @@ public:
public:
BButton(BRect
frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE

| B_FULL_UPDATE_ON_RESIZE);
BButton(const
char* name, const char* label,
diff --git a/headers/os/interface/ChannelControl.h
b/headers/os/interface/ChannelControl.h
index 0230ee4..7df9cd9 100644
--- a/headers/os/interface/ChannelControl.h
+++ b/headers/os/interface/ChannelControl.h
@@ -18,7 +18,7 @@ public:

BChannelControl(BRect frame, const char* name,
const
char* label, BMessage* model,
int32
channelCount = 1,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BChannelControl(const char* name,
const
char* label, BMessage* model,
diff --git a/headers/os/interface/ChannelSlider.h
b/headers/os/interface/ChannelSlider.h
index bce8013..5151ef1 100644
--- a/headers/os/interface/ChannelSlider.h
+++ b/headers/os/interface/ChannelSlider.h
@@ -14,13 +14,13 @@ public:

BChannelSlider(BRect area, const char* name,
const
char* label, BMessage* message,
int32
channels = 1,
- uint32
resizeMode = B_FOLLOW_DEFAULT,
+ uint32
resizeMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BChannelSlider(BRect area, const char* name,
const
char* label, BMessage* message,

orientation orientation,
int32
channels = 1,
- uint32
resizeMode = B_FOLLOW_DEFAULT,
+ uint32
resizeMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BChannelSlider(const char* name,
const
char* label, BMessage* message,
diff --git a/headers/os/interface/CheckBox.h b/headers/os/interface/CheckBox.h
index ced5106..056f034 100644
--- a/headers/os/interface/CheckBox.h
+++ b/headers/os/interface/CheckBox.h
@@ -13,7 +13,7 @@ class BCheckBox : public BControl {
public:
BCheckBox(BRect
frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);
BCheckBox(const
char* name, const char* label,

BMessage* message, uint32 flags
diff --git a/headers/os/interface/ListView.h b/headers/os/interface/ListView.h
index e26df98..fe8a9af 100644
--- a/headers/os/interface/ListView.h
+++ b/headers/os/interface/ListView.h
@@ -26,7 +26,7 @@ public:
BListView(BRect
frame, const char* name,

list_view_type type

= B_SINGLE_SELECTION_LIST,
- uint32
resizeMask = B_FOLLOW_DEFAULT,
+ uint32
resizeMask = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW

| B_FRAME_EVENTS | B_NAVIGABLE);
BListView(const
char* name,
diff --git a/headers/os/interface/MenuField.h b/headers/os/interface/MenuField.h
index be4e69d..d605419 100644
--- a/headers/os/interface/MenuField.h
+++ b/headers/os/interface/MenuField.h
@@ -17,12 +17,12 @@ class BMenuField : public BView {
public:

BMenuField(BRect frame, const char* name,
const
char* label, BMenu* menu,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BMenuField(BRect frame, const char* name,
const
char* label, BMenu* menu,
bool
fixed_size,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BMenuField(const char* name,
const
char* label, BMenu* menu,
diff --git a/headers/os/interface/MultiChannelControl.h
b/headers/os/interface/MultiChannelControl.h
index e26ccb9..4f4aff0 100644
--- a/headers/os/interface/MultiChannelControl.h
+++ b/headers/os/interface/MultiChannelControl.h
@@ -14,7 +14,7 @@ public:

BMultiChannelControl(BRect frame,
const
char* name, const char* label,

BMessage* message, int32 channelCount = 1,
- uint32
resize = B_FOLLOW_DEFAULT,
+ uint32
resize = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BMultiChannelControl(BMessage* archive);
virtual ~BMultiChannelControl();
diff --git a/headers/os/interface/OptionControl.h
b/headers/os/interface/OptionControl.h
index 10fe097..d5f28f3 100644
--- a/headers/os/interface/OptionControl.h
+++ b/headers/os/interface/OptionControl.h
@@ -18,7 +18,7 @@ class BOptionControl : public BControl {
public:

BOptionControl(BRect frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizeMask = B_FOLLOW_DEFAULT,
+ uint32
resizeMask = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BOptionControl(const char* name,
const
char* label, BMessage* message,
diff --git a/headers/os/interface/OptionPopUp.h
b/headers/os/interface/OptionPopUp.h
index 0634f06..2c6cc3d 100644
--- a/headers/os/interface/OptionPopUp.h
+++ b/headers/os/interface/OptionPopUp.h
@@ -16,12 +16,12 @@ class BOptionPopUp : public BOptionControl {
public:

BOptionPopUp(BRect frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizeMask = B_FOLLOW_DEFAULT,
+ uint32
resizeMask = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BOptionPopUp(BRect frame, const char* name,
const
char* label, BMessage* message,
bool
fixed, uint32 resizeMask
-
= B_FOLLOW_DEFAULT,
+
= B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BOptionPopUp(const char* name,
const
char* label, BMessage* message,
diff --git a/headers/os/interface/OutlineListView.h
b/headers/os/interface/OutlineListView.h
index c8fbe9a..2d519da 100644
--- a/headers/os/interface/OutlineListView.h
+++ b/headers/os/interface/OutlineListView.h
@@ -14,7 +14,7 @@ public:

BOutlineListView(BRect frame, const char* name,

list_view_type type

= B_SINGLE_SELECTION_LIST,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW

| B_FRAME_EVENTS | B_NAVIGABLE);

BOutlineListView(const char* name,
diff --git a/headers/os/interface/PictureButton.h
b/headers/os/interface/PictureButton.h
index 88d8348..0a21ea9 100644
--- a/headers/os/interface/PictureButton.h
+++ b/headers/os/interface/PictureButton.h
@@ -22,7 +22,7 @@ public:

BPicture* off, BPicture* on,

BMessage* message,
uint32
behavior = B_ONE_STATE_BUTTON,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flgs = B_WILL_DRAW | B_NAVIGABLE);

BPictureButton(BMessage* archive);

diff --git a/headers/os/interface/RadioButton.h
b/headers/os/interface/RadioButton.h
index 5976a69..a1cd200 100644
--- a/headers/os/interface/RadioButton.h
+++ b/headers/os/interface/RadioButton.h
@@ -14,7 +14,7 @@ class BRadioButton : public BControl {
public:

BRadioButton(BRect frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BRadioButton(const char* name,
const
char* label, BMessage* message,
diff --git a/headers/os/interface/ScrollView.h
b/headers/os/interface/ScrollView.h
index bdd81e3..d90c7587 100644
--- a/headers/os/interface/ScrollView.h
+++ b/headers/os/interface/ScrollView.h
@@ -15,7 +15,7 @@
class BScrollView : public BView {
public:

BScrollView(const char* name, BView* target,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = 0, bool horizontal = false,
bool
vertical = false,

border_style border = B_FANCY_BORDER);
diff --git a/headers/os/interface/Slider.h b/headers/os/interface/Slider.h
index da9c16c..888bb8f 100644
--- a/headers/os/interface/Slider.h
+++ b/headers/os/interface/Slider.h
@@ -30,7 +30,7 @@ public:
const
char* label, BMessage* message,
int32
minValue, int32 maxValue,

thumb_style thumbType = B_BLOCK_THUMB,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_NAVIGABLE | B_WILL_DRAW

| B_FRAME_EVENTS);

@@ -39,7 +39,7 @@ public:
int32
minValue, int32 maxValue,

orientation posture,

thumb_style thumbType = B_BLOCK_THUMB,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_NAVIGABLE | B_WILL_DRAW

| B_FRAME_EVENTS);

diff --git a/headers/os/interface/StringView.h
b/headers/os/interface/StringView.h
index 557af1d..d75dfc2 100644
--- a/headers/os/interface/StringView.h
+++ b/headers/os/interface/StringView.h
@@ -13,7 +13,7 @@ class BStringView : public BView {
public:

BStringView(BRect frame, const char* name,
const
char* text, uint32 resizingMode
-
= B_FOLLOW_DEFAULT,
+
= B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW);

BStringView(const char* name, const char* text,
uint32
flags = B_WILL_DRAW);
diff --git a/headers/os/interface/TextControl.h
b/headers/os/interface/TextControl.h
index c3b2ae7..3c8792b 100644
--- a/headers/os/interface/TextControl.h
+++ b/headers/os/interface/TextControl.h
@@ -21,7 +21,7 @@ public:

BTextControl(BRect frame, const char* name,
const
char* label, const char* initialText,

BMessage* message,
- uint32
resizeMask = B_FOLLOW_DEFAULT,
+ uint32
resizeMask = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BTextControl(const char* name,
const
char* label, const char* initialText,
diff --git a/headers/os/interface/View.h b/headers/os/interface/View.h
index 8b8ea8d..ddec3df 100644
--- a/headers/os/interface/View.h
+++ b/headers/os/interface/View.h
@@ -107,7 +107,7 @@ inline uint32 _rule_(uint32 r1, uint32 r2, uint32 r3,
uint32 r4)
#define B_FOLLOW_TOP_BOTTOM _rule_(_VIEW_TOP_, 0, _VIEW_BOTTOM_, 0)
#define B_FOLLOW_V_CENTER _rule_(_VIEW_CENTER_, 0, _VIEW_CENTER_, 0)

-#define B_FOLLOW_DEFAULT B_FOLLOW_TOP | B_FOLLOW_LEFT
+#define B_FOLLOW_LEFT_TOP B_FOLLOW_TOP | B_FOLLOW_LEFT

class BBitmap;
class BCursor;
@@ -260,21 +260,21 @@ public:

void SetViewBitmap(const
BBitmap* bitmap,
BRect
srcRect, BRect dstRect,
- uint32
followFlags = B_FOLLOW_DEFAULT,
+ uint32
followFlags = B_FOLLOW_LEFT_TOP,
uint32
options = B_TILE_BITMAP);
void SetViewBitmap(const
BBitmap* bitmap,
- uint32
followFlags = B_FOLLOW_DEFAULT,
+ uint32
followFlags = B_FOLLOW_LEFT_TOP,
uint32
options = B_TILE_BITMAP);
void ClearViewBitmap();

status_t SetViewOverlay(const
BBitmap* overlay,
BRect
srcRect, BRect dstRect,

rgb_color* colorKey,
- uint32
followFlags = B_FOLLOW_DEFAULT,
+ uint32
followFlags = B_FOLLOW_LEFT_TOP,
uint32
options = 0);
status_t SetViewOverlay(const
BBitmap* overlay,

rgb_color* colorKey,
- uint32
followFlags = B_FOLLOW_DEFAULT,
+ uint32
followFlags = B_FOLLOW_LEFT_TOP,
uint32
options = 0);
void ClearViewOverlay();

diff --git a/headers/private/interface/AbstractSpinner.h
b/headers/private/interface/AbstractSpinner.h
index eeb3b98..e822299 100644
--- a/headers/private/interface/AbstractSpinner.h
+++ b/headers/private/interface/AbstractSpinner.h
@@ -39,7 +39,7 @@ class BAbstractSpinner : public BControl {
public:

BAbstractSpinner(BRect frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BAbstractSpinner(const char* name, const char* label,

BMessage* message,
diff --git a/headers/private/interface/DecimalSpinner.h
b/headers/private/interface/DecimalSpinner.h
index b035b90..9c97367 100644
--- a/headers/private/interface/DecimalSpinner.h
+++ b/headers/private/interface/DecimalSpinner.h
@@ -16,7 +16,7 @@ class BDecimalSpinner : public BAbstractSpinner {
public:

BDecimalSpinner(BRect frame, const char* name,
const
char* label, BMessage* message,
- uint32
resizingMode = B_FOLLOW_DEFAULT,
+ uint32
resizingMode = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_NAVIGABLE);

BDecimalSpinner(const char* name, const char* label,

BMessage* message,
diff --git a/headers/private/shared/CalendarView.h
b/headers/private/shared/CalendarView.h
index 1d64385..d48c991 100644
--- a/headers/private/shared/CalendarView.h
+++ b/headers/private/shared/CalendarView.h
@@ -26,7 +26,7 @@ namespace BPrivate {
class BCalendarView : public BView, public BInvoker {
public:

BCalendarView(BRect frame, const char* name,
- uint32
resizeMask = B_FOLLOW_DEFAULT,
+ uint32
resizeMask = B_FOLLOW_LEFT_TOP,
uint32
flags = B_WILL_DRAW | B_FRAME_EVENTS

| B_NAVIGABLE);


############################################################################

Commit: 3a28f8914084851ddaa510ea5492d5220264c21c
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 04:09:32 2015 UTC

Remove Experiment Remnants

This code was a nop as NULL was passed to View::ColorUpdated()'s BRegion*
parameter, however this should have never been left behind.

Thanks to Axel for pointing this out!

----------------------------------------------------------------------------

diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp
index ac194fd..fef1f77 100644
--- a/src/servers/app/Desktop.cpp
+++ b/src/servers/app/Desktop.cpp
@@ -1682,12 +1682,7 @@ Desktop::ColorUpdated(Window* window, color_which which,
rgb_color color)
{
AutoWriteLocker _(fWindowLock);

- BRegion dirty;
- window->TopView()->ColorUpdated(which, color, NULL);
- dirty.OffsetBy(window->Frame().LeftTop());
-
- MarkDirty(dirty);
- dirty.MakeEmpty();
+ window->TopView()->ColorUpdated(which, color);

switch (which) {
case B_WINDOW_TAB_COLOR:
@@ -1701,6 +1696,7 @@ Desktop::ColorUpdated(Window* window, color_which which,
rgb_color color)
return;
}

+ BRegion dirty;
window->ColorsChanged(&dirty);
RebuildAndRedrawAfterWindowChange(window, dirty);
}
diff --git a/src/servers/app/View.cpp b/src/servers/app/View.cpp
index 7096085..554308d 100644
--- a/src/servers/app/View.cpp
+++ b/src/servers/app/View.cpp
@@ -926,7 +926,7 @@ View::CopyBits(IntRect src, IntRect dst, BRegion&
windowContentClipping)


void
-View::ColorUpdated(color_which which, rgb_color color, BRegion* region)
+View::ColorUpdated(color_which which, rgb_color color)
{
float tint = B_NO_TINT;

@@ -939,13 +939,10 @@ View::ColorUpdated(color_which which, rgb_color color,
BRegion* region)
if (CurrentState()->LowUIColor(&tint) == which)
CurrentState()->SetLowColor(tint_color(color, tint));

- if (region != NULL)
- region->Include((clipping_rect)fFrame);
-
for (View* child = FirstChild(); child != NULL;
child = child->NextSibling()) {

- child->ColorUpdated(which, color, region);
+ child->ColorUpdated(which, color);
}
}

diff --git a/src/servers/app/View.h b/src/servers/app/View.h
index 8e69b1f..84e2b3c 100644
--- a/src/servers/app/View.h
+++ b/src/servers/app/View.h
@@ -138,8 +138,7 @@ public:
void SetViewColor(const rgb_color&
color)
{ fViewColor =
color; }

- void ColorUpdated(color_which which,
rgb_color color,
- BRegion* dirty);
+ void ColorUpdated(color_which which,
rgb_color color);
void SetViewUIColor(color_which
which, float tint);
color_which ViewUIColor(float* tint);


############################################################################

Commit: c556f3f3f050abbf2554312e1f543f87c9b65593
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 04:35:33 2015 UTC

BColorMap - use B_RGB_32_BIT_TYPE instead of integer

This eliminates endianness issues and makes retrieval computationally
less complex, even though the code is more complex.

----------------------------------------------------------------------------

diff --git a/headers/os/interface/ColorMap.h b/headers/os/interface/ColorMap.h
index 2259c7d..28a18b5 100644
--- a/headers/os/interface/ColorMap.h
+++ b/headers/os/interface/ColorMap.h
@@ -87,15 +87,14 @@ private:
friend class BPrivate::BColorMapPrivate;
typedef BPrivate::BColorMapData* ColorMap;

- status_t _Set(const BMessage*
message);
bool _GetDataAt(int32 index,
BString* key,
- int32*
data) const;
+ const
void** data) const;
void _Init(BMessage* from);
status_t _InitCopyOnWrite();
+ status_t _Set(const BMessage*
message);
ColorMap _ShareData() const;

ColorMap fData;
-
status_t fInitStatus;
};

diff --git a/headers/private/interface/ColorMapPrivate.h
b/headers/private/interface/ColorMapPrivate.h
index 855d6b8..c335f19 100644
--- a/headers/private/interface/ColorMapPrivate.h
+++ b/headers/private/interface/ColorMapPrivate.h
@@ -24,9 +24,9 @@ public:
virtual ~BColorMapData();

status_t Add(const BString& key,
rgb_color color);
- status_t Add(const BString& key,
int32 color);
+ status_t Add(const BString& key,
const void* color);
status_t Set(const BString& key,
rgb_color color);
- status_t Set(const BString& key,
int32 color);
+ status_t Set(const BString& key,
const void* color);

void Remove(const BString&
key);
void RemoveAll();
diff --git a/src/kits/interface/ColorMap.cpp b/src/kits/interface/ColorMap.cpp
index 9249633..b65c7d3 100644
--- a/src/kits/interface/ColorMap.cpp
+++ b/src/kits/interface/ColorMap.cpp
@@ -218,13 +218,13 @@ BColorMap::Get(const BMessage* message, const BString&
key, rgb_color* color)
if (message == NULL)
return B_BAD_VALUE;

- int32 intColor = 0;
- status_t error = message->FindInt32(key, &intColor);
+ const void* data = NULL;
+ ssize_t size = 0;
+ status_t error = message->FindData(key.String(), B_RGB_32_BIT_TYPE,
&data,
+ &size);

- if (error == B_OK && color != NULL) {
- intColor = B_HOST_TO_BENDIAN_INT32(intColor);
- *color = *(rgb_color*)&intColor;
- }
+ if (error == B_OK && color != NULL)
+ *color = *(rgb_color*)data;

return error;
}
@@ -280,13 +280,13 @@ BColorMap::Add(const BColorMap& colorMap)

status_t error = B_OK;
BString key;
- int32 color = 0;
+ const void* data = NULL;

for (int32 index = 0; index < colorMap.CountColors(); ++index) {
- if (!colorMap._GetDataAt(index, &key, &color))
+ if (!colorMap._GetDataAt(index, &key, &data))
return B_BAD_DATA;

- error = fData->Add(key, color);
+ error = fData->Add(key, data);
if (error != B_OK)
break;
}
@@ -341,14 +341,14 @@ BColorMap::Set(const BColorMap& colorMap)
return B_OK;

BString key;
- int32 color = 0;
+ const void* data = NULL;

status_t error = B_OK;
for (int32 index = 0; index < colorMap.CountColors(); ++index) {
- if (!colorMap._GetDataAt(index, &key, &color))
+ if (!colorMap._GetDataAt(index, &key, &data))
return B_BAD_DATA;

- error = fData->Set(key, color);
+ error = fData->Set(key, data);

if (error != B_OK)
break;
@@ -407,10 +407,10 @@ BColorMap::Remove(const BColorMap& colorMap)
return B_OK;

BString key;
- int32 color = 0;
+ const void* data = NULL;

for (int32 index = 0; index < colorMap.CountColors(); ++index) {
- if (!colorMap._GetDataAt(index, &key, &color))
+ if (!colorMap._GetDataAt(index, &key, &data))
return B_BAD_DATA;

fData->Remove(key);
@@ -457,13 +457,13 @@ BColorMap::Get(const BString& key, rgb_color* color) const

BAutolock _(fData);

- int32 intColor = 0;
- status_t error = fData->FindInt32(key.String(), &intColor);
+ ssize_t size = 0;
+ const void* data = NULL;
+ status_t error = fData->FindData(key.String(), B_RGB_32_BIT_TYPE, &data,
+ &size);

- if (error == B_OK && color != NULL) {
- intColor = B_HOST_TO_BENDIAN_INT32(intColor);
- *color = *(rgb_color*)&intColor;
- }
+ if (error == B_OK && color != NULL && data != NULL)
+ *color = *(rgb_color*)data;

return error;
}
@@ -480,14 +480,12 @@ BColorMap::GetNext(int32* index, BString* key, rgb_color*
color)

BAutolock _(fData);

- int32 intColor = 0;
- if (!_GetDataAt(*index, key, &intColor))
+ const void* data = NULL;
+ if (!_GetDataAt(*index, key, &data))
return B_BAD_INDEX;

- if (color != NULL) {
- intColor = B_HOST_TO_BENDIAN_INT32(intColor);
- *color = *(rgb_color*)&intColor;
- }
+ if (color != NULL)
+ *color = *(rgb_color*)data;

return B_OK;
}
@@ -540,7 +538,7 @@ BColorMap::CountColors() const

BAutolock _(fData);

- return fData->CountNames(B_INT32_TYPE);
+ return fData->CountNames(B_RGB_32_BIT_TYPE);
}


@@ -564,22 +562,24 @@ BColorMap::PrintToStream() const
printf("BColorMap: %li colors {\n", CountColors());

BString key;
- int32 intColor;
- rgb_color color;
+ const rgb_color* color = NULL;

if (fInitStatus != B_OK)
printf("\tINIT FAILURE: %li\n", fInitStatus);

for (int32 index = 0; index < CountColors(); ++index) {
- if (!_GetDataAt(index, &key, &intColor)) {
+ if (!_GetDataAt(index, &key, (const void**)&color)) {
printf("\tError @ index %li\n", index);
break;
}
- intColor = B_HOST_TO_BENDIAN_INT32(intColor);
- color = *(rgb_color*)&intColor;
+
+ if (color == NULL) {
+ printf("\tNULL color data @ index %li\n", index);
+ break;
+ }

printf("\t%-5li %-20s rgb_color(%3i, %3i, %3i, %3i)\n", index,
- key.String(), color.red, color.green, color.blue,
color.alpha);
+ key.String(), color->red, color->green, color->blue,
color->alpha);
}
printf("}\n");
}
@@ -601,12 +601,15 @@ BColorMap::operator==(const BColorMap& other) const

// Important: the order of colors MUST NOT matter!
BString key;
- int32 ourData = 0;
- int32 otherData = 0;
+ const void* ourData = NULL;
+ const void* otherData = NULL;
+ ssize_t size = 0;
int32 index = 0;
while (_GetDataAt(index++, &key, &ourData)) {
- if (other.fData->FindInt32(key.String(), &otherData) != B_OK
- || otherData != ourData) {
+ if (other.fData->FindData(key.String(), B_RGB_32_BIT_TYPE,
&otherData,
+ &size) != B_OK
+ || ourData == NULL || otherData == NULL ||
+ *(rgb_color*)otherData != *(rgb_color*)ourData) {
return false;
}
}
@@ -645,29 +648,52 @@ BColorMap::_Set(const BMessage* message)

BAutolock _(fData);

- int32 count = message->CountNames(B_INT32_TYPE);
+ int32 count = message->CountNames(B_RGB_32_BIT_TYPE);
if (count == 0)
return B_OK;

+ const void* data = NULL;
+ ssize_t size = 0;
+ BString key;
+
+ // We are only interested in the system color_which constants that this
+ // message should contain.
count = 0;
- int32 intColor = 0;
- const char* key;
for (int32 which = 1; which < kColorWhichLastContinuous + 1; ++which) {
- BString name;
- name << which;
- key = name.String();
- if (message->FindInt32(key, &intColor) == B_OK) {
- fData->Set(key, intColor);
+ key.Truncate(0);
+ key << which;
+
+ if (message->FindData(key.String(), B_RGB_32_BIT_TYPE, &data,
+ &size) == B_OK
+ && fData->Set(key, data) == B_OK) {
++count;
}
}

+ // B_SUCCESS_COLOR
+ key.Truncate(0);
+ key << B_SUCCESS_COLOR;
+ if (message->FindData(key.String(), B_RGB_32_BIT_TYPE, &data,
+ &size) == B_OK
+ && fData->Set(key, data) == B_OK) {
+ ++ count;
+ }
+
+ // B_FAILURE_COLOR
+ key.Truncate(0);
+ key << B_FAILURE_COLOR;
+ if (message->FindData(key.String(), B_RGB_32_BIT_TYPE, &data,
+ &size) == B_OK
+ && fData->Set(key, data) == B_OK) {
+ ++ count;
+ }
+
return count > 0 ? B_OK : B_ERROR;
}


bool
-BColorMap::_GetDataAt(int32 index, BString* keyOut, int32* data) const
+BColorMap::_GetDataAt(int32 index, BString* keyOut, const void** data) const
{
if (index < 0 || index >= CountColors())
return false;
@@ -675,13 +701,17 @@ BColorMap::_GetDataAt(int32 index, BString* keyOut,
int32* data) const
char* name = NULL;
type_code type;

- if (fData->GetInfo(B_INT32_TYPE, index, &name, &type) != B_OK)
+ if (fData->GetInfo(B_RGB_32_BIT_TYPE, index, &name, &type) != B_OK)
return false;

if (keyOut != NULL)
*keyOut = name;

- if (data != NULL && fData->FindInt32(name, data) != B_OK)
+ if (data == NULL)
+ return true;
+
+ ssize_t size = 0;
+ if (fData->FindData(name, B_RGB_32_BIT_TYPE, data, &size) != B_OK)
return false;

return true;
@@ -785,32 +815,34 @@ BColorMapData::~BColorMapData()
status_t
BColorMapData::Add(const BString& key, rgb_color color)
{
- return Add(key, B_BENDIAN_TO_HOST_INT32(*(int32*)&color));
+ return Add(key, &color);
}


status_t
-BColorMapData::Add(const BString& key, int32 color)
+BColorMapData::Add(const BString& key, const void* color)
{
- int32 test = 0;
- if (FindInt32(key.String(), &test) == B_OK)
+ if (key == "" || color == NULL)
+ return B_BAD_VALUE;
+
+ if (HasData(key.String(), B_RGB_32_BIT_TYPE))
return B_BAD_INDEX;

- return AddInt32(key.String(), color);
+ return AddData(key.String(), B_RGB_32_BIT_TYPE, color,
sizeof(rgb_color));
}


status_t
BColorMapData::Set(const BString& key, rgb_color color)
{
- return Set(key, B_BENDIAN_TO_HOST_INT32(*(int32*)&color));
+ return Set(key, &color);
}


status_t
-BColorMapData::Set(const BString& key, int32 color)
+BColorMapData::Set(const BString& key, const void* color)
{
- return SetInt32(key.String(), color);
+ return SetData(key.String(), B_RGB_32_BIT_TYPE, color,
sizeof(rgb_color));
}


@@ -829,8 +861,7 @@ BColorMapData::RemoveAll()


status_t
-BColorMapData::Send(port_id port, team_id team, int32 token,
- bigtime_t timeout)
+BColorMapData::Send(port_id port, team_id team, int32 token, bigtime_t timeout)
{
if (port < 0 || team < 0 || token == B_NULL_TOKEN)
return B_BAD_VALUE;
@@ -853,22 +884,28 @@ BColorMapData::GetNext(int32* cookie, color_which* key,
rgb_color* color)
char* name = NULL;
type_code type;

- status_t error = GetInfo(B_INT32_TYPE, *cookie, &name, &type);
+ status_t error = GetInfo(B_RGB_32_BIT_TYPE, *cookie, &name, &type);
+
+ // increment no matter what, some errors may be ignored by the caller...
+ *cookie = *cookie + 1;
+
if (error != B_OK)
return error;

- int32 intColor = 0;
- error = FindInt32(name, &intColor);
+ const void* data = NULL;
+ ssize_t size = 0;
+ error = FindData(name, B_RGB_32_BIT_TYPE, &data, &size);

- if (error == B_OK) {
+ if (error != B_OK)
+ return error;
+
+ if (key != NULL)
*key = (color_which)atoi(name);
- intColor = B_HOST_TO_BENDIAN_INT32(intColor);
- *color = *(rgb_color*)&intColor;
- }
+
+ if (color != NULL)
+ *color = *(rgb_color*)data;

- // increment no matter what, some errors may be ignored by the caller...
- *cookie = *cookie + 1;
- return error;
+ return B_OK;
}


@@ -890,8 +927,7 @@ BColorMapData::IsShared() const


BColorMapData*
-BColorMapPrivate::AcquireData(BColorMap& colorMap, int32 times,
- uint32 mode)
+BColorMapPrivate::AcquireData(BColorMap& colorMap, int32 times, uint32
mode)
{
if (times < 1)
return NULL;

############################################################################

Commit: 86751e605d74a5f3da8c9ae9c584faad9e0388db
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 05:16:08 2015 UTC

Direct-to-Desktop Color Setting (set_ui_color and BColorMap::SetUIColors)

Using DesktopLink in set_ui_color reduces an extra message bounce and
allows the Deskop to directly handle all color settings, as would be
expected.

In addition, this patch modifies BColorMap::SetUIColors() to send the
relevant colors to the Desktop thread directly, removing the repeated
set_ui_color calls and the checks and complexity related to doing that.

----------------------------------------------------------------------------

diff --git a/src/kits/interface/ColorMap.cpp b/src/kits/interface/ColorMap.cpp
index b65c7d3..d644615 100644
--- a/src/kits/interface/ColorMap.cpp
+++ b/src/kits/interface/ColorMap.cpp
@@ -18,7 +18,9 @@

#include <ColorMapPrivate.h>
#include <DefaultColors.h>
+#include <DesktopLink.h>
#include <MessagePrivate.h>
+#include <ServerProtocol.h>
#include <ServerReadOnlyMemory.h>


@@ -166,6 +168,14 @@ BColorMap::SetUIColors(const BColorMap* colorMap)
if (colorMap->CountColors() == 0)
return B_OK;

+ BPrivate::DesktopLink desktop;
+ if (desktop.InitCheck() != B_OK)
+ return B_ERROR;
+
+ desktop.StartMessage(AS_SET_UI_COLORS);
+ desktop.Attach<bool>(false);
+ // false indicates that we aren't flushing Desktop's pending
colormap.
+
// We do this by searching for known color_which values, rather than
// iterating through the color-map, so maps can have erroneous entries
// without us knowing or caring about them. It also has nice error
@@ -176,22 +186,31 @@ BColorMap::SetUIColors(const BColorMap* colorMap)
for (int32 key = 1; key <= kColorWhichLastContinuous; ++key) {
if (colorMap->Get(key, &color) == B_OK) {
++count;
- set_ui_color((color_which)key, color);
+ desktop.Attach<color_which>((color_which)key);
+ desktop.Attach<rgb_color>(color);
}
}

// These colors have special key values
if (colorMap->Get(B_FAILURE_COLOR, &color) == B_OK) {
++count;
- set_ui_color(B_FAILURE_COLOR, color);
+ desktop.Attach<color_which>(B_FAILURE_COLOR);
+ desktop.Attach<rgb_color>(color);
}

if (colorMap->Get(B_SUCCESS_COLOR, &color) == B_OK) {
++count;
- set_ui_color(B_SUCCESS_COLOR, color);
+ desktop.Attach<color_which>(B_SUCCESS_COLOR);
+ desktop.Attach<rgb_color>(color);
}

- // having no system colors in the map *IS* an error at this point
+ // terminates reading
+ desktop.Attach<color_which>(B_NO_COLOR);
+ status_t error = desktop.Flush();
+
+ if (error != B_OK)
+ return error;
+
return count > 0 ? B_OK : B_ERROR;
}

diff --git a/src/kits/interface/InterfaceDefs.cpp
b/src/kits/interface/InterfaceDefs.cpp
index 61eaf8e..a279d0a 100644
--- a/src/kits/interface/InterfaceDefs.cpp
+++ b/src/kits/interface/InterfaceDefs.cpp
@@ -41,6 +41,7 @@
#include <ColorMapPrivate.h>
#include <DecorInfo.h>
#include <DefaultColors.h>
+#include <DesktopLink.h>
#include <InputServerTypes.h>
#include <input_globals.h>
#include <InterfacePrivate.h>
@@ -1110,7 +1111,7 @@ set_ui_color(const color_which &which, const rgb_color
&color)
if (ui_color(which) == color)
return;

- BPrivate::AppServerLink link;
+ BPrivate::DesktopLink link;
link.StartMessage(AS_SET_UI_COLOR);
link.Attach<color_which>(which);
link.Attach<rgb_color>(color);
diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp
index fef1f77..66df0f5 100644
--- a/src/servers/app/Desktop.cpp
+++ b/src/servers/app/Desktop.cpp
@@ -2734,21 +2734,27 @@ Desktop::_DispatchMessage(int32 code,
BPrivate::LinkReceiver& link)
{
bool flushPendingOnly = false;

- if (link.Read<bool>(&flushPendingOnly) != B_OK)
- break;
-
- if (flushPendingOnly) {
- if (fPendingColorMap.CountColors() == 0)
+ if (link.Read<bool>(&flushPendingOnly) != B_OK
+ || (flushPendingOnly &&
fPendingColorMap.CountColors() == 0))
break;

- LockedDesktopSettings settings(this);
- settings.SetUIColors(fPendingColorMap, true);
- // Our pending color map is now empty
- } else {
- // TODO: support external color sets here
- // ... or directly in ServerApp? or nowhere?
+ if (!flushPendingOnly) {
+ // Client wants to set a color map
+ color_which which = B_NO_COLOR;
+ rgb_color color;
+
+ do {
+ if (link.Read<color_which>(&which) !=
B_OK
+ || link.Read<rgb_color>(&color)
!= B_OK)
+ break;
+
+ fPendingColorMap.Set(which, color);
+ } while (which != B_NO_COLOR);
}

+ LockedDesktopSettings settings(this);
+ settings.SetUIColors(fPendingColorMap, true);
+ // Our pending color map is now empty
break;
}

diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp
index 36d5fe7..eb2e265 100644
--- a/src/servers/app/ServerApp.cpp
+++ b/src/servers/app/ServerApp.cpp
@@ -2815,35 +2815,6 @@ ServerApp::_DispatchMessage(int32 code,
BPrivate::LinkReceiver& link)
break;
}

- case AS_SET_UI_COLOR:
- {
- // TODO: is there a way to have apps send this message
directly
- // to the Desktop? Probably so...
- STRACE(("ServerApp %s: Set UI Color\n", Signature()));
-
- // Attached Data:
- // 1) color_which which
- // 2) rgb_color color
-
- // Send the data to the Desktop to handle.
- color_which which;
- rgb_color color;
-
- if (link.Read<color_which>(&which) == B_OK
- && link.Read<rgb_color>(&color) == B_OK) {
-
- // messages will merge if the color_which is
the same,
- // the color will be replaced each time.
- BPrivate::LinkSender
send(GetDesktop()->MessagePort());
- send.StartMessage(AS_SET_UI_COLOR);
-
- if (send.Attach<color_which>(which) == B_OK
- &&
send.Attach<rgb_color>(color) == B_OK)
- send.Flush();
- }
- break;
- }
-
case AS_COLOR_MAP_UPDATED:
{
BPrivate::BColorMapData* data = NULL;

############################################################################

Commit: c8f6a36ebcd2f5498717a1b0ffc15796e11ac4e1
Author: looncraz <looncraz@xxxxxxxxxxxx>
Date: Tue Nov 24 05:26:09 2015 UTC

Rename "Virtual" Constant colors

Turns out there was less effort involved in doing this properly than
I expected from a quick glance.

----------------------------------------------------------------------------

diff --git a/src/servers/app/decorator/DefaultDecorator.cpp
b/src/servers/app/decorator/DefaultDecorator.cpp
index 098e5db..51ad0c0 100644
--- a/src/servers/app/decorator/DefaultDecorator.cpp
+++ b/src/servers/app/decorator/DefaultDecorator.cpp
@@ -114,35 +114,35 @@ DefaultDecorator::GetComponentColors(Component component,
uint8 highlight,
case COMPONENT_TAB:
if (tab && tab->buttonFocus) {
_colors[COLOR_TAB_FRAME_LIGHT]
- = tint_color(kFocusFrameColor,
B_DARKEN_2_TINT);
+ = tint_color(fFocusFrameColor,
B_DARKEN_2_TINT);
_colors[COLOR_TAB_FRAME_DARK]
- = tint_color(kFocusFrameColor,
B_DARKEN_3_TINT);
- _colors[COLOR_TAB] = kFocusTabColor;
- _colors[COLOR_TAB_LIGHT] = kFocusTabColorLight;
- _colors[COLOR_TAB_BEVEL] = kFocusTabColorBevel;
- _colors[COLOR_TAB_SHADOW] =
kFocusTabColorShadow;
- _colors[COLOR_TAB_TEXT] = kFocusTextColor;
+ = tint_color(fFocusFrameColor,
B_DARKEN_3_TINT);
+ _colors[COLOR_TAB] = fFocusTabColor;
+ _colors[COLOR_TAB_LIGHT] = fFocusTabColorLight;
+ _colors[COLOR_TAB_BEVEL] = fFocusTabColorBevel;
+ _colors[COLOR_TAB_SHADOW] =
fFocusTabColorShadow;
+ _colors[COLOR_TAB_TEXT] = fFocusTextColor;
} else {
_colors[COLOR_TAB_FRAME_LIGHT]
- = tint_color(kNonFocusFrameColor,
B_DARKEN_2_TINT);
+ = tint_color(fNonFocusFrameColor,
B_DARKEN_2_TINT);
_colors[COLOR_TAB_FRAME_DARK]
- = tint_color(kNonFocusFrameColor,
B_DARKEN_3_TINT);
- _colors[COLOR_TAB] = kNonFocusTabColor;
- _colors[COLOR_TAB_LIGHT] =
kNonFocusTabColorLight;
- _colors[COLOR_TAB_BEVEL] =
kNonFocusTabColorBevel;
- _colors[COLOR_TAB_SHADOW] =
kNonFocusTabColorShadow;
- _colors[COLOR_TAB_TEXT] = kNonFocusTextColor;
+ = tint_color(fNonFocusFrameColor,
B_DARKEN_3_TINT);
+ _colors[COLOR_TAB] = fNonFocusTabColor;
+ _colors[COLOR_TAB_LIGHT] =
fNonFocusTabColorLight;
+ _colors[COLOR_TAB_BEVEL] =
fNonFocusTabColorBevel;
+ _colors[COLOR_TAB_SHADOW] =
fNonFocusTabColorShadow;
+ _colors[COLOR_TAB_TEXT] = fNonFocusTextColor;
}
break;

case COMPONENT_CLOSE_BUTTON:
case COMPONENT_ZOOM_BUTTON:
if (tab && tab->buttonFocus) {
- _colors[COLOR_BUTTON] = kFocusTabColor;
- _colors[COLOR_BUTTON_LIGHT] =
kFocusTabColorLight;
+ _colors[COLOR_BUTTON] = fFocusTabColor;
+ _colors[COLOR_BUTTON_LIGHT] =
fFocusTabColorLight;
} else {
- _colors[COLOR_BUTTON] = kNonFocusTabColor;
- _colors[COLOR_BUTTON_LIGHT] =
kNonFocusTabColorLight;
+ _colors[COLOR_BUTTON] = fNonFocusTabColor;
+ _colors[COLOR_BUTTON_LIGHT] =
fNonFocusTabColorLight;
}
break;

@@ -153,21 +153,21 @@ DefaultDecorator::GetComponentColors(Component component,
uint8 highlight,
case COMPONENT_RESIZE_CORNER:
default:
if (tab && tab->buttonFocus) {
- _colors[0] = tint_color(kFocusFrameColor,
B_DARKEN_2_TINT);
- _colors[1] = tint_color(kFocusFrameColor,
B_LIGHTEN_2_TINT);
- _colors[2] = kFocusFrameColor;
- _colors[3] = tint_color(kFocusFrameColor,
+ _colors[0] = tint_color(fFocusFrameColor,
B_DARKEN_2_TINT);
+ _colors[1] = tint_color(fFocusFrameColor,
B_LIGHTEN_2_TINT);
+ _colors[2] = fFocusFrameColor;
+ _colors[3] = tint_color(fFocusFrameColor,
(B_DARKEN_1_TINT + B_NO_TINT) / 2);
- _colors[4] = tint_color(kFocusFrameColor,
B_DARKEN_2_TINT);
- _colors[5] = tint_color(kFocusFrameColor,
B_DARKEN_3_TINT);
+ _colors[4] = tint_color(fFocusFrameColor,
B_DARKEN_2_TINT);
+ _colors[5] = tint_color(fFocusFrameColor,
B_DARKEN_3_TINT);
} else {
- _colors[0] = tint_color(kNonFocusFrameColor,
B_DARKEN_2_TINT);
- _colors[1] = tint_color(kNonFocusFrameColor,
B_LIGHTEN_2_TINT);
- _colors[2] = kNonFocusFrameColor;
- _colors[3] = tint_color(kNonFocusFrameColor,
+ _colors[0] = tint_color(fNonFocusFrameColor,
B_DARKEN_2_TINT);
+ _colors[1] = tint_color(fNonFocusFrameColor,
B_LIGHTEN_2_TINT);
+ _colors[2] = fNonFocusFrameColor;
+ _colors[3] = tint_color(fNonFocusFrameColor,
(B_DARKEN_1_TINT + B_NO_TINT) / 2);
- _colors[4] = tint_color(kNonFocusFrameColor,
B_DARKEN_2_TINT);
- _colors[5] = tint_color(kNonFocusFrameColor,
B_DARKEN_3_TINT);
+ _colors[4] = tint_color(fNonFocusFrameColor,
B_DARKEN_2_TINT);
+ _colors[5] = tint_color(fNonFocusFrameColor,
B_DARKEN_3_TINT);
}

// for the resize-border highlight dye everything
bluish.
diff --git a/src/servers/app/decorator/TabDecorator.cpp
b/src/servers/app/decorator/TabDecorator.cpp
index 8d4abaf..a5953f2 100644
--- a/src/servers/app/decorator/TabDecorator.cpp
+++ b/src/servers/app/decorator/TabDecorator.cpp
@@ -197,23 +197,23 @@ void
TabDecorator::UpdateColors(DesktopSettings& settings)
{
// Desktop is write locked, so be quick about it.
- kFocusFrameColor =
settings.UIColor(B_WINDOW_BORDER_COLOR);
- kFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
- kFocusTabColorLight = tint_color(kFocusTabColor,
+ fFocusFrameColor =
settings.UIColor(B_WINDOW_BORDER_COLOR);
+ fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
+ fFocusTabColorLight = tint_color(fFocusTabColor,

(B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2);
- kFocusTabColorBevel = tint_color(kFocusTabColor,
B_LIGHTEN_2_TINT);
- kFocusTabColorShadow = tint_color(kFocusTabColor,
+ fFocusTabColorBevel = tint_color(fFocusTabColor,
B_LIGHTEN_2_TINT);
+ fFocusTabColorShadow = tint_color(fFocusTabColor,

(B_DARKEN_1_TINT + B_NO_TINT) / 2);
- kFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
+ fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);

- kNonFocusFrameColor =
settings.UIColor(B_WINDOW_INACTIVE_BORDER_COLOR);
- kNonFocusTabColor =
settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
- kNonFocusTabColorLight = tint_color(kNonFocusTabColor,
+ fNonFocusFrameColor =
settings.UIColor(B_WINDOW_INACTIVE_BORDER_COLOR);
+ fNonFocusTabColor =
settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
+ fNonFocusTabColorLight = tint_color(fNonFocusTabColor,

(B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2);
- kNonFocusTabColorBevel = tint_color(kNonFocusTabColor,
B_LIGHTEN_2_TINT);
- kNonFocusTabColorShadow = tint_color(kNonFocusTabColor,
+ fNonFocusTabColorBevel = tint_color(fNonFocusTabColor,
B_LIGHTEN_2_TINT);
+ fNonFocusTabColorShadow = tint_color(fNonFocusTabColor,

(B_DARKEN_1_TINT + B_NO_TINT) / 2);
- kNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);
+ fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);
}


diff --git a/src/servers/app/decorator/TabDecorator.h
b/src/servers/app/decorator/TabDecorator.h
index d67e859..781d33a 100644
--- a/src/servers/app/decorator/TabDecorator.h
+++ b/src/servers/app/decorator/TabDecorator.h
@@ -135,24 +135,21 @@ protected:
BRegion fTabsRegion;
BRect fOldMovingTab;

- // These are only "virtually" constant, now.
- // Maintaining the naming convention helps them stand out...
- // and maintains compatibility for existing decorators.
- rgb_color kFocusFrameColor;
-
- rgb_color kFocusTabColor;
- rgb_color kFocusTabColorLight;
- rgb_color kFocusTabColorBevel;
- rgb_color kFocusTabColorShadow;
- rgb_color kFocusTextColor;
-
- rgb_color kNonFocusFrameColor;
-
- rgb_color kNonFocusTabColor;
- rgb_color kNonFocusTabColorLight;
- rgb_color kNonFocusTabColorBevel;
- rgb_color kNonFocusTabColorShadow;
- rgb_color kNonFocusTextColor;
+ rgb_color fFocusFrameColor;
+
+ rgb_color fFocusTabColor;
+ rgb_color fFocusTabColorLight;
+ rgb_color fFocusTabColorBevel;
+ rgb_color fFocusTabColorShadow;
+ rgb_color fFocusTextColor;
+
+ rgb_color fNonFocusFrameColor;
+
+ rgb_color fNonFocusTabColor;
+ rgb_color fNonFocusTabColorLight;
+ rgb_color fNonFocusTabColorBevel;
+ rgb_color fNonFocusTabColorShadow;
+ rgb_color fNonFocusTextColor;
};


diff --git a/src/servers/app/stackandtile/SATDecorator.cpp
b/src/servers/app/stackandtile/SATDecorator.cpp
index 96bc743..dd66b18 100644
--- a/src/servers/app/stackandtile/SATDecorator.cpp
+++ b/src/servers/app/stackandtile/SATDecorator.cpp
@@ -61,11 +61,11 @@ SATDecorator::UpdateColors(DesktopSettings& settings)
DefaultDecorator::UpdateColors(settings);

// Called during construction, and during any changes
- kHighlightTabColor = tint_color(kFocusTabColor,
B_DARKEN_2_TINT);
- kHighlightTabColorLight = tint_color(kHighlightTabColor,
+ fHighlightTabColor = tint_color(fFocusTabColor,
B_DARKEN_2_TINT);
+ fHighlightTabColorLight = tint_color(fHighlightTabColor,

(B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2);
- kHighlightTabColorBevel = tint_color(kHighlightTabColor,
B_LIGHTEN_2_TINT);
- kHighlightTabColorShadow= tint_color(kHighlightTabColor,
+ fHighlightTabColorBevel = tint_color(fHighlightTabColor,
B_LIGHTEN_2_TINT);
+ fHighlightTabColorShadow= tint_color(fHighlightTabColor,

(B_DARKEN_1_TINT + B_NO_TINT) / 2);
}

@@ -93,17 +93,17 @@ SATDecorator::GetComponentColors(Component component, uint8
highlight,
case COMPONENT_TAB:
_colors[COLOR_TAB_FRAME_LIGHT] = kFrameColors[0];
_colors[COLOR_TAB_FRAME_DARK] = kFrameColors[3];
- _colors[COLOR_TAB] = kHighlightTabColor;
- _colors[COLOR_TAB_LIGHT] = kHighlightTabColorLight;
- _colors[COLOR_TAB_BEVEL] = kHighlightTabColorBevel;
- _colors[COLOR_TAB_SHADOW] = kHighlightTabColorShadow;
- _colors[COLOR_TAB_TEXT] = kFocusTextColor;
+ _colors[COLOR_TAB] = fHighlightTabColor;
+ _colors[COLOR_TAB_LIGHT] = fHighlightTabColorLight;
+ _colors[COLOR_TAB_BEVEL] = fHighlightTabColorBevel;
+ _colors[COLOR_TAB_SHADOW] = fHighlightTabColorShadow;
+ _colors[COLOR_TAB_TEXT] = fFocusTextColor;
break;

case COMPONENT_CLOSE_BUTTON:
case COMPONENT_ZOOM_BUTTON:
- _colors[COLOR_BUTTON] = kHighlightTabColor;
- _colors[COLOR_BUTTON_LIGHT] = kHighlightTabColorLight;
+ _colors[COLOR_BUTTON] = fHighlightTabColor;
+ _colors[COLOR_BUTTON_LIGHT] = fHighlightTabColorLight;
break;

case COMPONENT_LEFT_BORDER:
diff --git a/src/servers/app/stackandtile/SATDecorator.h
b/src/servers/app/stackandtile/SATDecorator.h
index 553d78e..4f548b4 100644
--- a/src/servers/app/stackandtile/SATDecorator.h
+++ b/src/servers/app/stackandtile/SATDecorator.h
@@ -35,10 +35,10 @@ protected:

Decorator::Tab* tab = NULL);

private:
- rgb_color kHighlightTabColor;
- rgb_color kHighlightTabColorLight;
- rgb_color kHighlightTabColorBevel;
- rgb_color
kHighlightTabColorShadow;
+ rgb_color fHighlightTabColor;
+ rgb_color fHighlightTabColorLight;
+ rgb_color fHighlightTabColorBevel;
+ rgb_color
fHighlightTabColorShadow;
};




Other related posts:

  • » [haiku-commits] BRANCH looncraz-github.setviewuicolor [c8f6a36ebcd2] src/kits/interface src/servers/app/decorator headers/os/interface src/servers/app src/servers/app/stackandtile - looncraz-github . setviewuicolor