From: Ruben Beltran del Rio Date: Thu, 16 Feb 2023 18:15:53 +0000 (+0100) Subject: New icons + fix version X-Git-Tag: 1.1.0~1 X-Git-Url: https://git.r.bdr.sh/rbdr/Flat-Bezel.qsplugin/commitdiff_plain/80583e8f2fb92146b8c59e36636f690af7f13eb0?hp=6c2cdbc5ffb3ec1775c25d122751bddc5d205b6a New icons + fix version --- diff --git a/Flat Bezel.xcodeproj/project.pbxproj b/Flat Bezel.xcodeproj/project.pbxproj index 57b0729..5273a2c 100644 --- a/Flat Bezel.xcodeproj/project.pbxproj +++ b/Flat Bezel.xcodeproj/project.pbxproj @@ -294,6 +294,7 @@ DEVELOPMENT_TEAM = S68NHQVJXW; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = "pizza.unlimited.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "Flat Bezel"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -318,6 +319,7 @@ DEVELOPMENT_TEAM = S68NHQVJXW; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 12.0; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = "pizza.unlimited.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "Flat Bezel"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Flat Bezel/BBFlatBezelInterface.m b/Flat Bezel/BBFlatBezelInterface.m index bac396f..47af67f 100644 --- a/Flat Bezel/BBFlatBezelInterface.m +++ b/Flat Bezel/BBFlatBezelInterface.m @@ -40,7 +40,7 @@ [theCell setBackgroundColor:[NSColor clearColor]]; [theCell setFont:[NSFont systemFontOfSize:11 weight:NSFontWeightLight]]; - [theCell setCellRadiusFactor:4]; + [theCell setCellRadiusFactor:32]; [theCell setHighlightColor:[NSColor colorWithRed:1 green:1 blue:1 alpha:.15]]; [theCell setTextColor:[NSColor textColor]]; diff --git a/Flat Bezel/BBObjectCell.m b/Flat Bezel/BBObjectCell.m index 40bde4d..7bf1b3c 100644 --- a/Flat Bezel/BBObjectCell.m +++ b/Flat Bezel/BBObjectCell.m @@ -27,7 +27,7 @@ [strokeColor setStroke]; NSBezierPath *roundRect = [NSBezierPath bezierPath]; - [roundRect appendBezierPathWithRoundedRectangle:cellFrame withRadius:cellRadiusFactor]; + [roundRect appendBezierPathWithRoundedRectangle:cellFrame withRadius:NSHeight(cellFrame)/cellRadiusFactor]; [roundRect fill]; [self drawInteriorWithFrame:[self drawingRectForBounds:cellFrame] inView:controlView]; @@ -157,4 +157,55 @@ } } +- (void)drawIconForObject:(QSObject *)object withFrame:(NSRect)cellFrame inView:(NSView *)controlView { + NSImage *image = [object icon]; + NSString *iconName = nil; + NSImageSymbolConfiguration *iconConfig = nil; + if ([[image name] isEqualToString: @"defaultAction"]) { + iconName = @"gearshape.circle"; + } + else if ([[image name] isEqualToString: @"Find"]) { + iconName = @"magnifyingglass"; + } + else if ([[image name] isEqualToString: @"Object"]) { + iconName = @"cube.transparent"; + iconConfig = [NSImageSymbolConfiguration configurationWithHierarchicalColor:[NSColor controlAccentColor]]; + } + else if ([[image name] isEqualToString: @"ContactAddress"]) { + iconName = @"mappin.circle"; + } + else if ([[image name] isEqualToString: @"ContactEmail"]) { + iconName = @"envelope.circle"; + } + else if ([[image name] isEqualToString: @"ContactPhone"]) { + iconName = @"phone.circle"; + } + else if ([[image name] isEqualToString: @"DefaultBookmarkIcon"]) { + iconName = @"link.circle"; + } + else if ([[image name] isEqualToString: @"Catalog"]) { + iconName = @"sparkles.rectangle.stack"; + } + else if ([[image name] isEqualToString: @"Triggers"]) { + iconName = @"bolt.fill"; + } + + + if (iconName != nil) { + NSImage *newIcon = [NSImage imageWithSystemSymbolName:iconName accessibilityDescription:[image name]]; + + if (iconConfig == nil) { + NSArray *colors = [NSArray arrayWithObjects:[NSColor textColor], [NSColor controlAccentColor], nil]; + iconConfig = [NSImageSymbolConfiguration configurationWithPaletteColors:colors]; + } + + QSObject *newObject = [QSObject objectWithName:[object name]]; + [newObject setIcon:[newIcon imageWithSymbolConfiguration:iconConfig]]; + [newObject setIconLoaded:[object iconLoaded]]; + return [super drawIconForObject: newObject withFrame:cellFrame inView:controlView]; + } + + [super drawIconForObject: object withFrame:cellFrame inView:controlView]; +} + @end diff --git a/Info.plist b/Info.plist index 8772ba8..c83db37 100644 --- a/Info.plist +++ b/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0.0 + $(MARKETING_VERSION) CFBundleVersion 18 QSPlugIn