mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Correct vibrancy configuration for Settings
This commit is contained in:
32
iOS/UIKit Extensions/VibrantButton.swift
Normal file
32
iOS/UIKit Extensions/VibrantButton.swift
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// VibrantButton.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 10/22/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class VibrantButton: UIButton {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
commonInit()
|
||||
}
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
private func commonInit() {
|
||||
setTitleColor(AppAssets.vibrantTextColor, for: .highlighted)
|
||||
}
|
||||
|
||||
override var isHighlighted: Bool {
|
||||
didSet {
|
||||
backgroundColor = isHighlighted ? AppAssets.secondaryAccentColor : nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
27
iOS/UIKit Extensions/VibrantLabel.swift
Normal file
27
iOS/UIKit Extensions/VibrantLabel.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// VibrantLabel.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 10/22/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class VibrantLabel: UILabel {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
private func commonInit() {
|
||||
highlightedTextColor = AppAssets.vibrantTextColor
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
import UIKit
|
||||
|
||||
class VibrantTableViewCell: UITableViewCell {
|
||||
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
commonInit()
|
||||
@@ -26,7 +27,9 @@ class VibrantTableViewCell: UITableViewCell {
|
||||
/// Subclass overrides should call super
|
||||
func applyThemeProperties() {
|
||||
let selectedBackgroundView = UIView(frame: .zero)
|
||||
selectedBackgroundView.backgroundColor = AppAssets.primaryAccentColor
|
||||
selectedBackgroundView.backgroundColor = AppAssets.secondaryAccentColor
|
||||
self.selectedBackgroundView = selectedBackgroundView
|
||||
|
||||
textLabel?.highlightedTextColor = AppAssets.vibrantTextColor
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user