Skip to content

Commit

Permalink
Merge pull request #479 from Hirobreak/dark-options
Browse files Browse the repository at this point in the history
dark theme with options
  • Loading branch information
jorgeblacio authored Aug 29, 2019
2 parents 0baffc9 + 61277cf commit aa964a4
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions iOS-Email-Client/Controllers/ComposeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ class ComposeViewController: UIViewController {
}

override func viewDidAppear(_ animated: Bool) {
accountOptionsView.refreshView()
IQKeyboardManager.shared.enable = false
if let popover = popoverToPresent {
self.presentPopover(popover: popover, height: 205)
Expand Down
4 changes: 4 additions & 0 deletions iOS-Email-Client/Controllers/InboxViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,10 @@ extension InboxViewController: ThemeDelegate {
func swapTheme(_ theme: Theme) {
applyTheme()
tableView.reloadData()
generalOptionsContainerView.refreshView()
if let menuViewController = navigationDrawerController?.leftViewController as? MenuViewController {
menuViewController.reloadView()
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions iOS-Email-Client/Views/AccountFromCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ class AccountFromCell: UITableViewCell{

override func awakeFromNib() {
super.awakeFromNib()
applyTheme()
}

override func prepareForReuse() {
super.prepareForReuse()
applyTheme()
}

func applyTheme() {
let theme = ThemeManager.shared.theme
emailLabel.textColor = theme.mainText
backgroundColor = .clear
Expand Down
5 changes: 5 additions & 0 deletions iOS-Email-Client/Views/AccountTableCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class AccountTableCell: UITableViewCell {
applyTheme()
}

override func prepareForReuse() {
super.prepareForReuse()
applyTheme()
}

func applyTheme() {
let theme = ThemeManager.shared.theme
nameLabel.textColor = theme.markedText
Expand Down
5 changes: 5 additions & 0 deletions iOS-Email-Client/Views/AccountsFooterCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class AccountsFooterCell: UITableViewHeaderFooterView {
self.applyLocalization()
}

override func prepareForReuse() {
super.prepareForReuse()
self.applyTheme()
}

func applyLocalization() {
existingLabel.text = String.localize("ADD_ACCOUNT")
}
Expand Down
4 changes: 2 additions & 2 deletions iOS-Email-Client/Views/Base.lproj/MoreOptionsUIView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MoreOptionsUIView" customModule="iOS_Email_Client" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MoreOptionsUIView" customModule="ShareExtension" customModuleProvider="target">
<connections>
<outlet property="backgroundOverlayView" destination="RKg-ih-58I" id="gNY-9F-Nsn"/>
<outlet property="optionsContainerOffsetConstraint" destination="Nia-Ea-Iem" id="qz0-Lk-2Li"/>
Expand All @@ -34,7 +34,7 @@
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" bouncesZoom="NO" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Cvd-Do-TlH">
<rect key="frame" x="0.0" y="0.0" width="375" height="247"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
Expand Down
1 change: 1 addition & 0 deletions iOS-Email-Client/Views/MoreOptionsUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class MoreOptionsUIView : UIView {

func applyTheme() {
let theme = ThemeManager.shared.theme
tableView.backgroundColor = .clear
optionsContainerView.backgroundColor = theme.background
}

Expand Down

0 comments on commit aa964a4

Please sign in to comment.