Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Making larger and smaller functions split into horizontal and vertical #161

Closed
wants to merge 1 commit into from

3 participants

@umurgdk

After few weeks of usage i realized i've need a vertical resizing functionality. There is a resizing functionality exists but it resizes only in vertical and sometimes it resizes vertical and horizontal at same time.

I've limit old resize functionality to make it only resize horizontal. And i've added another vertical resizing functionality. Im not an experienced objective-c developer, sorry about that :smile: .

@eczarny
Owner

I'm a bit apprehensive adding more hot keys to Spectacle. I hope to complete an overhaul of the UI at some point that should help.

@isakkarlsson

Just a note. There seems to be room for two more shortcuts in the preference panes right column. I definitely think this would be a great addition (even w/o an UI overhaul).

@eczarny eczarny closed this
@eczarny
Owner

There may be room for these new shortcuts, but I'm not convinced this change would be a good fit. I appreciate the effort though!

@umurgdk

I really don't like the idea, smaller and bigger. When i want to make it bigger i don't want to change it's width. Im ok with the widths of windows but i don't have much room for vertical space. For example 3 lines terminal window is reasonable for me but i can't handle it with my keyboard shortcuts :/ Because of these i've changed the resizing functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
110 Languages/en.lproj/SpectaclePreferencesWindow.xib
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4511" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1070" identifier="macosx"/>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4511"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SpectaclePreferencesController">
<connections>
<outlet property="loginItemEnabled" destination="39" id="125"/>
<outlet property="makeLargerHotKeyRecorder" destination="144" id="149"/>
+ <outlet property="makeLargerVerticalHotKeyRecorder" destination="HFd-BS-PGK" id="p39-ug-EmF"/>
<outlet property="makeSmallerHotKeyRecorder" destination="146" id="150"/>
+ <outlet property="makeSmallerVerticalHotKeyRecorder" destination="YLx-og-CGY" id="B3O-qn-GwN"/>
<outlet property="moveToBottomHotKeyRecorder" destination="20" id="126"/>
<outlet property="moveToCenterHotKeyRecorder" destination="7" id="127"/>
<outlet property="moveToFullscreenHotKeyRecorder" destination="9" id="128"/>
@@ -34,14 +36,14 @@
<customObject id="-3" userLabel="Application"/>
<window title="Spectacle Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="3">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
- <rect key="contentRect" x="283" y="311" width="616" height="467"/>
+ <rect key="contentRect" x="283" y="311" width="616" height="520"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
<view key="contentView" id="4">
- <rect key="frame" x="0.0" y="0.0" width="616" height="467"/>
+ <rect key="frame" x="0.0" y="0.0" width="616" height="520"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" id="8">
- <rect key="frame" x="51" y="405" width="84" height="17"/>
+ <rect key="frame" x="51" y="458" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Center:" id="62">
<font key="font" metaFont="system"/>
@@ -50,11 +52,11 @@
</textFieldCell>
</textField>
<customView id="7" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="403" width="140" height="21"/>
+ <rect key="frame" x="140" y="456" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="6">
- <rect key="frame" x="51" y="376" width="84" height="17"/>
+ <rect key="frame" x="51" y="429" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Fullscreen:" id="63">
<font key="font" metaFont="system"/>
@@ -63,11 +65,11 @@
</textFieldCell>
</textField>
<customView id="9" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="374" width="140" height="21"/>
+ <rect key="frame" x="140" y="427" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="19">
- <rect key="frame" x="51" y="318" width="84" height="17"/>
+ <rect key="frame" x="51" y="371" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Left Half:" id="56">
<font key="font" metaFont="system"/>
@@ -76,11 +78,11 @@
</textFieldCell>
</textField>
<customView id="22" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="316" width="140" height="21"/>
+ <rect key="frame" x="140" y="369" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="24">
- <rect key="frame" x="51" y="289" width="84" height="17"/>
+ <rect key="frame" x="51" y="342" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Right Half:" id="55">
<font key="font" metaFont="system"/>
@@ -89,11 +91,11 @@
</textFieldCell>
</textField>
<customView id="21" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="287" width="140" height="21"/>
+ <rect key="frame" x="140" y="340" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="25">
- <rect key="frame" x="51" y="260" width="84" height="17"/>
+ <rect key="frame" x="51" y="313" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Top Half:" id="54">
<font key="font" metaFont="system"/>
@@ -102,11 +104,11 @@
</textFieldCell>
</textField>
<customView id="23" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="258" width="140" height="21"/>
+ <rect key="frame" x="140" y="311" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="18">
- <rect key="frame" x="51" y="231" width="84" height="17"/>
+ <rect key="frame" x="51" y="284" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bottom Half:" id="57">
<font key="font" metaFont="system"/>
@@ -115,11 +117,11 @@
</textFieldCell>
</textField>
<customView id="20" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="229" width="140" height="21"/>
+ <rect key="frame" x="140" y="282" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="16">
- <rect key="frame" x="51" y="173" width="84" height="17"/>
+ <rect key="frame" x="51" y="226" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Upper Left:" id="59">
<font key="font" metaFont="system"/>
@@ -128,11 +130,11 @@
</textFieldCell>
</textField>
<customView id="13" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="171" width="140" height="21"/>
+ <rect key="frame" x="140" y="224" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="10">
- <rect key="frame" x="51" y="144" width="84" height="17"/>
+ <rect key="frame" x="51" y="197" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Lower Left:" id="61">
<font key="font" metaFont="system"/>
@@ -141,11 +143,11 @@
</textFieldCell>
</textField>
<customView id="15" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="142" width="140" height="21"/>
+ <rect key="frame" x="140" y="195" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="11">
- <rect key="frame" x="51" y="115" width="84" height="17"/>
+ <rect key="frame" x="51" y="168" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Upper Right:" id="60">
<font key="font" metaFont="system"/>
@@ -154,11 +156,11 @@
</textFieldCell>
</textField>
<customView id="12" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="113" width="140" height="21"/>
+ <rect key="frame" x="140" y="166" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="17">
- <rect key="frame" x="51" y="86" width="84" height="17"/>
+ <rect key="frame" x="51" y="139" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Lower Right:" id="58">
<font key="font" metaFont="system"/>
@@ -167,11 +169,11 @@
</textFieldCell>
</textField>
<customView id="14" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="140" y="84" width="140" height="21"/>
+ <rect key="frame" x="140" y="137" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="28">
- <rect key="frame" x="313" y="405" width="104" height="17"/>
+ <rect key="frame" x="313" y="458" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Next Display:" id="52">
<font key="font" metaFont="system"/>
@@ -180,11 +182,11 @@
</textFieldCell>
</textField>
<customView id="27" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="403" width="140" height="21"/>
+ <rect key="frame" x="422" y="456" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="26">
- <rect key="frame" x="305" y="376" width="112" height="17"/>
+ <rect key="frame" x="305" y="429" width="112" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Previous Display:" id="53">
<font key="font" metaFont="system"/>
@@ -193,11 +195,11 @@
</textFieldCell>
</textField>
<customView id="29" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="374" width="140" height="21"/>
+ <rect key="frame" x="422" y="427" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="34">
- <rect key="frame" x="313" y="318" width="104" height="17"/>
+ <rect key="frame" x="313" y="371" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Next Third:" id="49">
<font key="font" metaFont="system"/>
@@ -206,11 +208,11 @@
</textFieldCell>
</textField>
<customView id="35" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="316" width="140" height="21"/>
+ <rect key="frame" x="422" y="369" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="36">
- <rect key="frame" x="318" y="289" width="99" height="17"/>
+ <rect key="frame" x="318" y="342" width="99" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Previous Third:" id="48">
<font key="font" metaFont="system"/>
@@ -219,11 +221,11 @@
</textFieldCell>
</textField>
<customView id="37" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="287" width="140" height="21"/>
+ <rect key="frame" x="422" y="340" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="113">
- <rect key="frame" x="313" y="144" width="104" height="17"/>
+ <rect key="frame" x="313" y="110" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Undo:" id="118">
<font key="font" metaFont="system"/>
@@ -232,11 +234,11 @@
</textFieldCell>
</textField>
<customView id="114" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="142" width="140" height="21"/>
+ <rect key="frame" x="422" y="108" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="115">
- <rect key="frame" x="313" y="115" width="104" height="17"/>
+ <rect key="frame" x="313" y="81" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Redo:" id="117">
<font key="font" metaFont="system"/>
@@ -245,11 +247,11 @@
</textFieldCell>
</textField>
<customView id="116" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="113" width="140" height="21"/>
+ <rect key="frame" x="422" y="79" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="143">
- <rect key="frame" x="313" y="231" width="104" height="17"/>
+ <rect key="frame" x="313" y="284" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Make Larger:" id="148">
<font key="font" metaFont="system"/>
@@ -258,11 +260,11 @@
</textFieldCell>
</textField>
<customView id="144" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="229" width="140" height="21"/>
+ <rect key="frame" x="422" y="282" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<textField verticalHuggingPriority="750" id="145">
- <rect key="frame" x="313" y="202" width="104" height="17"/>
+ <rect key="frame" x="313" y="255" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Make Smaller:" id="147">
<font key="font" metaFont="system"/>
@@ -271,11 +273,11 @@
</textFieldCell>
</textField>
<customView id="146" customClass="ZKHotKeyRecorder">
- <rect key="frame" x="422" y="200" width="140" height="21"/>
+ <rect key="frame" x="422" y="253" width="140" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<box autoresizesSubviews="NO" borderType="line" titlePosition="noTitle" id="38">
- <rect key="frame" x="-6" y="-6" width="628" height="50"/>
+ <rect key="frame" x="-6" y="-4" width="628" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView">
<rect key="frame" x="1" y="1" width="626" height="48"/>
@@ -327,6 +329,32 @@
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</box>
+ <textField verticalHuggingPriority="750" id="7m3-wE-pfd">
+ <rect key="frame" x="313" y="197" width="104" height="17"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Make Larger V:" id="ZXO-2V-wkq">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <customView id="HFd-BS-PGK" customClass="ZKHotKeyRecorder">
+ <rect key="frame" x="422" y="195" width="140" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ </customView>
+ <textField verticalHuggingPriority="750" id="skr-sn-Q2o">
+ <rect key="frame" x="312" y="168" width="105" height="17"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Make Smaller V:" id="hgs-Lb-BEr">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <customView id="YLx-og-CGY" customClass="ZKHotKeyRecorder">
+ <rect key="frame" x="422" y="166" width="140" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ </customView>
</subviews>
</view>
</window>
View
3  SpectacleConstants.h
@@ -34,6 +34,9 @@
#define SpectacleWindowActionMakeLarger @"MakeLarger"
#define SpectacleWindowActionMakeSmaller @"MakeSmaller"
+#define SpectacleWindowActionMakeLargerVertical @"MakeLargerVertical"
+#define SpectacleWindowActionMakeSmallerVertical @"MakeSmallerVertical"
+
#define SpectacleWindowActionUndoLastMove @"UndoLastMove"
#define SpectacleWindowActionRedoLastMove @"RedoLastMove"
View
2  SpectaclePreferencesController.h
@@ -23,6 +23,8 @@
@property (nonatomic) IBOutlet ZKHotKeyRecorder *makeSmallerHotKeyRecorder;
@property (nonatomic) IBOutlet ZKHotKeyRecorder *undoLastMoveHotKeyRecorder;
@property (nonatomic) IBOutlet ZKHotKeyRecorder *redoLastMoveHotKeyRecorder;
+@property (nonatomic) IBOutlet ZKHotKeyRecorder *makeLargerVerticalHotKeyRecorder;
+@property (nonatomic) IBOutlet ZKHotKeyRecorder *makeSmallerVerticalHotKeyRecorder;
@property (nonatomic) IBOutlet NSButton *loginItemEnabled;
@property (nonatomic) IBOutlet NSPopUpButton *statusItemEnabled;
View
4 SpectaclePreferencesController.m
@@ -48,7 +48,9 @@ - (void)windowDidLoad {
_makeLargerHotKeyRecorder, SpectacleWindowActionMakeLarger,
_makeSmallerHotKeyRecorder, SpectacleWindowActionMakeSmaller,
_undoLastMoveHotKeyRecorder, SpectacleWindowActionUndoLastMove,
- _redoLastMoveHotKeyRecorder, SpectacleWindowActionRedoLastMove, nil];
+ _redoLastMoveHotKeyRecorder, SpectacleWindowActionRedoLastMove,
+ _makeLargerVerticalHotKeyRecorder, SpectacleWindowActionMakeLargerVertical,
+ _makeSmallerVerticalHotKeyRecorder, SpectacleWindowActionMakeSmallerVertical, nil];
[self loadRegisteredHotKeys];
View
2  SpectacleWindowPositionCalculator.h
@@ -7,4 +7,6 @@
+ (CGRect)calculateResizedWindowRect: (CGRect)windowRect visibleFrameOfScreen: (CGRect)visibleFrameOfScreen sizeOffset: (CGFloat)sizeOffset;
++ (CGRect)calculateVResizedWindowRect: (CGRect)windowRect visibleFrameOfScreen: (CGRect)visibleFrameOfScreen sizeOffset: (CGFloat)sizeOffset;
+
@end
View
18 SpectacleWindowPositionCalculator.m
@@ -104,6 +104,21 @@ + (CGRect)calculateResizedWindowRect: (CGRect)windowRect visibleFrameOfScreen: (
windowRect.size.width = visibleFrameOfScreen.size.width;
}
+ if (CGRectEqualToRect(previousWindowRect, visibleFrameOfScreen) && (sizeOffset < 0)) {
+ windowRect.size.width = previousWindowRect.size.width + sizeOffset;
+ windowRect.origin.x = previousWindowRect.origin.x - floor(sizeOffset / 2.0f);
+ }
+
+ if ([SpectacleWindowPositionCalculator isWindowRect: windowRect tooSmallRelativeToVisibleFrameOfScreen: visibleFrameOfScreen]) {
+ windowRect = previousWindowRect;
+ }
+
+ return windowRect;
+}
+
++ (CGRect)calculateVResizedWindowRect: (CGRect)windowRect visibleFrameOfScreen: (CGRect)visibleFrameOfScreen sizeOffset: (CGFloat)sizeOffset {
+ CGRect previousWindowRect = windowRect;
+
windowRect.size.height = windowRect.size.height + sizeOffset;
windowRect.origin.y = windowRect.origin.y - floor(sizeOffset / 2.0f);
@@ -125,9 +140,6 @@ + (CGRect)calculateResizedWindowRect: (CGRect)windowRect visibleFrameOfScreen: (
}
if (CGRectEqualToRect(previousWindowRect, visibleFrameOfScreen) && (sizeOffset < 0)) {
- windowRect.size.width = previousWindowRect.size.width + sizeOffset;
- windowRect.origin.x = previousWindowRect.origin.x - floor(sizeOffset / 2.0f);
-
windowRect.size.height = previousWindowRect.size.height + sizeOffset;
windowRect.origin.y = previousWindowRect.origin.y - floor(sizeOffset / 2.0f);
}
View
4 SpectacleWindowPositionManager.h
@@ -31,7 +31,9 @@ enum {
SpectacleWindowActionNextDisplay,
SpectacleWindowActionPreviousDisplay,
SpectacleWindowActionNextThird,
- SpectacleWindowActionPreviousThird
+ SpectacleWindowActionPreviousThird,
+ SpectacleWindowActionLargerVertical,
+ SpectacleWindowActionSmallerVertical
};
typedef NSInteger SpectacleWindowAction;
View
9 SpectacleWindowPositionManager.m
@@ -8,6 +8,7 @@
#import "ZKAccessibilityElementAdditions.h"
#define Resizing(action) ((action == SpectacleWindowActionLarger) || (action == SpectacleWindowActionSmaller))
+#define VResizing(action) ((action == SpectacleWindowActionLargerVertical) || (action == SpectacleWindowActionSmallerVertical))
#pragma mark -
@@ -106,6 +107,10 @@ - (void)moveFrontMostWindowWithAction: (SpectacleWindowAction)action {
CGFloat sizeOffset = ((action == SpectacleWindowActionLarger) ? 1.0 : -1.0) * SpectacleWindowSizeOffset;
frontMostWindowRect = [SpectacleWindowPositionCalculator calculateResizedWindowRect: frontMostWindowRect visibleFrameOfScreen: visibleFrameOfScreen sizeOffset: sizeOffset];
+ } else if(VResizing(action)) {
+ CGFloat sizeOffset = ((action == SpectacleWindowActionLargerVertical) ? 1.0 : -1.0) * SpectacleWindowSizeOffset;
+
+ frontMostWindowRect = [SpectacleWindowPositionCalculator calculateVResizedWindowRect: frontMostWindowRect visibleFrameOfScreen: visibleFrameOfScreen sizeOffset: sizeOffset];
} else {
frontMostWindowRect = [SpectacleWindowPositionCalculator calculateWindowRect: frontMostWindowRect visibleFrameOfScreen: visibleFrameOfScreen action: action];
}
@@ -178,6 +183,10 @@ - (SpectacleWindowAction)windowActionForHotKey: (ZKHotKey *)hotKey {
windowAction = SpectacleWindowActionUndo;
} else if ([name isEqualToString: SpectacleWindowActionRedoLastMove]) {
windowAction = SpectacleWindowActionRedo;
+ } else if ([name isEqualToString: SpectacleWindowActionMakeLargerVertical]) {
+ windowAction = SpectacleWindowActionLargerVertical;
+ } else if ([name isEqualToString: SpectacleWindowActionMakeSmallerVertical]) {
+ windowAction = SpectacleWindowActionSmallerVertical;
}
return windowAction;
Something went wrong with that request. Please try again.