Adhere to naming convention

Given constraint-based layouts, we’re more likely to create views in code, and as helper functions are often involved, it makes sense to name them so that we can quickly get a list of all helpers (via search), either for copy/paste or for evaluating wether or not it makes sense to move all helpers to a single library.

Since helpers are declared with static storage, they do not pollute the global namespace.
This commit is contained in:
Allan Odgaard
2013-01-23 06:54:18 +01:00
parent 2b51ca93bd
commit aa71b7ccf0
2 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
#import "OFBHeaderView.h"
#import <OakAppKit/OakAppKit.h>
static NSButton* ImageButton (NSString* imageName)
static NSButton* OakCreateImageButton (NSString* imageName)
{
NSButton* res = [NSButton new];
@@ -18,7 +18,7 @@ static NSButton* ImageButton (NSString* imageName)
return res;
}
static NSPopUpButton* PopUpButton ()
static NSPopUpButton* OakCreatePopUpButton ()
{
NSPopUpButton* res = [NSPopUpButton new];
[[res cell] setBackgroundStyle:NSBackgroundStyleLight];
@@ -39,10 +39,10 @@ static NSPopUpButton* PopUpButton ()
{
if(self = [super initWithFrame:aRect])
{
self.folderPopUpButton = PopUpButton();
self.goBackButton = ImageButton(NSImageNameGoLeftTemplate);
self.folderPopUpButton = OakCreatePopUpButton();
self.goBackButton = OakCreateImageButton(NSImageNameGoLeftTemplate);
self.goBackButton.toolTip = @"Go Back";
self.goForwardButton = ImageButton(NSImageNameGoRightTemplate);
self.goForwardButton = OakCreateImageButton(NSImageNameGoRightTemplate);
self.goForwardButton.toolTip = @"Go Forward";
self.darkDividerView = OakCreateViewWithColor([NSColor colorWithCalibratedWhite:0.551 alpha:1.000]);

View File

@@ -391,7 +391,7 @@ private:
}
@end
static NSScrollView* CreateTextView (NSRect aRect = NSMakeRect(0, 0, 600, 800))
static NSScrollView* OakCreateTextView (NSRect aRect = NSMakeRect(0, 0, 600, 800))
{
NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:aRect];
NSSize textViewSize = [NSScrollView contentSizeForFrameSize:aRect.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder];
@@ -425,6 +425,6 @@ class LayoutTests : public CxxTest::TestSuite
public:
void test_layout ()
{
OakSetupApplicationWithView(CreateTextView());
OakSetupApplicationWithView(OakCreateTextView());
}
};