BCheckBox: Add icon support
* Draw(): Remove the non-BControlLook code. * GetPreferredSize(): Implement based on _ValidatePreferredSize() to avoid code duplication. * Draw(): Fix off-by-one error. The label was too close to the box. * Draw(), _ValidatePreferredSize(): Add icon support. _ValidatePreferredSize() is now actually aligned with what Draw() expects. The preferred width is now a tight fit; there were three or four pixels of empty space before. Due to the fixed check box position the layout isn't that nice in some situations (particularly with an icon larger than the text), IMHO.
This commit is contained in:
@@ -84,6 +84,8 @@ private:
|
||||
virtual void _ReservedCheckBox3();
|
||||
|
||||
private:
|
||||
inline BRect _CheckBoxFrame(const font_height& fontHeight)
|
||||
const;
|
||||
BRect _CheckBoxFrame() const;
|
||||
BSize _ValidatePreferredSize();
|
||||
int32 _NextState() const;
|
||||
|
||||
Reference in New Issue
Block a user