BColorControl: Size text rect based on font size
* Also change kMinCellSize from a uint32 to a float so that it can be used with std::min() and std::max() instead of min_c() and max_c(). * Set the text controls sizes and margins based on the font size. Also rework _TextRectOffset() so that it will get the right spacing from by dividing the palette frame by 3. * Replace bare numbers and refactor with calculation or magic constant. * Create a private method _TextRectOffset() which calculates and returns the vertical text rect offset to use based on the font size. * Replace 2.0 with new kBevelSpacing constant where appropriate. * fPaletteFrame calculation in _LayoutView() was refactored but should not have changed.
This commit is contained in:
@@ -103,6 +103,7 @@ private:
|
||||
BRect _PaletteSelectorFrame(uint8 colorIndex) const;
|
||||
BRect _RampFrame(uint8 rampIndex) const;
|
||||
void _SetCellSize(float size);
|
||||
float _TextRectOffset();
|
||||
|
||||
private:
|
||||
BRect fPaletteFrame;
|
||||
|
||||
Reference in New Issue
Block a user