Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Commit

Permalink
Merge branch 'TabPicker'
Browse files Browse the repository at this point in the history
  • Loading branch information
hetima committed Apr 29, 2015
2 parents d73e2a1 + 36653ec commit d7c7ecd
Show file tree
Hide file tree
Showing 10 changed files with 862 additions and 31 deletions.
6 changes: 6 additions & 0 deletions SafariStand.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
AA671B2B17F704FF000A470C /* udis86.c in Sources */ = {isa = PBXBuildFile; fileRef = AA671B1E17F704FF000A470C /* udis86.c */; };
AA671B2C17F704FF000A470C /* mach_override.c in Sources */ = {isa = PBXBuildFile; fileRef = AA671B1F17F704FF000A470C /* mach_override.c */; };
AA671B3017F71D96000A470C /* STWKClientHook.m in Sources */ = {isa = PBXBuildFile; fileRef = AA671B2F17F71D96000A470C /* STWKClientHook.m */; };
AA6B54E31AEE2C8C003F216D /* STTabPickerModule.m in Sources */ = {isa = PBXBuildFile; fileRef = AA6B54E21AEE2C8C003F216D /* STTabPickerModule.m */; };
AA6D308E19FBA6670049E798 /* STDummyDownloadPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA6D308D19FBA6670049E798 /* STDummyDownloadPanel.xib */; };
AA6FCF3E15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.m in Sources */ = {isa = PBXBuildFile; fileRef = AA6FCF3C15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
AA6FCF3F15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA6FCF3D15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.xib */; };
Expand Down Expand Up @@ -207,6 +208,8 @@
AA671B2217F704FF000A470C /* udis86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udis86.h; sourceTree = "<group>"; };
AA671B2E17F71D96000A470C /* STWKClientHook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STWKClientHook.h; sourceTree = "<group>"; };
AA671B2F17F71D96000A470C /* STWKClientHook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STWKClientHook.m; sourceTree = "<group>"; };
AA6B54E11AEE2C8C003F216D /* STTabPickerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STTabPickerModule.h; sourceTree = "<group>"; };
AA6B54E21AEE2C8C003F216D /* STTabPickerModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STTabPickerModule.m; sourceTree = "<group>"; };
AA6D308D19FBA6670049E798 /* STDummyDownloadPanel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = STDummyDownloadPanel.xib; sourceTree = "<group>"; };
AA6FCF3B15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STSquashContextMenuSheetCtl.h; sourceTree = "<group>"; };
AA6FCF3C15D3EA3A008AE5AB /* STSquashContextMenuSheetCtl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STSquashContextMenuSheetCtl.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -513,6 +516,8 @@
AA0B390415C503EB00A025FF /* STActionMenuModule.m */,
AA21447F17EF556000EDE661 /* STSidebarModule.h */,
AA21448017EF556000EDE661 /* STSidebarModule.m */,
AA6B54E11AEE2C8C003F216D /* STTabPickerModule.h */,
AA6B54E21AEE2C8C003F216D /* STTabPickerModule.m */,
);
path = modules;
sourceTree = "<group>";
Expand Down Expand Up @@ -776,6 +781,7 @@
AAD79B4E13E29DF2004CE895 /* STQuickSearchModule+SearchItLater.m in Sources */,
AA0881B013E51287003B70DF /* STSTitleBarModule.m in Sources */,
AAF8702613E55E4E00AC67A1 /* STSDownloadModule.m in Sources */,
AA6B54E31AEE2C8C003F216D /* STTabPickerModule.m in Sources */,
AA780DA313F1A88C0042A253 /* STClassifyDownloadAdvSheetCtl.m in Sources */,
AA780DA913F1C5E00042A253 /* HTUtils.m in Sources */,
AA396EFF13F61B1E00EF5806 /* STStandSearchViewCtl.m in Sources */,
Expand Down
15 changes: 15 additions & 0 deletions SafariStand.xcodeproj/xcshareddata/xcschemes/SafariStand.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
</ExecutionAction>
</PostActions>
<PathRunnable
runnableDebuggingMode = "0"
BundleIdentifier = "com.apple.Safari"
FilePath = "/Applications/Safari.app">
</PathRunnable>
<MacroExpansion>
Expand All @@ -96,6 +98,19 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Applications/Safari.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AA12DA7913B73EFA0082EBB3"
BuildableName = "SafariStand.bundle"
BlueprintName = "SafariStand"
ReferencedContainer = "container:SafariStand.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
76 changes: 67 additions & 9 deletions SafariStand/Resources/STCPrefWin.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="STPrefWindowCtl">
Expand Down Expand Up @@ -35,7 +35,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button toolTip="enable action_message: scheme in bookmarks bar." id="3">
<rect key="frame" x="18" y="324" width="208" height="18"/>
<rect key="frame" x="18" y="324" width="192" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Action Message Enabled" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="4">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -115,7 +115,7 @@
</connections>
</button>
<button toolTip="add copy URL and title, google search with pressing alt key; to Title bar" id="126">
<rect key="frame" x="18" y="304" width="244" height="18"/>
<rect key="frame" x="18" y="304" width="200" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Improve Path Popup Menu" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="127">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand All @@ -142,9 +142,9 @@
</connections>
</button>
<button toolTip="WebKit2BackspaceKeyNavigationEnabled" id="181">
<rect key="frame" x="18" y="230" width="327" height="18"/>
<rect key="frame" x="18" y="230" width="228" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Go Back / Forward by Delete Key (Needs Restart)" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="182">
<buttonCell key="cell" type="check" title="Go Back / Forward by Delete Key" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="182">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand All @@ -158,7 +158,7 @@
</connections>
</button>
<button id="185">
<rect key="frame" x="18" y="182" width="252" height="18"/>
<rect key="frame" x="18" y="182" width="180" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Suppress Tab Bar Width" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="186">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -204,7 +204,7 @@
</connections>
</textField>
<button id="8LT-wt-rnX">
<rect key="frame" x="18" y="135" width="252" height="18"/>
<rect key="frame" x="18" y="135" width="200" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Expand Address Bar Width" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1gk-yO-ULF">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -254,7 +254,7 @@
</textFieldCell>
</textField>
<button id="30F-hP-sUz">
<rect key="frame" x="18" y="70" width="252" height="18"/>
<rect key="frame" x="18" y="70" width="176" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Show Icon on Tab Bar" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="lXM-d3-eAG">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -285,6 +285,64 @@
</binding>
</connections>
</button>
<button id="lxe-uf-jkQ">
<rect key="frame" x="327" y="225" width="266" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="&quot;Show All Tabs&quot; : Keyboard Navigation" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="3pi-84-rVo">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="6" name="value" keyPath="values.Stand_EnhanceVisualTabPicker" id="pFw-Rl-N0W">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
</dictionary>
</binding>
</connections>
</button>
<button id="aHu-48-xlf">
<rect key="frame" x="327" y="200" width="236" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Ctl+Tab Triggers &quot;Show All Tabs&quot;" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="Dfx-Md-IyF">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="6" name="value" keyPath="values.Stand_CtlTabTriggersVisualTabPicker" id="sfF-2T-J5o">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
</dictionary>
</binding>
<binding destination="6" name="enabled" keyPath="values.Stand_EnhanceVisualTabPicker" id="dwo-04-OG4"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="oBo-U3-jyg">
<rect key="frame" x="183" y="214" width="99" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="(Needs Restart)" id="x8n-L5-ahX">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="pPB-Ch-Aru">
<rect key="frame" x="327" y="175" width="214" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Don't Stack &quot;Show All Tabs&quot;" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="9O6-ML-eeC">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="6" name="value" keyPath="values.Stand_DontStackVisualTabPicker" id="pHn-L2-euK">
<dictionary key="options">
<integer key="NSNotApplicablePlaceholder" value="0"/>
<integer key="NSNullPlaceholder" value="0"/>
</dictionary>
</binding>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
Expand Down
4 changes: 4 additions & 0 deletions SafariStand/SafariStandKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@
#define kpShowIconOnSidebarBookmarkEnabled @"Stand_ShowIconOnSidebarBookmarkEnabled"
#define kpShowBrowserWindowTitlebar @"Stand_ShowBrowserWindowTitlebar"

#define kpEnhanceVisualTabPicker @"Stand_EnhanceVisualTabPicker"
#define kpDontStackVisualTabPicker @"Stand_DontStackVisualTabPicker"
#define kpCtlTabTriggersVisualTabPicker @"Stand_CtlTabTriggersVisualTabPicker"

#endif
3 changes: 2 additions & 1 deletion SafariStand/TabList/STCTabListViewCtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ enum : NSInteger {
@end

@interface STCTabListCellView : NSTableCellView
@property (nonatomic) BOOL mouseIsIn;
@property (nonatomic, weak) IBOutlet NSButton* closeButton;
@property (nonatomic, weak) STCTabListViewCtl* listViewCtl;

- (void)resetState;
- (IBAction)actCloseBtn:(id)sender;

@end
38 changes: 28 additions & 10 deletions SafariStand/TabList/STCTabListViewCtl.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
if ([obj isKindOfClass:[STTabProxy class]]) {
idn=@"default";
STCTabListCellView* view=[tableView makeViewWithIdentifier:idn owner:nil];
[view resetState];
view.listViewCtl=self;
return view;
}else if ([obj isKindOfClass:[STCTabListGroupItem class]]){
Expand Down Expand Up @@ -778,32 +779,49 @@ - (void)highlightSelectionInClipRect:(NSRect)clipRect



@implementation STCTabListCellView
@implementation STCTabListCellView{
NSTrackingArea* _trackingArea;
}

- (void)viewDidMoveToWindow
{
self.mouseIsIn=NO;
_trackingArea=nil;
[super viewDidMoveToWindow];
}


- (void)resetState
{
self.imageView.alphaValue=1.0f;
self.closeButton.alphaValue=0.0f;
}


-(void)updateTrackingAreas
{
[super updateTrackingAreas];

NSArray *oldAreas=[self trackingAreas];
if ([oldAreas count]>0) {
return;
if (_trackingArea) {
[self removeTrackingArea:_trackingArea];
_trackingArea=nil;
}

NSTrackingArea* tracking_area = [[NSTrackingArea alloc]initWithRect:[self bounds] options:(NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveInActiveApp /*| NSTrackingEnabledDuringMouseDrag*/) owner:self userInfo:nil];
[self addTrackingArea:tracking_area];
_trackingArea = [[NSTrackingArea alloc]initWithRect:[self bounds] options:(NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingActiveInActiveApp /*| NSTrackingEnabledDuringMouseDrag*/) owner:self userInfo:nil];
[self addTrackingArea:_trackingArea];
}


- (void)mouseEntered:(NSEvent *)theEvent
{
self.mouseIsIn=YES;
self.imageView.alphaValue=0.0f;
self.closeButton.alphaValue=1.0f;
[_listViewCtl listCellViewMouseEntered:self];
}


- (void)mouseExited:(NSEvent *)theEvent
{
self.mouseIsIn=NO;
self.imageView.alphaValue=1.0f;
self.closeButton.alphaValue=0.0f;
[_listViewCtl listCellViewMouseExited:self];
}

Expand Down
Loading

0 comments on commit d7c7ecd

Please sign in to comment.