Skip to content

Commit

Permalink
For some reason using a Template image in IB does not work, so work a…
Browse files Browse the repository at this point in the history
…round it by manually loading it.
  • Loading branch information
alloy committed Nov 4, 2009
1 parent 536b769 commit efbfb2d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
18 changes: 15 additions & 3 deletions English.lproj/PassengerPref.xib
Expand Up @@ -1711,6 +1711,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">454</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">openAddressInBrowserButton</string>
<reference key="source" ref="565115411"/>
<reference key="destination" ref="535317141"/>
</object>
<int key="connectionID">455</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -2315,9 +2323,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{71, 698}, {668, 438}}</string>
<string>{{106, 718}, {668, 438}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{71, 698}, {668, 438}}</string>
<string>{{106, 718}, {668, 438}}</string>
<integer value="1"/>
<string>{{-5, 388}, {668, 438}}</string>
<boolean value="NO"/>
Expand Down Expand Up @@ -2424,7 +2432,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">454</int>
<int key="maxID">455</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -2513,6 +2521,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string key="NS.key.0">openAddressInBrowser:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">openAddressInBrowserButton</string>
<string key="NS.object.0">id</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBUserSource</string>
<string key="minorKey"/>
Expand Down
11 changes: 10 additions & 1 deletion app/controllers/passenger_pref.rb
Expand Up @@ -32,13 +32,14 @@ class << self
ib_outlet :authorizationView
ib_outlet :applicationsTableView
ib_outlet :applicationsController
ib_outlet :openAddressInBrowserButton

kvc_accessor :applications, :authorized, :dirty_apps, :revertable_apps, :textFieldColor

def mainViewDidLoad
self.class.sharedInstance = self

self.textFieldColor = OSX::NSColor.disabledControlTextColor
setup_ui_details!
setup_authorization_view!
setup_applications_table_view!

Expand Down Expand Up @@ -237,6 +238,14 @@ def authorize!
result
end

def setup_ui_details!
button_image = OSX::NSImage.alloc.initByReferencingFile(File.join(bundle.resourcePath, 'OpenInBrowserTemplate.tiff'))
button_image.template = true
@openAddressInBrowserButton.image = button_image

self.textFieldColor = OSX::NSColor.disabledControlTextColor
end

def setup_authorization_view!
@authorized = false
@authorizationView.string = OSX::KAuthorizationRightExecute
Expand Down
6 changes: 6 additions & 0 deletions test/passenger_pref_test.rb
Expand Up @@ -39,6 +39,12 @@ def alert_stub
end
end

# Global stubs
class PrefPanePassenger
def setup_ui_details!
end
end

describe "PrefPanePassenger, while initializing" do
tests PrefPanePassenger

Expand Down

0 comments on commit efbfb2d

Please sign in to comment.