Skip to content

Commit

Permalink
Add an option to increase padding
Browse files Browse the repository at this point in the history
  • Loading branch information
janten committed Jan 24, 2024
1 parent 6c77162 commit c83e4ba
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
16 changes: 8 additions & 8 deletions keypad-layout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 28;
CURRENT_PROJECT_VERSION = 29;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 7KV498VKRZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "keypad-layout/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.11;
MARKETING_VERSION = 1.12;
PRODUCT_BUNDLE_IDENTIFIER = "com.jan-gerd.keypad-layout";
PRODUCT_NAME = "Keypad Layout";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -310,19 +310,19 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 28;
CURRENT_PROJECT_VERSION = 29;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 7KV498VKRZ;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "keypad-layout/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.11;
MARKETING_VERSION = 1.12;
PRODUCT_BUNDLE_IDENTIFIER = "com.jan-gerd.keypad-layout";
PRODUCT_NAME = "Keypad Layout";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
8 changes: 7 additions & 1 deletion keypad-layout/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ @interface AppDelegate ()
@property NSRect rect;
@property NSRect wildcardRect;
@property(weak) IBOutlet NSMenu *mainMenu;
@property Boolean addPadding;
@end

@implementation AppDelegate
Expand All @@ -26,6 +27,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
selector:@selector(installHotkeys)
userInfo:nil
repeats:YES];
[self bind:@"addPadding"
toObject:[NSUserDefaultsController sharedUserDefaultsController]
withKeyPath:@"values.addPadding"
options:@{@"NSContinuouslyUpdatesValue": @YES}];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
Expand Down Expand Up @@ -202,7 +207,8 @@ - (void)handleHotkeyChar:(char)c {
self.rect = NSZeroRect;
} else {
rect = NSUnionRect(self.rect, rect);
rect = NSInsetRect(rect, 1, 1);
CGFloat inset = self.addPadding ? 5.0 : 1.0;
rect = NSInsetRect(rect, inset, inset);
self.rect = NSZeroRect;
[self setFrontmostWindowFrame:rect];
}
Expand Down
13 changes: 10 additions & 3 deletions keypad-layout/Base.lproj/Storyboard.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17506"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
</dependencies>
<scenes>
<!--Application-->
Expand All @@ -15,13 +15,19 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Keypad Layout" systemMenu="apple" id="tLV-6d-c6l">
<items>
<menuItem title="Increase Padding" state="on" enabled="NO" id="ach-IB-l7C">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<binding destination="N7p-hK-rDf" name="value" keyPath="self.addPadding" id="PB1-LW-TPr"/>
</connections>
</menuItem>
<menuItem title="About Keypad Layout" id="2Vv-Zl-1y3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openAboutWindow:" target="N7p-hK-rDf" id="g1E-me-g1N"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ieN-oU-CP1"/>
<menuItem isSeparatorItem="YES" id="Kns-PI-9LH"/>
<menuItem title="Quit Keypad Layout" keyEquivalent="q" id="BJc-00-axC">
<connections>
<action selector="terminate:" target="hZT-tS-H7s" id="WM8-jh-w2a"/>
Expand Down Expand Up @@ -155,6 +161,7 @@
<outlet property="mainMenu" destination="tLV-6d-c6l" id="oB9-0V-Xnf"/>
</connections>
</customObject>
<userDefaultsController representsSharedInstance="YES" id="A5f-1h-S72"/>
</objects>
<point key="canvasLocation" x="-34" y="-416"/>
</scene>
Expand Down
2 changes: 2 additions & 0 deletions keypad-layout/de.lproj/Storyboard.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

/* Class = "NSMenuItem"; title = "Quit Keypad Layout"; ObjectID = "BJc-00-axC"; */
"BJc-00-axC.title" = "Keypad Layout beenden";

"ach-IB-l7C.title" = "Etwas Abstand";

0 comments on commit c83e4ba

Please sign in to comment.