]> git.r.bdr.sh - rbdr/Flat-Bezel.qsplugin/commitdiff
New icons + fix version
authorRuben Beltran del Rio <redacted>
Thu, 16 Feb 2023 18:15:53 +0000 (19:15 +0100)
committerRuben Beltran del Rio <redacted>
Thu, 16 Feb 2023 18:15:53 +0000 (19:15 +0100)
Flat Bezel.xcodeproj/project.pbxproj
Flat Bezel/BBFlatBezelInterface.m
Flat Bezel/BBObjectCell.m
Info.plist

index 57b07293b39c2047b86beafd108c726674fb9890..5273a2c1b8b1d53cbeb53a1c49af574af962f724 100644 (file)
                                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 = "";
                                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 = "";
index bac396fbff57bac5136117f491128fdbd315e53e..47af67f475b8aefc3d56f9d48476feb44251e4d6 100644 (file)
@@ -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]];
index 40bde4dd6cf27bce11ee139a7200b0ef91419809..7bf1b3cc2039984b47f8d1d7d0fe5ff28d0932c3 100644 (file)
@@ -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];
   }
 }
 
+- (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
index 8772ba802f68f9efeef0e484f426dcd46c3336e3..c83db37d8641cf1540fd3114b7c5e73fe3be83f6 100644 (file)
@@ -17,7 +17,7 @@
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.0.0</string>
+       <string>$(MARKETING_VERSION)</string>
        <key>CFBundleVersion</key>
        <string>18</string>
        <key>QSPlugIn</key>