From: Ruben Beltran del Rio Date: Wed, 8 Feb 2023 15:45:16 +0000 (+0100) Subject: Initial Commit X-Git-Tag: 1.0.0~7 X-Git-Url: https://git.r.bdr.sh/rbdr/Flat-Bezel.qsplugin/commitdiff_plain/5200836d4b4ca9baf0f578f7a462f27d155abff4?ds=inline Initial Commit --- 5200836d4b4ca9baf0f578f7a462f27d155abff4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45257f8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +.svn +.DS_Store +._.* +*.o +build +Makefile +autom4te.cache +*~ +*.pbxuser +*.perspectivev3 +*.mode1v3 +*.mode2v3 +*.pbxuser +*.tm_build_errors +*.tmproj +Developer.xcconfig +*.xcworkspace +*.xcuserdatad +/release diff --git a/Flat Bezel.xcodeproj/project.pbxproj b/Flat Bezel.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6c886d5 --- /dev/null +++ b/Flat Bezel.xcodeproj/project.pbxproj @@ -0,0 +1,335 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 42447D7A193F6C9D0077B4B2 /* BBBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42447D79193F6C9D0077B4B2 /* BBBackgroundView.m */; }; + 42447D7D19407DA00077B4B2 /* BBSearchObjectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */; }; + 42447D821940935E0077B4B2 /* gear-black.png in Resources */ = {isa = PBXBuildFile; fileRef = 42447D7F1940935E0077B4B2 /* gear-black.png */; }; + 42447D831940935E0077B4B2 /* search-black.png in Resources */ = {isa = PBXBuildFile; fileRef = 42447D801940935E0077B4B2 /* search-black.png */; }; + 42663058193CC1FA00C0DD31 /* BBFlatBezelInterface.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */; }; + CD3B1BE2285F2E8C004862D7 /* search-white.png in Resources */ = {isa = PBXBuildFile; fileRef = CD3B1BE0285F2E8C004862D7 /* search-white.png */; }; + CD3B1BE3285F2E8C004862D7 /* gear-white.png in Resources */ = {isa = PBXBuildFile; fileRef = CD3B1BE1285F2E8C004862D7 /* gear-white.png */; }; + E470B7E31709F3A0000169F2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E470B7E21709F3A0000169F2 /* Cocoa.framework */; }; + E470B7E91709F3A0000169F2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E470B7E71709F3A0000169F2 /* InfoPlist.strings */; }; + E470B7F81709F3A0000169F2 /* BBFlatBezelInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = E470B7F71709F3A0000169F2 /* BBFlatBezelInterface.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 42447D78193F6C9D0077B4B2 /* BBBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BBBackgroundView.h; sourceTree = ""; }; + 42447D79193F6C9D0077B4B2 /* BBBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BBBackgroundView.m; sourceTree = ""; }; + 42447D7B19407DA00077B4B2 /* BBSearchObjectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BBSearchObjectView.h; sourceTree = ""; }; + 42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BBSearchObjectView.m; sourceTree = ""; }; + 42447D7F1940935E0077B4B2 /* gear-black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gear-black.png"; sourceTree = ""; }; + 42447D801940935E0077B4B2 /* search-black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search-black.png"; sourceTree = ""; }; + 42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BBFlatBezelInterface.xib; sourceTree = ""; }; + CD3B1BE0285F2E8C004862D7 /* search-white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search-white.png"; sourceTree = ""; }; + CD3B1BE1285F2E8C004862D7 /* gear-white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gear-white.png"; sourceTree = ""; }; + E470B7DF1709F3A0000169F2 /* Flat Bezel.qsplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Flat Bezel.qsplugin"; sourceTree = BUILT_PRODUCTS_DIR; }; + E470B7E21709F3A0000169F2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + E470B7E61709F3A0000169F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; + E470B7E81709F3A0000169F2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + E470B7EB1709F3A0000169F2 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; + E470B7EC1709F3A0000169F2 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + E470B7ED1709F3A0000169F2 /* Developer.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Developer.xcconfig; sourceTree = ""; }; + E470B7EE1709F3A0000169F2 /* QSPlugIn.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = QSPlugIn.xcconfig; sourceTree = ""; }; + E470B7EF1709F3A0000169F2 /* Quicksilver.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Quicksilver.pch; sourceTree = ""; }; + E470B7F01709F3A0000169F2 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + E470B7F61709F3A0000169F2 /* BBFlatBezelInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BBFlatBezelInterface.h; sourceTree = ""; }; + E470B7F71709F3A0000169F2 /* BBFlatBezelInterface.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BBFlatBezelInterface.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E470B7DC1709F3A0000169F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E470B7E31709F3A0000169F2 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E470B7D51709F3A0000169F2 = { + isa = PBXGroup; + children = ( + E470B7E11709F3A0000169F2 /* Frameworks */, + E470B7E01709F3A0000169F2 /* Products */, + E470B7E41709F3A0000169F2 /* Flat Bezel */, + ); + sourceTree = ""; + }; + E470B7E01709F3A0000169F2 /* Products */ = { + isa = PBXGroup; + children = ( + E470B7DF1709F3A0000169F2 /* Flat Bezel.qsplugin */, + ); + name = Products; + sourceTree = ""; + }; + E470B7E11709F3A0000169F2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E470B7E21709F3A0000169F2 /* Cocoa.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + E470B7E41709F3A0000169F2 /* Flat Bezel */ = { + isa = PBXGroup; + children = ( + E470B7EA1709F3A0000169F2 /* Configuration */, + E470B7E51709F3A0000169F2 /* Supporting Files */, + 42447D78193F6C9D0077B4B2 /* BBBackgroundView.h */, + 42447D79193F6C9D0077B4B2 /* BBBackgroundView.m */, + 42447D7B19407DA00077B4B2 /* BBSearchObjectView.h */, + 42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */, + E470B7F61709F3A0000169F2 /* BBFlatBezelInterface.h */, + E470B7F71709F3A0000169F2 /* BBFlatBezelInterface.m */, + 42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */, + CD3B1BE1285F2E8C004862D7 /* gear-white.png */, + CD3B1BE0285F2E8C004862D7 /* search-white.png */, + 42447D7F1940935E0077B4B2 /* gear-black.png */, + 42447D801940935E0077B4B2 /* search-black.png */, + ); + path = "Flat Bezel"; + sourceTree = ""; + }; + E470B7E51709F3A0000169F2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + E470B7E61709F3A0000169F2 /* Info.plist */, + E470B7E71709F3A0000169F2 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + E470B7EA1709F3A0000169F2 /* Configuration */ = { + isa = PBXGroup; + children = ( + E470B7EB1709F3A0000169F2 /* Common.xcconfig */, + E470B7EC1709F3A0000169F2 /* Debug.xcconfig */, + E470B7ED1709F3A0000169F2 /* Developer.xcconfig */, + E470B7EE1709F3A0000169F2 /* QSPlugIn.xcconfig */, + E470B7EF1709F3A0000169F2 /* Quicksilver.pch */, + E470B7F01709F3A0000169F2 /* Release.xcconfig */, + ); + name = Configuration; + path = /private/tmp/QS/Configuration; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E470B7DE1709F3A0000169F2 /* Flat Bezel */ = { + isa = PBXNativeTarget; + buildConfigurationList = E470B7FB1709F3A0000169F2 /* Build configuration list for PBXNativeTarget "Flat Bezel" */; + buildPhases = ( + E470B7DA1709F3A0000169F2 /* ShellScript */, + E470B7DB1709F3A0000169F2 /* Sources */, + E470B7DC1709F3A0000169F2 /* Frameworks */, + E470B7DD1709F3A0000169F2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Flat Bezel"; + productName = SquareBezel; + productReference = E470B7DF1709F3A0000169F2 /* Flat Bezel.qsplugin */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E470B7D61709F3A0000169F2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1120; + ORGANIZATIONNAME = BRNBW; + TargetAttributes = { + E470B7DE1709F3A0000169F2 = { + LastSwiftMigration = 1410; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = E470B7D91709F3A0000169F2 /* Build configuration list for PBXProject "Flat Bezel" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + English, + en, + ); + mainGroup = E470B7D51709F3A0000169F2; + productRefGroup = E470B7E01709F3A0000169F2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E470B7DE1709F3A0000169F2 /* Flat Bezel */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E470B7DD1709F3A0000169F2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CD3B1BE3285F2E8C004862D7 /* gear-white.png in Resources */, + 42663058193CC1FA00C0DD31 /* BBFlatBezelInterface.xib in Resources */, + E470B7E91709F3A0000169F2 /* InfoPlist.strings in Resources */, + CD3B1BE2285F2E8C004862D7 /* search-white.png in Resources */, + 42447D821940935E0077B4B2 /* gear-black.png in Resources */, + 42447D831940935E0077B4B2 /* search-black.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + E470B7DA1709F3A0000169F2 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "\"$QS_BUILD_ROOT/Tools/bltrversion\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E470B7DB1709F3A0000169F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 42447D7A193F6C9D0077B4B2 /* BBBackgroundView.m in Sources */, + 42447D7D19407DA00077B4B2 /* BBSearchObjectView.m in Sources */, + E470B7F81709F3A0000169F2 /* BBFlatBezelInterface.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + E470B7E71709F3A0000169F2 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + E470B7E81709F3A0000169F2 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E470B7F91709F3A0000169F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E470B7EC1709F3A0000169F2 /* Debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + }; + name = Debug; + }; + E470B7FA1709F3A0000169F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E470B7F01709F3A0000169F2 /* Release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + }; + name = Release; + }; + E470B7FC1709F3A0000169F2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E470B7EE1709F3A0000169F2 /* QSPlugIn.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = "pizza.unlimited.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "Flat Bezel"; + SWIFT_OBJC_BRIDGING_HEADER = "Flat Bezel/FlatBezel-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + E470B7FD1709F3A0000169F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E470B7EE1709F3A0000169F2 /* QSPlugIn.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 12.0; + PRODUCT_BUNDLE_IDENTIFIER = "pizza.unlimited.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "Flat Bezel"; + SWIFT_OBJC_BRIDGING_HEADER = "Flat Bezel/FlatBezel-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E470B7D91709F3A0000169F2 /* Build configuration list for PBXProject "Flat Bezel" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E470B7F91709F3A0000169F2 /* Debug */, + E470B7FA1709F3A0000169F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E470B7FB1709F3A0000169F2 /* Build configuration list for PBXNativeTarget "Flat Bezel" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E470B7FC1709F3A0000169F2 /* Debug */, + E470B7FD1709F3A0000169F2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E470B7D61709F3A0000169F2 /* Project object */; +} diff --git a/Flat Bezel.xcodeproj/xcshareddata/xcschemes/Flat Bezel.xcscheme b/Flat Bezel.xcodeproj/xcshareddata/xcschemes/Flat Bezel.xcscheme new file mode 100644 index 0000000..2812b46 --- /dev/null +++ b/Flat Bezel.xcodeproj/xcshareddata/xcschemes/Flat Bezel.xcscheme @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flat Bezel/BBBackgroundView.h b/Flat Bezel/BBBackgroundView.h new file mode 100644 index 0000000..1c699a2 --- /dev/null +++ b/Flat Bezel/BBBackgroundView.h @@ -0,0 +1,5 @@ +#import + +@interface BBBackgroundView : QSBezelBackgroundView + +@end diff --git a/Flat Bezel/BBBackgroundView.m b/Flat Bezel/BBBackgroundView.m new file mode 100644 index 0000000..7aff10b --- /dev/null +++ b/Flat Bezel/BBBackgroundView.m @@ -0,0 +1,24 @@ +#import "BBBackgroundView.h" + +@implementation BBBackgroundView + +- (void)drawRect:(NSRect)rect { + rect = [self bounds]; + + NSBezierPath *roundRect = [NSBezierPath bezierPath]; + + [roundRect appendBezierPathWithRoundedRectangle:rect withRadius:8]; + [roundRect addClip]; + + BOOL darkMode = [[NSUserDefaults standardUserDefaults] boolForKey:@"QSFlatBezelDarkMode"]; + if (darkMode) { + [[NSColor colorWithRed:.1 green:.1 blue:.1 alpha:.99] set]; + } else { + [[NSColor colorWithRed:1 green:1 blue:1 alpha:.99] set]; + } + NSRectFill(rect); + + [super drawRect:rect]; +} + +@end diff --git a/Flat Bezel/BBFlatBezelInterface.h b/Flat Bezel/BBFlatBezelInterface.h new file mode 100644 index 0000000..301542d --- /dev/null +++ b/Flat Bezel/BBFlatBezelInterface.h @@ -0,0 +1,9 @@ +@interface BBFlatBezelInterface : QSResizingInterfaceController { + NSRect standardRect; +} + +@end + +@interface NSWindow (QSBCInterfaceController) +- (NSTimeInterval)animationResizeTime:(NSRect)newWindowFrame; +@end diff --git a/Flat Bezel/BBFlatBezelInterface.m b/Flat Bezel/BBFlatBezelInterface.m new file mode 100644 index 0000000..a191f81 --- /dev/null +++ b/Flat Bezel/BBFlatBezelInterface.m @@ -0,0 +1,99 @@ +#import "BBFlatBezelInterface.h" + +@interface BBFlatBezelInterface () { + CGRect initialRect; +} +@end + +@implementation BBFlatBezelInterface + +- (id)init { + return [self initWithWindowNibName:@"BBFlatBezelInterface"]; +} + +- (void)windowDidLoad { + initialRect = centerRectInRect([[self window] frame], [[NSScreen mainScreen] frame]); + + [super windowDidLoad]; + + QSWindow *window = (QSWindow *)[self window]; + [window setLevel:NSPopUpMenuWindowLevel]; + [window setBackgroundColor:[NSColor clearColor]]; + [window setOpaque:NO]; + + [window setHideOffset:NSMakePoint(0, 0)]; + [window setShowOffset:NSMakePoint(0, 0)]; + + [window setMovableByWindowBackground:NO]; + [window setFastShow:YES]; + [window setHasShadow:YES]; + + [window setFrame:standardRect display:YES]; + + NSArray *theControls = [NSArray arrayWithObjects:dSelector, aSelector, iSelector, nil]; + for(QSSearchObjectView *theControl in theControls) { + QSObjectCell *theCell = [theControl cell]; + + [theControl setPreferredEdge:NSMinYEdge]; + [(QSWindow *)[(theControl)->resultController window] setHideOffset:NSMakePoint(0, NSMinY([iSelector frame]))]; + [(QSWindow *)[(theControl)->resultController window] setShowOffset:NSMakePoint(0, NSMinY([dSelector frame]))]; + + [theCell setBackgroundColor:[NSColor clearColor]]; + [theCell setFont:[NSFont systemFontOfSize:11 weight:NSFontWeightLight]]; + [theCell setCellRadiusFactor:8]; + + [theCell setHighlightColor:[NSColor colorWithRed:1 green:1 blue:1 alpha:.15]]; + [theCell setTextColor:[NSColor colorWithWhite:.8 alpha:1]]; + [theCell setShowDetails:NO]; + [theCell setState:NSControlStateValueOn]; + [theCell setIconSize:QSSize128]; + [theCell setImagePosition:NSImageAbove]; + } + + [self contractWindow:nil]; +} + +- (NSSize) maxIconSize { + return QSSize32; +} + +- (void)showMainWindow:(id)sender { + [[self window] setFrame:[self rectForState:[self expanded]] display:YES]; + if ([[self window] isVisible]) [[self window] pulse:self]; + [super showMainWindow:sender]; + // Does this need to be here? + [[[self window] contentView] setNeedsDisplay:YES]; +} + +- (void)expandWindow:(id)sender { + if (![self expanded]) + [[self window] setFrame:[self rectForState:YES] display:YES animate:YES]; + [super expandWindow:sender]; +} + +- (void)contractWindow:(id)sender { + if ([self expanded]) + [[self window] setFrame:[self rectForState:NO] display:YES animate:YES]; + [super contractWindow:sender]; +} + +- (NSRect)rectForState:(BOOL)shouldExpand { + NSRect newRect = initialRect; + NSRect screenRect = [[NSScreen mainScreen] frame]; + + if (!shouldExpand) { + newRect.size.width -= 208; + } + + return NSOffsetRect(centerRectInRect(newRect, screenRect), 0, (NSHeight(screenRect) / 5)); +} + +- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect { + return NSOffsetRect(NSInsetRect(rect, 8, 0), 0, 0); +} + +- (NSTimeInterval)animationResizeTime:(NSRect)newWindowFrame { + return 0.01; +} + +@end diff --git a/Flat Bezel/BBFlatBezelInterface.xib b/Flat Bezel/BBFlatBezelInterface.xib new file mode 100644 index 0000000..75378c6 --- /dev/null +++ b/Flat Bezel/BBFlatBezelInterface.xib @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flat Bezel/BBSearchObjectView.h b/Flat Bezel/BBSearchObjectView.h new file mode 100644 index 0000000..b60a637 --- /dev/null +++ b/Flat Bezel/BBSearchObjectView.h @@ -0,0 +1,10 @@ +#import + +@interface BBSearchObjectView : QSSearchObjectView +@end + +@interface BBCollectingSearchObjectView : QSCollectingSearchObjectView +@end + +@interface BBObjectCell : QSObjectCell +@end diff --git a/Flat Bezel/BBSearchObjectView.m b/Flat Bezel/BBSearchObjectView.m new file mode 100644 index 0000000..ba88b0b --- /dev/null +++ b/Flat Bezel/BBSearchObjectView.m @@ -0,0 +1,176 @@ +#import "BBSearchObjectView.h" + +@implementation BBSearchObjectView ++ (Class)cellClass { return [BBObjectCell class]; } + +@end + +@implementation BBCollectingSearchObjectView ++ (Class)cellClass { return [BBObjectCell class]; } + +- (void)drawRect:(NSRect)rect { + NSRect frame = [self frame]; + NSInteger count = [collection count]; + if (![self currentEditor] && count) { + frame.origin = NSZeroPoint; + [[self cell] drawWithFrame:frame inView:self]; + NSInteger i; + CGFloat iconSize = collectionSpace?collectionSpace:16; + CGFloat opacity = collecting?1.0:0.75; + QSObject *object; + CGFloat totalWidth = iconSize + 2; + for (i = 0; i + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + Flat Bezel Interface + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Flat Bezel Interface + CFBundlePackageType + BNDL + CFBundleShortVersionString + 2.0 + CFBundleVersion + 6 + QSRequirements + + minHostVersion + 4039 + + QSPlugIn + + author + Ruben Beltran del Rio + categories + + Interfaces + + description + A new take on the Bezel Interface, using a flatter look. + extendedDescription + <h2>Flat Bezel Interface</h2> +<p>A new take on the Bezel Interface, using a flatter look.</p> +<h3>Colors</h3> +<p>Both light mode and dark mode are supported by this plugin. Choose your color preferences by enabling the Flat Bezel interface in the Appearance preferences, and then clicking the 'Customize' button.</p> + + +<h3>Credits</h3> + +This plugin was created by Ruben Beltran del Río, building on top of the Yosemite interface that was originally built by Mikkel Malmberg (<a href="https://github.com/mikker/">@mikker</a>), and updated by the Patrick Robertson and the Quicksilver Development Team. + + QSRegistration + + QSPreferencePanes + + BBFlatBezelPrefs + + class + BBFlatBezelPrefs + description + Flat Bezel interface preferences + icon + + name + Flat Bezel + nibBundle + pizza.unlimited.Flat-Bezel + nibName + BBFlatBezelPrefs + type + hidden + + + QSCommandInterfaceControllers + + Flat Bezel + BBFlatBezelInterface + + + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8960702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 Mikkel Malmberg + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8e9d5e --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +### Flat Bezel qsplugin + +**To-do: Add Screenshot** + +Pre-alpha development. + +A new take on the Bezel Interface, using a flatter look.