]> git.r.bdr.sh - rbdr/Flat-Bezel.qsplugin/commitdiff
Improve drawing, add padding to bezel
authorRuben Beltran del Rio <redacted>
Thu, 9 Feb 2023 21:51:47 +0000 (22:51 +0100)
committerRuben Beltran del Rio <redacted>
Thu, 9 Feb 2023 21:51:47 +0000 (22:51 +0100)
Flat Bezel.xcodeproj/project.pbxproj
Flat Bezel/BBFlatBezelInterface.m
Flat Bezel/BBFlatBezelInterface.xib
Flat Bezel/BBSearchObjectView.m
Flat Bezel/FlatBezelObjectCell.swift [new file with mode: 0644]
Flat Bezel/FlatBezelSearchObjectView.swift [new file with mode: 0644]
Flat Bezel/gear-black.png [deleted file]
Flat Bezel/gear-white.png [deleted file]
Flat Bezel/search-black.png [deleted file]
Flat Bezel/search-white.png [deleted file]

index 1dc96c05c773774e246b89514f5049a4c5ba8dc7..adb78ea62d4b863058b6fd04f0db9985331acff7 100644 (file)
@@ -8,12 +8,10 @@
 
 /* Begin PBXBuildFile section */
                42447D7D19407DA00077B4B2 /* BBSearchObjectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */; };
 
 /* Begin PBXBuildFile section */
                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 */; };
                B576D2F52993FBD400A8B645 /* BackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B576D2F42993FBD400A8B645 /* BackgroundView.swift */; };
                42663058193CC1FA00C0DD31 /* BBFlatBezelInterface.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */; };
                B576D2F52993FBD400A8B645 /* BackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B576D2F42993FBD400A8B645 /* BackgroundView.swift */; };
-               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 */; };
+               B57F7B90299405B7005F64AC /* FlatBezelSearchObjectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57F7B8F299405B7005F64AC /* FlatBezelSearchObjectView.swift */; };
+               B57F7B922994063C005F64AC /* FlatBezelObjectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57F7B912994063C005F64AC /* FlatBezelObjectCell.swift */; };
                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 */; };
                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 */; };
 /* Begin PBXFileReference section */
                42447D7B19407DA00077B4B2 /* BBSearchObjectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BBSearchObjectView.h; sourceTree = "<group>"; };
                42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BBSearchObjectView.m; sourceTree = "<group>"; };
 /* Begin PBXFileReference section */
                42447D7B19407DA00077B4B2 /* BBSearchObjectView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BBSearchObjectView.h; sourceTree = "<group>"; };
                42447D7C19407DA00077B4B2 /* BBSearchObjectView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BBSearchObjectView.m; sourceTree = "<group>"; };
-               42447D7F1940935E0077B4B2 /* gear-black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gear-black.png"; sourceTree = "<group>"; };
-               42447D801940935E0077B4B2 /* search-black.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search-black.png"; sourceTree = "<group>"; };
                42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BBFlatBezelInterface.xib; sourceTree = "<group>"; };
                B576D2F42993FBD400A8B645 /* BackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundView.swift; sourceTree = "<group>"; };
                B576D2F62993FD7500A8B645 /* FlatBezel-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FlatBezel-Bridging-Header.h"; sourceTree = "<group>"; };
                42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BBFlatBezelInterface.xib; sourceTree = "<group>"; };
                B576D2F42993FBD400A8B645 /* BackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundView.swift; sourceTree = "<group>"; };
                B576D2F62993FD7500A8B645 /* FlatBezel-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FlatBezel-Bridging-Header.h"; sourceTree = "<group>"; };
-               CD3B1BE0285F2E8C004862D7 /* search-white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "search-white.png"; sourceTree = "<group>"; };
-               CD3B1BE1285F2E8C004862D7 /* gear-white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gear-white.png"; sourceTree = "<group>"; };
+               B57F7B8F299405B7005F64AC /* FlatBezelSearchObjectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlatBezelSearchObjectView.swift; sourceTree = "<group>"; };
+               B57F7B912994063C005F64AC /* FlatBezelObjectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlatBezelObjectCell.swift; sourceTree = "<group>"; };
                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; };
                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; };
                                E470B7F61709F3A0000169F2 /* BBFlatBezelInterface.h */,
                                E470B7F71709F3A0000169F2 /* BBFlatBezelInterface.m */,
                                42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */,
                                E470B7F61709F3A0000169F2 /* BBFlatBezelInterface.h */,
                                E470B7F71709F3A0000169F2 /* BBFlatBezelInterface.m */,
                                42663057193CC1FA00C0DD31 /* BBFlatBezelInterface.xib */,
+                               B57F7B8F299405B7005F64AC /* FlatBezelSearchObjectView.swift */,
+                               B57F7B912994063C005F64AC /* FlatBezelObjectCell.swift */,
                                B576D2F42993FBD400A8B645 /* BackgroundView.swift */,
                                B576D2F42993FBD400A8B645 /* BackgroundView.swift */,
-                               CD3B1BE1285F2E8C004862D7 /* gear-white.png */,
-                               CD3B1BE0285F2E8C004862D7 /* search-white.png */,
-                               42447D7F1940935E0077B4B2 /* gear-black.png */,
-                               42447D801940935E0077B4B2 /* search-black.png */,
                        );
                        path = "Flat Bezel";
                        sourceTree = "<group>";
                        );
                        path = "Flat Bezel";
                        sourceTree = "<group>";
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
                        isa = PBXResourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               CD3B1BE3285F2E8C004862D7 /* gear-white.png in Resources */,
                                42663058193CC1FA00C0DD31 /* BBFlatBezelInterface.xib in Resources */,
                                E470B7E91709F3A0000169F2 /* InfoPlist.strings 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;
                };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        buildActionMask = 2147483647;
                        files = (
                                B576D2F52993FBD400A8B645 /* BackgroundView.swift in Sources */,
                        buildActionMask = 2147483647;
                        files = (
                                B576D2F52993FBD400A8B645 /* BackgroundView.swift in Sources */,
+                               B57F7B90299405B7005F64AC /* FlatBezelSearchObjectView.swift in Sources */,
                                42447D7D19407DA00077B4B2 /* BBSearchObjectView.m in Sources */,
                                E470B7F81709F3A0000169F2 /* BBFlatBezelInterface.m in Sources */,
                                42447D7D19407DA00077B4B2 /* BBSearchObjectView.m in Sources */,
                                E470B7F81709F3A0000169F2 /* BBFlatBezelInterface.m in Sources */,
+                               B57F7B922994063C005F64AC /* FlatBezelObjectCell.swift in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index a05a9247df653be82e5438f9b77bbc2f96933f66..e430de8fa21351bcc56eba4f0671e89ac8775b0f 100644 (file)
@@ -82,7 +82,7 @@
     NSRect screenRect = [[NSScreen mainScreen] frame];
     
     if (!shouldExpand) {
     NSRect screenRect = [[NSScreen mainScreen] frame];
     
     if (!shouldExpand) {
-        newRect.size.width -= 208;
+        newRect.size.width -= 192;
     }
     
     return NSOffsetRect(centerRectInRect(newRect, screenRect), 0, (NSHeight(screenRect) / 5));
     }
     
     return NSOffsetRect(centerRectInRect(newRect, screenRect), 0, (NSHeight(screenRect) / 5));
index dae62227f4114b5aee9cbebb40cc2fce6bbf5b75..3aa05ea027e2f50ccad9552eb885cb0222418338 100644 (file)
         <window title="Bezel Interface" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="9" userLabel="mainWindow" customClass="QSBorderlessWindow">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" nonactivatingPanel="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
         <window title="Bezel Interface" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="9" userLabel="mainWindow" customClass="QSBorderlessWindow">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" nonactivatingPanel="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="530" y="653" width="648" height="200"/>
+            <rect key="contentRect" x="530" y="653" width="608" height="200"/>
             <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
             <value key="minSize" type="size" width="440" height="200"/>
             <view key="contentView" id="6" customClass="BackgroundView" customModule="Flat_Bezel" customModuleProvider="target">
             <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
             <value key="minSize" type="size" width="440" height="200"/>
             <view key="contentView" id="6" customClass="BackgroundView" customModule="Flat_Bezel" customModuleProvider="target">
-                <rect key="frame" x="0.0" y="0.0" width="648" height="200"/>
+                <rect key="frame" x="0.0" y="0.0" width="608" height="200"/>
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="68" customClass="BBCollectingSearchObjectView">
                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                 <subviews>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="68" customClass="BBCollectingSearchObjectView">
-                        <rect key="frame" x="0.0" y="0.0" width="200" height="200"/>
+                        <rect key="frame" x="8" y="8" width="184" height="184"/>
                         <constraints>
                         <constraints>
-                            <constraint firstAttribute="height" constant="200" id="SwQ-fC-3aw"/>
-                            <constraint firstAttribute="width" constant="200" id="Zol-hr-3Bk"/>
+                            <constraint firstAttribute="height" constant="184" id="SwQ-fC-3aw"/>
+                            <constraint firstAttribute="width" constant="184" id="Zol-hr-3Bk"/>
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="69" id="105"/>
                         </connections>
                     </customView>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="69" customClass="BBSearchObjectView">
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="69" id="105"/>
                         </connections>
                     </customView>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="69" customClass="BBSearchObjectView">
-                        <rect key="frame" x="208" y="0.0" width="200" height="200"/>
+                        <rect key="frame" x="200" y="8" width="184" height="184"/>
                         <constraints>
                         <constraints>
-                            <constraint firstAttribute="width" constant="200" id="O3w-M3-b05"/>
-                            <constraint firstAttribute="height" constant="200" id="XPL-72-l7r"/>
+                            <constraint firstAttribute="width" constant="184" id="O3w-M3-b05"/>
+                            <constraint firstAttribute="height" constant="184" id="XPL-72-l7r"/>
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="70" id="106"/>
                         </connections>
                     </customView>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="70" customClass="BBCollectingSearchObjectView">
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="70" id="106"/>
                         </connections>
                     </customView>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="70" customClass="BBCollectingSearchObjectView">
-                        <rect key="frame" x="416" y="0.0" width="200" height="200"/>
+                        <rect key="frame" x="392" y="8" width="184" height="184"/>
                         <constraints>
                         <constraints>
-                            <constraint firstAttribute="width" constant="200" id="Jbn-VW-sSJ"/>
-                            <constraint firstAttribute="height" constant="200" id="X3X-S6-KrY"/>
+                            <constraint firstAttribute="width" constant="184" id="Jbn-VW-sSJ"/>
+                            <constraint firstAttribute="height" constant="184" id="X3X-S6-KrY"/>
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="68" id="104"/>
                         </connections>
                     </customView>
                     <progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="192">
                         </constraints>
                         <connections>
                             <outlet property="nextKeyView" destination="68" id="104"/>
                         </connections>
                     </customView>
                     <progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="192">
-                        <rect key="frame" x="624" y="8" width="16" height="16"/>
+                        <rect key="frame" x="584" y="8" width="16" height="16"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="16" id="Py4-hV-7HG"/>
                         </constraints>
                     </progressIndicator>
                     <button translatesAutoresizingMaskIntoConstraints="NO" id="209" customClass="QSMenuButton">
                         <constraints>
                             <constraint firstAttribute="width" constant="16" id="Py4-hV-7HG"/>
                         </constraints>
                     </progressIndicator>
                     <button translatesAutoresizingMaskIntoConstraints="NO" id="209" customClass="QSMenuButton">
-                        <rect key="frame" x="624" y="176" width="16" height="16"/>
+                        <rect key="frame" x="584" y="176" width="16" height="16"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="16" id="cvg-xh-bvD"/>
                             <constraint firstAttribute="width" constant="16" id="w12-Bf-x2f"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="16" id="cvg-xh-bvD"/>
                             <constraint firstAttribute="width" constant="16" id="w12-Bf-x2f"/>
@@ -78,7 +78,7 @@
                         <color key="contentTintColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                     </button>
                     <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="191">
                         <color key="contentTintColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                     </button>
                     <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="191">
-                        <rect key="frame" x="622" y="176" width="20" height="16"/>
+                        <rect key="frame" x="582" y="176" width="20" height="16"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="16" id="Yy8-MR-Hc2"/>
                             <constraint firstAttribute="width" constant="16" id="coj-vh-kaj"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="16" id="Yy8-MR-Hc2"/>
                             <constraint firstAttribute="width" constant="16" id="coj-vh-kaj"/>
                     <constraint firstAttribute="trailing" secondItem="192" secondAttribute="trailing" constant="8" id="S36-iH-Apn"/>
                     <constraint firstItem="69" firstAttribute="leading" secondItem="68" secondAttribute="trailing" constant="8" id="VOZ-kp-hVQ"/>
                     <constraint firstAttribute="trailing" secondItem="209" secondAttribute="trailing" constant="8" id="ZBS-80-x88"/>
                     <constraint firstAttribute="trailing" secondItem="192" secondAttribute="trailing" constant="8" id="S36-iH-Apn"/>
                     <constraint firstItem="69" firstAttribute="leading" secondItem="68" secondAttribute="trailing" constant="8" id="VOZ-kp-hVQ"/>
                     <constraint firstAttribute="trailing" secondItem="209" secondAttribute="trailing" constant="8" id="ZBS-80-x88"/>
-                    <constraint firstItem="69" firstAttribute="top" secondItem="6" secondAttribute="top" id="Zec-BE-M9X"/>
-                    <constraint firstItem="70" firstAttribute="top" secondItem="6" secondAttribute="top" id="jQN-Vd-Qm0"/>
+                    <constraint firstItem="69" firstAttribute="top" secondItem="6" secondAttribute="top" constant="8" id="Zec-BE-M9X"/>
+                    <constraint firstItem="70" firstAttribute="top" secondItem="6" secondAttribute="top" constant="8" id="jQN-Vd-Qm0"/>
                     <constraint firstItem="191" firstAttribute="top" secondItem="209" secondAttribute="bottom" constant="-16" id="jqz-xK-7Wg"/>
                     <constraint firstItem="191" firstAttribute="top" secondItem="209" secondAttribute="bottom" constant="-16" id="jqz-xK-7Wg"/>
-                    <constraint firstItem="68" firstAttribute="leading" secondItem="6" secondAttribute="leading" id="m72-ls-RGc"/>
-                    <constraint firstItem="68" firstAttribute="top" secondItem="6" secondAttribute="top" id="msf-m2-n1U"/>
+                    <constraint firstItem="68" firstAttribute="leading" secondItem="6" secondAttribute="leading" constant="8" id="m72-ls-RGc"/>
+                    <constraint firstItem="68" firstAttribute="top" secondItem="6" secondAttribute="top" constant="8" id="msf-m2-n1U"/>
                 </constraints>
             </view>
             <connections>
                 </constraints>
             </view>
             <connections>
index ba88b0bbc2f26ea256f879fd7eeb0e21838d979d..0722e0c25b38e212fb49912cee4c128b8a360666 100644 (file)
   [titleString drawInRect:centerRectInRect(centerRect, textDrawRect)];
 }
 
   [titleString drawInRect:centerRectInRect(centerRect, textDrawRect)];
 }
 
-@end
-
-
-
+- (void)drawSearchPlaceholderWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+  NSString *defaultText = NSLocalizedStringWithDefaultValue(@"Type to search", nil, [NSBundle mainBundle], @"Type to search", @"Hint that appears in the first pane of the QS interface when it's empty.");
+  NSSize textSize = [defaultText sizeWithAttributes:nameAttributes];
+  NSRect textRect = centerRectInRect(rectFromSize(textSize), cellFrame);
+  BOOL isFirstResponder = [[controlView window] firstResponder] == controlView && ![controlView isKindOfClass:[NSTableView class]];
+  
+  if (isFirstResponder && [controlView isKindOfClass:[QSSearchObjectView class]]) {
+    NSImage *find = [NSImage imageWithSystemSymbolName:@"magnifyingglass.circle.fill" accessibilityDescription:nil];
+    
+    
+    [find setSize:QSSize16];
+    NSRect findImageRect = expelRectFromRectOnEdge(centerRectInRect(rectFromSize([find size]), cellFrame), textRect, NSRectEdgeMinX, -2);
+    
+  
+    NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
+    [graphicsContext saveGraphicsState];
+    CGContextRef context = [graphicsContext CGContext];
+    CGContextBeginTransparencyLayerWithRect(context, findImageRect, nil);
+    CGContextSetBlendMode(context, kCGBlendModeNormal);
+    [find drawInRect:findImageRect fromRect:rectFromSize([find size]) operation:NSCompositingOperationSourceOver fraction:1];
+    CGContextSetBlendMode(context, kCGBlendModeSourceIn);
+    CGContextSetFillColorWithColor(context, [[NSColor textColor] CGColor]);
+    CGContextFillRect(context, findImageRect);
+    CGContextEndTransparencyLayer(context);
+
+    [defaultText drawInRect:textRect withAttributes:nameAttributes];
+  }
+}
 
 
+@end
diff --git a/Flat Bezel/FlatBezelObjectCell.swift b/Flat Bezel/FlatBezelObjectCell.swift
new file mode 100644 (file)
index 0000000..211f332
--- /dev/null
@@ -0,0 +1,133 @@
+//
+//  FlatBezelObjectCell.swift
+//  Flat Bezel
+//
+//  Created by Ruben Beltran del Rio on 2/8/23.
+//  Copyright © 2023 BRNBW. All rights reserved.
+//
+/*
+import Foundation
+import Cocoa
+
+class FlatBezelObjectCell: QSObjectCell {
+  let preferredImagePosition: NSControl.ImagePosition = .imageAbove
+  
+  override func draw(withFrame cellFrame: NSRect, in controlView: NSView!) {
+    let isFirstResponder = controlView.window?.firstResponder == controlView && !controlView.isKind(of: NSTableView.self)
+    
+    let dropTarget = self.isHighlighted && self.highlightsBy.contains(NSCell.StyleMask.changeBackgroundCellMask) && !self.isBezeled
+    
+    var fillColor: NSColor = self.backgroundColor ?? .textBackgroundColor
+    if (isFirstResponder) {
+      fillColor = self.highlightColor()
+    }
+    if (dropTarget) {
+      fillColor = NSColor(red: 0.77, green: 0.91, blue: 0.96, alpha: 1)
+    }
+    
+    var strokeColor: NSColor = .clear
+    
+    fillColor.setFill()
+    strokeColor.setStroke()
+    
+    let roundRect = NSBezierPath()
+    roundRect.appendRoundedRect(cellFrame, xRadius: cellRadiusFactor(), yRadius: cellRadiusFactor())
+    roundRect.fill()
+    
+    self.drawInterior(withFrame: self.drawingRect(forBounds: cellFrame), in: controlView)
+  }
+  
+  override func titleRect(forBounds rect: NSRect) -> NSRect {
+    super.titleRect(forBounds: rect.offsetBy(dx: 0, dy: -4))
+  }
+  
+  override func drawText(for drawObject: QSObject!, withFrame cellFrame: NSRect, in controlView: NSView!) {
+    if self.imagePosition == .imageOnly {
+      return;
+    }
+    
+    var abbrString: String? = nil
+    if controlView.responds(to: #selector(QSSearchObjectView.matchedString)) {
+      abbrString = (controlView as! QSSearchObjectView).matchedString()
+    }
+    
+    var nameString: String? = drawObject.displayName()
+    var hitMask: AutoreleasingUnsafeMutablePointer<NSIndexSet?>? = nil
+    
+    var ranker = drawObject.ranker()
+    if let ranker, let abbrString {
+      nameString = ranker.matchedString(forAbbreviation: abbrString, hitmask: hitMask, inContext: nil)
+    }
+    
+    var rankedStringIsName = nameString == drawObject.displayName()
+    if nameString == nil {
+      nameString = drawObject.identifier() ?? "Unknown"
+    }
+    
+    var useAlternateColor = false
+    if let controlView = controlView as? NSTableView {
+      useAlternateColor = controlView.isRowSelected(controlView.row(at: cellFrame.origin))
+    }
+    
+    var mainColor: NSColor? = textColor()
+    if mainColor == nil {
+      mainColor = useAlternateColor ? .alternateSelectedControlTextColor : .controlTextColor
+    }
+    
+    var fadedColor = mainColor!.withAlphaComponent(0.50)
+    var textDrawRect = titleRect(forBounds: cellFrame)
+    
+    var titleString = NSMutableAttributedString(string: nameString!)
+    titleString.setAttributes(rankedStringIsName ? nameAttributes : detailAttributes, range: NSMakeRange(0, titleString.length))
+    
+    if abbrString != nil && abbrString!.hasPrefix("QSActionMnemonic") {
+      titleString.addAttribute(.foregroundColor, value: rankedStringIsName ? fadedColor : fadedColor.withAlphaComponent(0.8), range: NSMakeRange(0, titleString.length))
+    } else {
+      var i = 0
+      var j = 0
+      var hits: [Int] = []
+      count = hitMask?.
+    }
+  }
+}
+
+
+    NSUInteger i = 0;
+    NSUInteger j = 0;
+    NSUInteger hits[[titleString length]];
+    NSUInteger count = [hitMask getIndexes:(NSUInteger *)&hits maxCount:[titleString length] inIndexRange:nil];
+    NSDictionary *attributes = @{
+      NSForegroundColorAttributeName:                                 rankedStringIsName ? mainColor : fadedColor
+    };
+    for(i = 0; i<count; i += j) {
+      for (j = 1; i+j<count && hits[i+j-1] +1 == hits[i+j]; j++);
+      [titleString addAttributes:attributes range:NSMakeRange(hits[i], j)];
+    }
+  } else {
+    [titleString addAttribute:NSBaselineOffsetAttributeName value:[NSNumber numberWithDouble:-1.0] range:NSMakeRange(0, [titleString length])];
+  }
+
+  if (showDetails) {
+    NSString *detailsString = [drawObject details];
+    
+    NSRange returnRange = [detailsString rangeOfString:@"\n"];
+    if (returnRange.location != NSNotFound) {
+      detailsString = [detailsString substringToIndex:returnRange.location];
+    }
+
+    detailsAttributes = [detailsAttributes mutableCopy];
+    [detailsAttributes setValue:[NSColor grayColor] forKey:NSForegroundColorAttributeName];
+    
+    if (detailsString && detailsString.length && ![detailsString isEqualToString:nameString]) {
+      [titleString appendAttributedString:[[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"\n%@",detailsString] attributes:detailsAttributes] autorelease]];
+    }
+  }
+
+  NSRect centerRect = rectFromSize([titleString size]);
+  centerRect.size.width = NSWidth(textDrawRect);
+  centerRect.size.height = MIN(NSHeight(textDrawRect), centerRect.size.height);
+  [titleString drawInRect:centerRectInRect(centerRect, textDrawRect)];
+}
+
+@end
+*/
diff --git a/Flat Bezel/FlatBezelSearchObjectView.swift b/Flat Bezel/FlatBezelSearchObjectView.swift
new file mode 100644 (file)
index 0000000..fdd88d5
--- /dev/null
@@ -0,0 +1,16 @@
+//
+//  SearchObjectView.swift
+//  Flat Bezel
+//
+//  Created by Ruben Beltran del Rio on 2/8/23.
+//  Copyright © 2023 BRNBW. All rights reserved.
+//
+/*
+import Foundation
+
+class FlatBezelSearchObjectView: QSSearchObjectView {
+  static func cellClass() -> AnyClass {
+    return FlatBezelObjectCell.self
+  }
+}
+*/
diff --git a/Flat Bezel/gear-black.png b/Flat Bezel/gear-black.png
deleted file mode 100755 (executable)
index 3ebdfe6..0000000
Binary files a/Flat Bezel/gear-black.png and /dev/null differ
diff --git a/Flat Bezel/gear-white.png b/Flat Bezel/gear-white.png
deleted file mode 100755 (executable)
index 169f6cb..0000000
Binary files a/Flat Bezel/gear-white.png and /dev/null differ
diff --git a/Flat Bezel/search-black.png b/Flat Bezel/search-black.png
deleted file mode 100755 (executable)
index e85640e..0000000
Binary files a/Flat Bezel/search-black.png and /dev/null differ
diff --git a/Flat Bezel/search-white.png b/Flat Bezel/search-white.png
deleted file mode 100755 (executable)
index e6048b7..0000000
Binary files a/Flat Bezel/search-white.png and /dev/null differ