Przeglądaj źródła

Monospace font for metadata

Minor font adjustments
Tanner Bennett 6 lat temu
rodzic
commit
3199063914

+ 0 - 1
Classes/ExplorerInterface/FLEXWindow.m

@@ -15,7 +15,6 @@
 {
     self = [super initWithFrame:frame];
     if (self) {
-        self.backgroundColor = UIColor.clearColor;
         // Some apps have windows at UIWindowLevelStatusBar + n.
         // If we make the window level too high, we block out UIAlertViews.
         // There's a balance between staying above the app's windows and staying below alerts.

+ 1 - 1
Classes/ObjectExplorers/Sections/FLEXMetadataSection.m

@@ -155,7 +155,7 @@
 }
 
 - (NSString *)reuseIdentifierForRow:(NSInteger)row {
-    return kFLEXDetailCell;
+    return kFLEXCodeFontCell;
 }
 
 - (UIViewController *)viewControllerToPushForRow:(NSInteger)row {

+ 4 - 0
Classes/ObjectExplorers/Sections/Shortcuts/FLEXClassShortcuts.m

@@ -47,6 +47,10 @@
     return UITableViewCellAccessoryDisclosureIndicator;
 }
 
+- (NSString *)customReuseIdentifierWith:(id)object {
+    return nil;
+}
+
 
 @end
 

+ 2 - 0
Classes/ObjectExplorers/Sections/Shortcuts/FLEXShortcut.h

@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
 - (nullable UIViewController *)viewerWith:(id)object;
 /// Basically, whether or not to show a detail disclosure indicator
 - (UITableViewCellAccessoryType)accessoryTypeWith:(id)object;
+/// If nil is returned, the default reuse identifier is used
+- (nullable NSString *)customReuseIdentifierWith:(id)object;
 
 @optional
 /// Called when the (i) button is pressed if the accessory type includes it

+ 13 - 0
Classes/ObjectExplorers/Sections/Shortcuts/FLEXShortcut.m

@@ -16,6 +16,7 @@
 #import "FLEXFieldEditorViewController.h"
 #import "FLEXMethodCallingViewController.h"
 #import "FLEXMetadataSection.h"
+#import "FLEXTableView.h"
 
 
 #pragma mark - FLEXShortcut
@@ -111,6 +112,14 @@
     return UITableViewCellAccessoryDisclosureIndicator;
 }
 
+- (NSString *)customReuseIdentifierWith:(id)object {
+    if (self.metadataKind) {
+        return kFLEXCodeFontCell;
+    }
+
+    return nil;
+}
+
 #pragma mark - Helpers
 
 - (FLEXProperty *)property { return _item; }
@@ -173,4 +182,8 @@
     return self.accessoryTypeFuture(object);
 }
 
+- (NSString *)customReuseIdentifierWith:(id)object {
+    return nil;
+}
+
 @end

+ 1 - 1
Classes/ObjectExplorers/Sections/Shortcuts/FLEXShortcutsSection.m

@@ -198,7 +198,7 @@
 }
 
 - (NSString *)reuseIdentifierForRow:(NSInteger)row {
-    return kFLEXMultilineDetailCell;
+    return [self.shortcuts[row] customReuseIdentifierWith:self.object] ?: kFLEXMultilineDetailCell;
 }
 
 - (void)configureCell:(__kindof FLEXTableViewCell *)cell forRow:(NSInteger)row {

+ 5 - 0
Classes/ObjectExplorers/Views/FLEXCodeFontCell.m

@@ -16,7 +16,12 @@
     
     self.titleLabel.font = UIFont.flex_codeFont;
     self.subtitleLabel.font = UIFont.flex_codeFont;
+
+    self.titleLabel.adjustsFontSizeToFitWidth = YES;
+    self.titleLabel.minimumScaleFactor = 0.9;
     self.subtitleLabel.adjustsFontSizeToFitWidth = YES;
+    self.subtitleLabel.minimumScaleFactor = 0.75;
+    self.subtitleLabel.numberOfLines = 5;
 }
 
 @end

+ 1 - 1
Classes/Utility/FLEXColor.m

@@ -83,7 +83,7 @@
 }
 
 + (UIColor *)deemphasizedTextColor {
-    return FLEXDynamicColor(tertiaryLabelColor, lightGrayColor);
+    return FLEXDynamicColor(secondaryLabelColor, lightGrayColor);
 }
 
 #pragma mark - UI Element Colors