Skip to content
Permalink
Browse files

new table footer icons for connection window

fixes broken disabled buttons reported in #2453
  • Loading branch information...
abhibeckert committed Apr 15, 2016
1 parent 1c41c8b commit f9f3764f9eee380a3c39e0db5cb669f3617339ef
Binary file not shown.

Large diffs are not rendered by default.

BIN +140 Bytes (130%) Resources/Images/button_action.png
Binary file not shown.
Binary file not shown.
BIN -25 Bytes (86%) Resources/Images/button_add.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,39 @@
//
// SPTableFooterPopUpButtonCell.h
// sequel-pro
//
// Created by Woody Beckert on 15/04/2016.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
// More info at <https://github.com/sequelpro/sequelpro>
//

// NSPopUpButtonCell ignores the alternate image value specified in the xib.
// This class draws it while highlighted, which is now NSButtonCell can be
// configured to work.

#import <Cocoa/Cocoa.h>

@interface SPTableFooterPopUpButtonCell : NSPopUpButtonCell

@end
@@ -0,0 +1,55 @@
//
// SPTableFooterPopUpButtonCell.m
// sequel-pro
//
// Created by Woody Beckert on 15/04/2016.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
// More info at <https://github.com/sequelpro/sequelpro>
//

#import "SPTableFooterPopUpButtonCell.h"

@implementation SPTableFooterPopUpButtonCell

- (void)drawImageWithFrame:(NSRect)cellRect inView:(NSView *)controlView{
NSImage *image = self.image;
if([self isHighlighted] && self.alternateImage){
image = self.alternateImage;
}

//TODO: respect -(NSCellImagePosition)imagePosition
NSRect imageRect = NSZeroRect;
imageRect.origin.y = (CGFloat)round(cellRect.size.height*0.5f-image.size.height*0.5f);
imageRect.origin.x = (CGFloat)round(cellRect.size.width*0.5f-image.size.width*0.5f);
imageRect.size = image.size;

[image drawInRect:imageRect
fromRect:NSZeroRect
operation:NSCompositeSourceOver
fraction:1.0f
respectFlipped:YES
hints:nil];
}

@end
@@ -171,6 +171,9 @@
384582C40FB95FF800DDACB6 /* func-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 384582C30FB95FF800DDACB6 /* func-small.png */; };
384582C70FB9603600DDACB6 /* proc-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 384582C60FB9603600DDACB6 /* proc-small.png */; };
386083461C8A3D97006D1B47 /* zlib.1.2.4.h in Headers */ = {isa = PBXBuildFile; fileRef = 386083451C8A3D97006D1B47 /* zlib.1.2.4.h */; };
3876E1501CC0B26000D85154 /* button_add@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3876E14F1CC0B26000D85154 /* button_add@2x.png */; };
3876E1541CC0B26700D85154 /* button_add_folder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3876E1531CC0B26700D85154 /* button_add_folder@2x.png */; };
3876E15D1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3876E15C1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.m */; };
387BBBA80FBCB6CB00B31746 /* SPTableRelations.m in Sources */ = {isa = PBXBuildFile; fileRef = 387BBBA70FBCB6CB00B31746 /* SPTableRelations.m */; };
4D90B79A101E0CDF00D116A1 /* SPUserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D90B799101E0CDF00D116A1 /* SPUserManager.m */; };
4D90B79E101E0CF200D116A1 /* SPUserManager.xcdatamodel in Sources */ = {isa = PBXBuildFile; fileRef = 4D90B79B101E0CF200D116A1 /* SPUserManager.xcdatamodel */; };
@@ -923,6 +926,10 @@
384582C30FB95FF800DDACB6 /* func-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "func-small.png"; sourceTree = "<group>"; };
384582C60FB9603600DDACB6 /* proc-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "proc-small.png"; sourceTree = "<group>"; };
386083451C8A3D97006D1B47 /* zlib.1.2.4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zlib.1.2.4.h; path = Frameworks/zlib/zlib.1.2.4.h; sourceTree = "<group>"; };
3876E14F1CC0B26000D85154 /* button_add@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_add@2x.png"; sourceTree = "<group>"; };
3876E1531CC0B26700D85154 /* button_add_folder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "button_add_folder@2x.png"; sourceTree = "<group>"; };
3876E15B1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableFooterPopUpButtonCell.h; sourceTree = "<group>"; };
3876E15C1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableFooterPopUpButtonCell.m; sourceTree = "<group>"; };
387BBBA60FBCB6CB00B31746 /* SPTableRelations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableRelations.h; sourceTree = "<group>"; };
387BBBA70FBCB6CB00B31746 /* SPTableRelations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableRelations.m; sourceTree = "<group>"; };
38C613701C89777B00B3B6EF /* libz.1.2.5.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.1.2.5.tbd; path = usr/lib/libz.1.2.5.tbd; sourceTree = SDKROOT; };
@@ -2166,7 +2173,9 @@
C9AD7C8116761B3300234EEE /* button_action.png */,
C9AD7C8216761B3300234EEE /* button_action@2x.png */,
582E93F5168298C6003459FD /* button_add_folder.png */,
3876E1531CC0B26700D85154 /* button_add_folder@2x.png */,
582E93FF168299E3003459FD /* button_add.png */,
3876E14F1CC0B26000D85154 /* button_add@2x.png */,
582E940116829B0A003459FD /* button_bar_handle.png */,
C9C9943F1678A439001F5DA8 /* button_bar_spacer.png */,
582E940D1682A2AD003459FD /* button_bar_spacer@2x.png */,
@@ -2358,6 +2367,8 @@
58D2A6A616FBDEFF002EB401 /* SPComboPopupButton.m */,
50805B0B1BF2A068005F7A99 /* SPPopUpButtonCell.h */,
50805B0C1BF2A068005F7A99 /* SPPopUpButtonCell.m */,
3876E15B1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.h */,
3876E15C1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.m */,
);
name = Controls;
sourceTree = "<group>";
@@ -2987,6 +2998,7 @@
17E6420A0EF020CB001BC333 /* DBView.xib in Resources */,
17E641FA0EF02088001BC333 /* Growl Registration Ticket.growlRegDict in Resources */,
17E641FC0EF02088001BC333 /* sequel-pro.scriptSuite in Resources */,
3876E1501CC0B26000D85154 /* button_add@2x.png in Resources */,
17E641FD0EF02088001BC333 /* sequel-pro.scriptTerminology in Resources */,
1761FD480EF03A6F00331368 /* MainMenu.xib in Resources */,
B5E2C5FA0F2353B5007446E0 /* table-property.png in Resources */,
@@ -3047,6 +3059,7 @@
58A137CD123ED5E6000B1B75 /* titlebarlock.png in Resources */,
BCCB747A128D4FD100339E25 /* BundleEditor.xib in Resources */,
BC77C5E1129AA67F009AD832 /* BundleHTMLOutput.xib in Resources */,
3876E1541CC0B26700D85154 /* button_add_folder@2x.png in Resources */,
BC09D7DE12A786FB0030DB64 /* cancel-clicked-highlighted.png in Resources */,
BC09D7DF12A786FB0030DB64 /* cancel-clicked.png in Resources */,
BC09D7E012A786FB0030DB64 /* cancel-highlighted.png in Resources */,
@@ -3316,6 +3329,7 @@
BCA6271C1031B9D40047E5D5 /* SPTooltip.m in Sources */,
58DA8863103E15B5000B98DF /* SPLogger.m in Sources */,
BC01BCCF104024BE006BDEE7 /* SPEncodingPopupAccessory.m in Sources */,
3876E15D1CC0BA0300D85154 /* SPTableFooterPopUpButtonCell.m in Sources */,
50EAB5B81A8FBB08008F627A /* SPOSInfo.m in Sources */,
173C4366104455E0001F3A30 /* SPQueryFavoriteManager.m in Sources */,
173C44D81044A6B0001F3A30 /* SPOutlineView.m in Sources */,

0 comments on commit f9f3764

Please sign in to comment.
You can’t perform that action at this time.