From d452ff664c6c7d1b4c429fb7b53f920f165e52f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 26 Feb 2012 14:58:52 +0100 Subject: [PATCH] Added some reserved fields to BControlLook. * This makes future changes less troublesome, although we should also add some virtual slots there (probably just dozens of it, though, that's why I was being lazy). * Don't pass messages by value; they are copied twice this way. * Minor coding style corrections, automatic whitespace cleanup. --- headers/os/interface/ControlLook.h | 6 ++++-- src/kits/interface/ControlLook.cpp | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/headers/os/interface/ControlLook.h b/headers/os/interface/ControlLook.h index 130a0baae0..486b662843 100644 --- a/headers/os/interface/ControlLook.h +++ b/headers/os/interface/ControlLook.h @@ -272,7 +272,8 @@ public: const rgb_color& base, uint32 flags, const BPoint& where); - void SetBackgroundInfo(BMessage msg); + void SetBackgroundInfo( + const BMessage& backgroundInfo); protected: void _DrawButtonFrame(BView* view, BRect& rect, @@ -369,7 +370,8 @@ private: bool fCachedOutline; int32 fCachedWorkspace; BMessage fBackgroundInfo; - + + uint32 _reserved[20]; }; extern BControlLook* be_control_look; diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp index 03326c47d4..fa1d1f3618 100644 --- a/src/kits/interface/ControlLook.cpp +++ b/src/kits/interface/ControlLook.cpp @@ -2,6 +2,8 @@ * Copyright 2009, Stephan Aßmus * Distributed under the terms of the MIT License. */ + + #include #include "ContainerWindow.h" @@ -1875,7 +1877,7 @@ BControlLook::DrawLabel(BView* view, const char* label, const rgb_color& base, // check if the drawing occurs on the desktop if (isDesktop) { - + if (fCachedWorkspace != current_workspace()) { int8 indice = 0; @@ -1894,7 +1896,7 @@ BControlLook::DrawLabel(BView* view, const char* label, const rgb_color& base, indice++; } } - + if (fCachedOutline) { BFont font; view->GetFont(&font); @@ -1909,7 +1911,7 @@ BControlLook::DrawLabel(BView* view, const char* label, const rgb_color& base, glowColor.alpha = 30; view->SetHighColor(glowColor); view->DrawString(label, where); - + font.SetFalseBoldWidth(1.0); view->SetFont(&font, B_FONT_FALSE_BOLD_WIDTH); @@ -1939,7 +1941,7 @@ BControlLook::DrawLabel(BView* view, const char* label, const rgb_color& base, } view->SetHighColor(color); - + view->SetDrawingMode(B_OP_OVER); view->DrawString(label, where); @@ -1949,9 +1951,9 @@ BControlLook::DrawLabel(BView* view, const char* label, const rgb_color& base, void -BControlLook::SetBackgroundInfo(BMessage msg) +BControlLook::SetBackgroundInfo(const BMessage& backgroundInfo) { - fBackgroundInfo = msg; + fBackgroundInfo = backgroundInfo; fCachedWorkspace = -1; }