Implemented a new look for the Haiku interface controls. It was

overheard that they looked too ninety-ish.
TODO: The code behind this is work in progress. The basic idea
is to extract all drawing code into a new class BControlLook,
of which there is a global instance be_control_look, instantiated
in InterfaceDefs.cpp. At the moment, all the old drawing code is
still there, and the usage of be_control_look is inside if-bodies
checking the instance against NULL. In another words, by not
instanitating be_control_look, you can revert back to the old look.
BControlLook's job is to provide reusable methods for drawing
certain types of frames, backgrounds and labels, so that application
developers can make controls that re-use the same drawing code
as built-in controls and adopt to changes made there. I have added
the notion of "borders". Each of the frame drawing methods can be
made to draw certain borders only, which is supposed to help when
controls shall visually attach. This feature is not fully explored
at all ATM.
TODO: Update BColumnListView header view and BStringItem text
spacing. Update other apps where it makes sense to use BControlLook.
For the moment, only Tracker and LaunchBox are updated. More...
NOTE: The new look is not very radically different, so that existing
apps do not immediately look too ugly or out of place.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29221 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-02-15 18:23:19 +00:00
parent 700ab492a9
commit 2f86ba4557
35 changed files with 3478 additions and 408 deletions
+50 -41
View File
@@ -17,58 +17,67 @@
#include <ChannelControl.h>
class BChannelSlider : public BChannelControl
{
class BChannelSlider : public BChannelControl {
public:
BChannelSlider(BRect area, const char* name,
const char* label, BMessage* message,
int32 channels = 1,
uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW);
BChannelSlider(BRect area, const char* name,
const char* label, BMessage* message,
orientation o, int32 channels = 1,
uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW);
BChannelSlider(BMessage* archive);
virtual ~BChannelSlider();
BChannelSlider(BRect area, const char* name,
const char* label, BMessage* message,
int32 channels = 1,
uint32 resizeMode
= B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW);
BChannelSlider(BRect area, const char* name,
const char* label, BMessage* message,
enum orientation orientation,
int32 channels = 1,
uint32 resizeMode
= B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW);
BChannelSlider(const char* name,
const char* label, BMessage* message,
enum orientation orientation,
int32 channels = 1,
uint32 flags = B_WILL_DRAW);
BChannelSlider(BMessage* archive);
virtual ~BChannelSlider();
static BArchivable* Instantiate(BMessage* from);
virtual status_t Archive(BMessage* into, bool deep = true) const;
static BArchivable* Instantiate(BMessage* from);
virtual status_t Archive(BMessage* into, bool deep = true) const;
virtual orientation Orientation() const;
void SetOrientation(orientation o);
virtual orientation Orientation() const;
void SetOrientation(enum orientation orientation);
virtual int32 MaxChannelCount() const;
virtual bool SupportsIndividualLimits() const;
virtual int32 MaxChannelCount() const;
virtual bool SupportsIndividualLimits() const;
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void DetachedFromWindow();
virtual void AllDetached();
virtual void AttachedToWindow();
virtual void AllAttached();
virtual void DetachedFromWindow();
virtual void AllDetached();
virtual void MessageReceived(BMessage* msg);
virtual void MessageReceived(BMessage* message);
virtual void Draw(BRect area);
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint pt);
virtual void MouseMoved(BPoint pt,uint32 code,
const BMessage* message);
virtual void WindowActivated(bool state);
virtual void KeyDown(const char* bytes, int32 numBytes);
virtual void KeyUp(const char* bytes, int32 numBytes);
virtual void FrameResized(float width, float height);
virtual void Draw(BRect area);
virtual void MouseDown(BPoint where);
virtual void MouseUp(BPoint where);
virtual void MouseMoved(BPoint where, uint32 transit,
const BMessage* dragMessage);
virtual void WindowActivated(bool state);
virtual void KeyDown(const char* bytes, int32 numBytes);
virtual void KeyUp(const char* bytes, int32 numBytes);
virtual void FrameResized(float width, float height);
virtual void SetFont(const BFont* font, uint32 mask = B_FONT_ALL);
virtual void MakeFocus(bool focusState = true);
virtual void SetFont(const BFont* font,
uint32 mask = B_FONT_ALL);
virtual void MakeFocus(bool focusState = true);
virtual void SetEnabled(bool on);
virtual void SetEnabled(bool on);
virtual void GetPreferredSize(float* width, float* height);
virtual void GetPreferredSize(float* _width, float* _height);
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
BMessage* specifier, int32 form, const char* p);
virtual status_t GetSupportedSuites(BMessage* data);
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
BMessage* specifier, int32 form,
const char* p);
virtual status_t GetSupportedSuites(BMessage* data);
// Perform rendering for an entire slider channel.
virtual void DrawChannel(BView* into, int32 channel, BRect area,