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:
Ingo Weinhold
2013-12-22 04:48:21 +01:00
parent 6af520e2a9
commit f829889455
2 changed files with 48 additions and 177 deletions
+2
View File
@@ -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;