Implement vertical alignment in wxDataViewCtrl in wxOSX
When using non-default row height, text would be aligned to the top of the row. This is a known limitation of NSTextFieldCell and the solution is to either switch to modern view-based rendering or customize the cell as this commit does. See https://red-sweater.com/blog/148/what-a-difference-a-cell-makes for Daniel Jalkut's description of this solution.
This commit is contained in:
@@ -367,6 +367,16 @@ private:
|
||||
-(NSSize) cellSize;
|
||||
@end
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// NSTextFieldCell customized to allow vertical alignment
|
||||
// ============================================================================
|
||||
|
||||
@interface wxTextFieldCell : NSTextFieldCell
|
||||
-(void) setWXAlignment:(int)alignment;
|
||||
@end
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// wxImageTextCell
|
||||
// ============================================================================
|
||||
@@ -382,7 +392,7 @@ private:
|
||||
// into their reserved space. Smaller or not existing images use the fixed
|
||||
// reserved size and are scaled if necessary.
|
||||
//
|
||||
@interface wxImageTextCell : NSTextFieldCell
|
||||
@interface wxImageTextCell : wxTextFieldCell
|
||||
{
|
||||
@private
|
||||
CGFloat xImageShift; // shift for the image in x-direction from border
|
||||
|
Reference in New Issue
Block a user