Fix faded vibrant text. Issue #1186

This commit is contained in:
Maurice Parker 2019-10-28 13:56:46 -05:00
parent b0d40afa3c
commit cf8d1ee457
3 changed files with 25 additions and 9 deletions

View File

@ -3,6 +3,7 @@
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15508"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15508"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
@ -80,13 +81,15 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/> <rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mQv-3O-Y2d" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mQv-3O-Y2d" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="EEL-8n-nHO"/> <constraint firstAttribute="height" constant="44" id="EEL-8n-nHO"/>
</constraints> </constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<state key="normal" title="Add Account"/> <state key="normal" title="Add Account">
<color key="titleColor" name="secondaryAccentColor"/>
</state>
<connections> <connections>
<action selector="add:" destination="vi3-jb-8XS" eventType="touchUpInside" id="lCb-LW-xZ0"/> <action selector="add:" destination="vi3-jb-8XS" eventType="touchUpInside" id="lCb-LW-xZ0"/>
</connections> </connections>
@ -195,13 +198,15 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/> <rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gv7-yG-aE3" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gv7-yG-aE3" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="pt0-rn-0JI"/> <constraint firstAttribute="height" constant="44" id="pt0-rn-0JI"/>
</constraints> </constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<state key="normal" title="Action"/> <state key="normal" title="Action">
<color key="titleColor" name="secondaryAccentColor"/>
</state>
<connections> <connections>
<action selector="action:" destination="ECy-jg-Kyc" eventType="touchUpInside" id="79h-R2-s0C"/> <action selector="action:" destination="ECy-jg-Kyc" eventType="touchUpInside" id="79h-R2-s0C"/>
</connections> </connections>
@ -257,4 +262,9 @@
<point key="canvasLocation" x="3187" y="139"/> <point key="canvasLocation" x="3187" y="139"/>
</scene> </scene>
</scenes> </scenes>
<resources>
<namedColor name="secondaryAccentColor">
<color red="0.031372549019607843" green="0.41568627450980394" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document> </document>

View File

@ -79,13 +79,15 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TYD-py-8IF" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TYD-py-8IF" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="WmU-wG-RLQ"/> <constraint firstAttribute="height" constant="44" id="WmU-wG-RLQ"/>
</constraints> </constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<state key="normal" title="Credentials"/> <state key="normal" title="Credentials">
<color key="titleColor" name="secondaryAccentColor"/>
</state>
<connections> <connections>
<action selector="credentials:" destination="1m3-fZ-n7g" eventType="touchUpInside" id="Kkh-Ag-aGX"/> <action selector="credentials:" destination="1m3-fZ-n7g" eventType="touchUpInside" id="Kkh-Ag-aGX"/>
</connections> </connections>
@ -110,7 +112,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="obv-a5-Pl6" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="obv-a5-Pl6" customClass="VibrantButton" customModule="NetNewsWire" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/> <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="WtN-fp-Ldt"/> <constraint firstAttribute="height" constant="44" id="WtN-fp-Ldt"/>
@ -177,7 +179,10 @@
</scenes> </scenes>
<resources> <resources>
<namedColor name="deleteBackgroundColor"> <namedColor name="deleteBackgroundColor">
<color red="0.81960784313725488" green="0.81960784313725488" blue="0.83921568627450982" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="0.23100000619888306" blue="0.18799999356269836" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="secondaryAccentColor">
<color red="0.031372549019607843" green="0.41568627450980394" blue="0.93333333333333335" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </document>

View File

@ -23,12 +23,13 @@ class VibrantButton: UIButton {
private func commonInit() { private func commonInit() {
setTitleColor(AppAssets.vibrantTextColor, for: .highlighted) setTitleColor(AppAssets.vibrantTextColor, for: .highlighted)
let disabledColor = AppAssets.secondaryAccentColor.withAlphaComponent(0.5)
setTitleColor(disabledColor, for: .disabled)
} }
override var isHighlighted: Bool { override var isHighlighted: Bool {
didSet { didSet {
backgroundColor = isHighlighted ? backgroundHighlightColor : nil backgroundColor = isHighlighted ? backgroundHighlightColor : nil
titleLabel?.alpha = 1
} }
} }