Skip to content
Browse files

Only use 3 pixels of vertical margin for the disclosure triangle.

  • Loading branch information...
1 parent b169f69 commit 92ec282c1d026c9b8f6d3794338153e97decbf83 @alloy committed Jan 16, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 ListViewTest/ListView.rb
View
7 ListViewTest/ListView.rb
@@ -55,9 +55,9 @@ def needsLayout
end
class ListViewItem < NSView
- MARGIN = 8
+ HORIZONTAL_MARGIN = 8
DISCLOSURE_TRIANGLE_DIAMETER = 13
- MIN_HEIGHT = CONTENT_VIEW_X = DISCLOSURE_TRIANGLE_DIAMETER + (MARGIN * 2)
+ CONTENT_VIEW_X = DISCLOSURE_TRIANGLE_DIAMETER + (HORIZONTAL_MARGIN * 2)
attr_reader :representedObject
@@ -87,7 +87,6 @@ def updateFrameSizeWithWidth(width)
frame.origin.x = CONTENT_VIEW_X
frame.size.width = width - CONTENT_VIEW_X
- frame.size.height = MIN_HEIGHT if frame.size.height < MIN_HEIGHT
@contentView.frame = frame
@@ -103,7 +102,7 @@ def toggleChildrenListView
end
def addDisclosureTriangle
- frame = NSMakeRect(MARGIN, MARGIN, DISCLOSURE_TRIANGLE_DIAMETER, DISCLOSURE_TRIANGLE_DIAMETER)
+ frame = NSMakeRect(HORIZONTAL_MARGIN, 3, DISCLOSURE_TRIANGLE_DIAMETER, DISCLOSURE_TRIANGLE_DIAMETER)
@disclosureTriangle = NSButton.alloc.initWithFrame(frame)
@disclosureTriangle.bezelStyle = NSDisclosureBezelStyle
@disclosureTriangle.buttonType = NSOnOffButton

0 comments on commit 92ec282

Please sign in to comment.
Something went wrong with that request. Please try again.