- newUI ios12 compatibility

- settings wighet them color
- minor tweaks
This commit is contained in:
TrueZhuanjia
2025-06-07 21:28:40 +08:00
parent a64a29ce07
commit dfaa4005bb
15 changed files with 170 additions and 108 deletions
@@ -911,7 +911,7 @@ const int FrontViewPositionNone = 0xff;
_dockedNavBar.translatesAutoresizingMaskIntoConstraints = NO;
_dockedNavBar.userInteractionEnabled = YES;
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
UINavigationBarAppearance *navBarAppearanceStandard = [[UINavigationBarAppearance alloc] init];
[navBarAppearanceStandard configureWithOpaqueBackground]; // 不透明
navBarAppearanceStandard.backgroundColor =[ThemeManager appBackgroundColor];; // 设置你需要的背景色
@@ -924,7 +924,8 @@ const int FrontViewPositionNone = 0xff;
_dockedNavBar.standardAppearance = navBarAppearanceStandard;
_dockedNavBar.scrollEdgeAppearance = navBarAppearanceStandard;
} else {
_dockedNavBar.backgroundColor = [ThemeManager appBackgroundColor];
_dockedNavBar.backgroundColor = [UIColor clearColor];
_dockedNavBar.barTintColor = [[ThemeManager appBackgroundColor] colorWithAlphaComponent:0.1];
}
@@ -939,7 +940,6 @@ const int FrontViewPositionNone = 0xff;
// navItem.rightBarButtonItem = _disconnectButton;
[_dockedNavBar setItems:@[_navItem]];
_dockedNavBar.barTintColor = [UIColor darkGrayColor];
_dockedNavBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
[_contentView.rearNavView addSubview:_dockedNavBar];
@@ -961,14 +961,14 @@ const int FrontViewPositionNone = 0xff;
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] init];
[backButton setTarget:self];
[backButton setAction:@selector(foldRearView)];
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
[backButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:23 weight:UIImageSymbolWeightMedium ];
UIImage *image = [[UIImage systemImageNamed:@"sidebar.left" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[backButton setImage:image];
backButton.imageInsets = UIEdgeInsetsMake(20, 10, 0, 0);
} else {
[backButton setTitle:[LocalizationHelper localizedStringForKey:@"Back"]];
[backButton setTitle:[LocalizationHelper localizedStringForKey:@"Collapse"]];
}
_navItem.leftBarButtonItem = backButton;
}
@@ -979,7 +979,7 @@ const int FrontViewPositionNone = 0xff;
_disconnectButton = [[UIBarButtonItem alloc] init];
[_disconnectButton setTarget:self];
[_disconnectButton setAction:@selector(disconnectRemoteSession)];
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
[_disconnectButton setTitle:nil];
UIImage *image = [[UIImage imageNamed:@"disconnect.svg" ] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
@@ -1002,7 +1002,7 @@ const int FrontViewPositionNone = 0xff;
if(!_moreButton) _moreButton = [[UIBarButtonItem alloc] init];
//[moreButton setAction:@selector(moreButtonTapped:)];
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
[_moreButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:23 weight:UIImageSymbolWeightMedium ];
UIImage *image = [[UIImage systemImageNamed:@"ellipsis.circle" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
@@ -1039,7 +1039,7 @@ const int FrontViewPositionNone = 0xff;
- (void)removeSettingItemSelected{
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
// UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action1 = [self getDoneRemoveSettingAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1]];
@@ -1051,7 +1051,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)doneRemoveSettingItemSelected{
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action2 = [self getRemoveSettingItemAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1, action2]];
@@ -1146,7 +1146,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)favoriteSettingSelected {
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
UIAction* action1 = [self getAllSettingMenuAction];
UIAction* action2 = [self getRemoveSettingItemAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1, action2]];
@@ -1157,7 +1157,7 @@ const int FrontViewPositionNone = 0xff;
}
- (void)allSettingSelected {
if (@available(iOS 13.0, *) && false) {
if (@available(iOS 13.0, *)) {
UIAction* action1 = [self getFavoriteMenuAction];
if (@available(iOS 14.0, *)) _moreButton.menu = [UIMenu menuWithTitle:@"" children:@[action1]];
}