Skip to content

Commit c7a7cd8

Browse files
committed
[app] clean up some design stuff; remove 1x graphics
1 parent 119fe2b commit c7a7cd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+28
-16
lines changed

NewTerm/UI/Keyboard/KeyboardButton.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class KeyboardButton: UIButton {
4141
adjustsImageWhenHighlighted = false
4242
setTitleColor(tintColor, for: .normal)
4343
setTitleColor(.black, for: .selected)
44-
setBackgroundImage(image(of: UIColor(white: 0.3529411765, alpha: 1)), for: .normal)
45-
setBackgroundImage(image(of: UIColor(white: 0.2078431373, alpha: 1)), for: .highlighted)
46-
setBackgroundImage(image(of: UIColor(white: 0.6784313725, alpha: 1)), for: .selected)
47-
setBackgroundImage(image(of: UIColor(white: 0.6784313725, alpha: 1)), for: [ .highlighted, .selected ])
44+
setBackgroundImage(image(of: UIColor(white: 1, alpha: 69 / 255)), for: .normal)
45+
setBackgroundImage(image(of: UIColor(white: 1, alpha: 32 / 255)), for: .highlighted)
46+
setBackgroundImage(image(of: UIColor(white: 1, alpha: 182 / 255)), for: .selected)
47+
setBackgroundImage(image(of: UIColor(white: 1, alpha: 32 / 255)), for: [ .highlighted, .selected ])
4848

4949
addTarget(UIDevice.current, action: #selector(UIDevice.playInputClick), for: .touchUpInside)
5050
}
@@ -79,6 +79,18 @@ class KeyboardButton: UIButton {
7979
return size
8080
}
8181

82+
override var isSelected: Bool {
83+
didSet {
84+
tintColor = isSelected && !isHighlighted ? .black : .white
85+
}
86+
}
87+
88+
override var isHighlighted: Bool {
89+
didSet {
90+
tintColor = isSelected && !isHighlighted ? .black : .white
91+
}
92+
}
93+
8294
private func image(of color: UIColor) -> UIImage {
8395
return UIGraphicsImageRenderer(size: CGSize(width: 1, height: 1)).image { context in
8496
color.setFill()

NewTerm/UI/Keyboard/KeyboardPopupToolbar.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class KeyboardPopupToolbar: UIView {
3131
backdropView.delegate = self
3232
addSubview(backdropView)
3333

34-
let height = isSmallDevice ? 36 : 44
34+
let height = isSmallDevice ? 37 : 45
3535
let outerXSpacing = CGFloat(3)
3636
let xSpacing = CGFloat(6)
37-
let ySpacing = CGFloat(isSmallDevice ? 2 : 4)
37+
let topSpacing = CGFloat(isSmallDevice ? 2 : 3)
38+
let bottomSpacing = CGFloat(isSmallDevice ? 3 : 4)
3839

3940
let homeEndSpacerView = UIView()
4041
let pageUpDownSpacerView = UIView()
@@ -50,8 +51,6 @@ class KeyboardPopupToolbar: UIView {
5051
"max": CGFloat.greatestFiniteMagnitude
5152
], views: nil)
5253

53-
deleteKey.titleLabel!.font = UIFont(name: "Helvetica Neue", size: deleteKey.titleLabel!.font.pointSize)
54-
5554
buttons = [
5655
homeKey, endKey,
5756
pageUpKey, pageDownKey,
@@ -86,14 +85,15 @@ class KeyboardPopupToolbar: UIView {
8685

8786
addCompactConstraints([
8887
"self.height = height",
89-
"stackView.top = toolbar.top + ySpacing",
90-
"stackView.bottom = toolbar.bottom - ySpacing",
88+
"stackView.top = toolbar.top + topSpacing",
89+
"stackView.bottom = toolbar.bottom - bottomSpacing",
9190
"stackView.left = toolbar.left + outerXSpacing",
9291
"stackView.right = toolbar.right - outerXSpacing"
9392
], metrics: [
9493
"height": height,
9594
"outerXSpacing": outerXSpacing,
96-
"ySpacing": ySpacing
95+
"topSpacing": topSpacing,
96+
"bottomSpacing": bottomSpacing
9797
], views: [
9898
"toolbar": self,
9999
"stackView": stackView
@@ -129,7 +129,7 @@ class KeyboardPopupToolbar: UIView {
129129

130130
override var intrinsicContentSize: CGSize {
131131
var size = super.intrinsicContentSize
132-
size.height = isSmallDevice ? 36 : 44
132+
size.height = isSmallDevice ? 37 : 45
133133
return size
134134
}
135135

NewTerm/UI/Keyboard/KeyboardToolbar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class KeyboardToolbar: UIView {
3737
let outerXSpacing = CGFloat(3)
3838
let xSpacing = CGFloat(6)
3939
let topSpacing = CGFloat(isSmallDevice ? 2 : 4)
40-
let bottomSpacing = CGFloat(isSmallDevice ? 0 : 2)
40+
let bottomSpacing = CGFloat(2)
4141

4242
let spacerView = UIView()
4343

NewTerm/UI/Keyboard/TerminalKeyInput.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class TerminalKeyInput: TextInputBase {
201201
if !visible && animated {
202202
UIView.animate(withDuration: 0.2, animations: {
203203
self.moreToolbar.alpha = 0
204-
}, completion: { (_) in
204+
}, completion: { _ in
205205
self.moreToolbar.isHidden = true
206206
})
207207
} else {

NewTerm/UI/TopBar/TabCollectionViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TabCollectionViewCell: UICollectionViewCell {
2727
super.init(frame: frame)
2828

2929
selectedBackgroundView = UIView()
30-
selectedBackgroundView!.backgroundColor = UIColor(white: 85 / 255, alpha: 0.7)
30+
selectedBackgroundView!.backgroundColor = UIColor(white: 1, alpha: 69 / 255)
3131

3232
textLabel.translatesAutoresizingMaskIntoConstraints = false
3333
textLabel.font = UIFont.systemFont(ofSize: 16)

NewTerm/ViewControllers/RootViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class RootViewController: UIViewController {
153153
}
154154

155155
self.tabsCollectionView.selectItem(at: IndexPath(item: selectedTabIndex, section: 0), animated: true, scrollPosition: .centeredHorizontally)
156-
}, completion: { (_) in
156+
}, completion: { _ in
157157
// TODO: hack because the previous tab doesn’t deselect for some reason and ugh i hate this
158158
self.tabsCollectionView.reloadData()
159159
})

Resources/add-small.png

-113 Bytes
Binary file not shown.

Resources/add.png

-136 Bytes
Binary file not shown.

Resources/bell.png

-552 Bytes
Binary file not shown.

Resources/[email protected]

-23 Bytes

0 commit comments

Comments
 (0)