BButton: Add flat property
* Add methods SetFlat()/IsFlat(). A flat button doesn't draw its frame, unless the mouse is hovering over it or it is otherwise activated. * As a side effect this change also activates the hover glow that was already implemented in BControlLook, but not activated in BButton.
This commit is contained in:
@@ -39,6 +39,9 @@ public:
|
||||
virtual void SetLabel(const char* string);
|
||||
bool IsDefault() const;
|
||||
|
||||
bool IsFlat() const;
|
||||
void SetFlat(bool flat);
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void WindowActivated(bool active);
|
||||
virtual void MouseMoved(BPoint point, uint32 transit,
|
||||
@@ -79,7 +82,6 @@ private:
|
||||
virtual void _ReservedButton2();
|
||||
virtual void _ReservedButton3();
|
||||
|
||||
private:
|
||||
BButton& operator=(const BButton &);
|
||||
|
||||
BSize _ValidatePreferredSize();
|
||||
@@ -87,9 +89,15 @@ private:
|
||||
BRect _DrawDefault(BRect bounds, bool enabled);
|
||||
void _DrawFocusLine(float x, float y, float width,
|
||||
bool bVisible);
|
||||
|
||||
inline bool _Flag(uint32 flag) const;
|
||||
inline bool _SetFlag(uint32 flag, bool set);
|
||||
|
||||
private:
|
||||
BSize fPreferredSize;
|
||||
uint32 fFlags;
|
||||
bool fDrawAsDefault;
|
||||
bool fFlat;
|
||||
|
||||
uint32 _reserved[2];
|
||||
};
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
B_DEFAULT_BUTTON = 1 << 5,
|
||||
B_IGNORE_OUTLINE = 1 << 6,
|
||||
B_PARTIALLY_ACTIVATED = 1 << 7, // like B_ACTIVATED, but for tri-state
|
||||
B_FLAT = 1 << 8, // flat look (e.g. button background)
|
||||
|
||||
B_BLEND_FRAME = 1 << 16
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user