-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature/v12 themeing] UI Theming updates for v12 #1191
Conversation
Matthias Hühne seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
(1)sort header color may in navigation bar color (2)check file list colours: (3)sidebar: (4)Status bar color (5)Action Alert (6)sidebar foldable cell item has wrong indicator colour (7)try to set the tint colour to white
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -190,6 +190,40 @@ class ActionCell: ThemeableCollectionViewCell { | |||
} | |||
} | |||
|
|||
|
|||
class ActionListCell: UICollectionViewListCell, Themeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of ActionListCell
and SavedSearchListCell
appear to be identical in code - and the functionality they provide is also already provided by the existing ThemeableCollectionViewListCell
, so it would make sense to use ThemeableCollectionViewListCell
instead of ActionListCell
and SavedSearchListCell
classes.
var content = cell.defaultContentConfiguration() | ||
content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor | ||
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState)
? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.
@@ -236,6 +238,9 @@ extension DriveListCell { | |||
|
|||
content.text = title | |||
content.image = icon | |||
|
|||
content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor | |||
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState)
of ThemeableCollectionViewListCell
? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.
@@ -127,6 +127,9 @@ public extension CollectionViewCellProvider { | |||
}) | |||
|
|||
var content = cell.defaultContentConfiguration() | |||
|
|||
content.textProperties.color = Theme.shared.activeCollection.tableRowColors.labelColor | |||
content.imageProperties.tintColor = Theme.shared.activeCollection.tintColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these colors already be set via func updateConfiguration(using state: UICellConfigurationState)
of ThemeableCollectionViewListCell
? If they aren't, I'd suggest to move that code into a method of the respective class and call it where it is needed (here and in updateConfiguration?), to avoid code duplication.
|
||
default: break | ||
} | ||
config.backgroundColor = Theme.shared.activeCollection.tableBackgroundColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.plain
, .grouped
and .insetGrouped
appearances should have a different look, for the sidebar to look in line with how sidebars look throughout the OS.
@@ -305,11 +305,14 @@ class AccountControllerCell: ThemeableCollectionViewListCell { | |||
} | |||
|
|||
open override func applyThemeCollection(theme: Theme, collection: ThemeCollection, event: ThemeEvent) { | |||
titleLabel.applyThemeCollection(collection, itemStyle: .title, itemState: ThemeItemState(selected: self.isSelected)) | |||
detailLabel.applyThemeCollection(collection, itemStyle: .title, itemState: ThemeItemState(selected: self.isSelected)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets the detail label's color to the same color as the title label, whereas the detail label should have a lighter color.
var backgroundConfig = UIBackgroundConfiguration.listSidebarCell() | ||
backgroundConfig.cornerRadius = 10 | ||
backgroundConfig.backgroundColor = UIColor(white: 1.0, alpha: 0.8) | ||
|
||
backgroundConfig.backgroundColor = collection.tableGroupBackgroundColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AccountControllerCell
background color should be distinct from background colors of table / collection views.
navigationView.applyThemeCollection(collection, itemStyle: .content) | ||
navigationView.applyThemeCollection(collection, itemStyle: .defaultForItem) | ||
contentViewController?.navigationItem.navigationContent.applyThemeCollection(collection) | ||
if let items = contentViewController?.navigationItem.navigationContent.items(withIdentifier: "ios16-truncated-title-fix"), let label = items.0.first?.titleView as? UILabel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That label is accessible more easily via the convenience accessor contentViewController?.navigationItem.titleLabel
(implemented in UINavigationItem+Extension.swift
).
@@ -189,6 +189,36 @@ extension OCSavedSearch { | |||
} | |||
} | |||
|
|||
class SavedSearchListCell: UICollectionViewListCell, Themeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of ActionListCell
and SavedSearchListCell
appear to be identical in code - and the functionality they provide is also already provided by the existing ThemeableCollectionViewListCell
, so it would make sense to use ThemeableCollectionViewListCell
instead of ActionListCell
and SavedSearchListCell
classes.
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
deinit { | ||
Theme.shared.unregister(client: self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! No objections, only a comment: in V12 Theme.unregister(client:)
no longer needs to be called. The deallocation of an object also automatically unregisters it as a Theme
client.
Superseded by #1194 |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: