Skip to content

Commit

Permalink
Further improvements
Browse files Browse the repository at this point in the history
- Fix pinned tab and normal tabs height and corner radius
- and more
  • Loading branch information
jotaemepereira committed Feb 15, 2024
1 parent ef85df2 commit 4e1939c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
11 changes: 5 additions & 6 deletions DuckDuckGo/PinnedTabs/View/PinnedTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import SwiftUIExtensions

struct PinnedTabView: View {
enum Const {
static let dimension: CGFloat = 32
static let cornerRadius: CGFloat = 6
static let dimension: CGFloat = 34
static let cornerRadius: CGFloat = 8.5
}

@ObservedObject var model: Tab
Expand Down Expand Up @@ -206,13 +206,12 @@ struct PinnedTabInnerView: View {
Circle()
.stroke(Color.gray.opacity(0.5), lineWidth: 0.5)
.background(Circle().foregroundColor(Color("PinnedTabMuteStateCircleColor")))
.frame(width: 14, height: 14)
.frame(width: 16, height: 16)
Image("Audio-Mute")
.resizable()
.renderingMode(.template)
.foregroundColor(.gray)
.frame(width: 9, height: 9)
}.offset(x: 6, y: -2)
.frame(width: 12, height: 12)
}.offset(x: 8, y: -8)
default: EmptyView()
}
}
Expand Down
10 changes: 5 additions & 5 deletions DuckDuckGo/TabBar/View/TabBarViewItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ protocol TabBarViewItemDelegate: AnyObject {
final class TabBarViewItem: NSCollectionViewItem {

enum Constants {
static let textFieldPadding: CGFloat = 32
static let textFieldPadding: CGFloat = 28
static let textFieldPaddingNoFavicon: CGFloat = 12
static let textFieldPaddingMuteIconPresent: CGFloat = 56
static let textFieldPaddingMuteIconPresent: CGFloat = 48
}

var widthStage: WidthStage {
Expand Down Expand Up @@ -276,7 +276,7 @@ final class TabBarViewItem: NSCollectionViewItem {
layer.borderWidth = TabShadowConfig.dividerSize
layer.opacity = TabShadowConfig.alpha
layer.maskedCorners = [.layerMaxXMaxYCorner, .layerMinXMaxYCorner]
layer.cornerRadius = 7
layer.cornerRadius = 11
layer.mask = layerMask
return layer
}()
Expand Down Expand Up @@ -328,7 +328,7 @@ final class TabBarViewItem: NSCollectionViewItem {

private func setupView() {
view.wantsLayer = true
view.layer?.cornerRadius = 7
view.layer?.cornerRadius = 11
view.layer?.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner]
view.layer?.masksToBounds = true
view.layer?.addSublayer(borderLayer)
Expand Down Expand Up @@ -598,7 +598,7 @@ extension TabBarViewItem: MouseClickViewDelegate {
extension TabBarViewItem {

enum Height: CGFloat {
case standard = 32
case standard = 34
}

enum Width: CGFloat {
Expand Down
13 changes: 7 additions & 6 deletions DuckDuckGo/TabBar/View/TabBarViewItem.xib
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Dwg-SU-uiu" userLabel="Muted Tab Icon">
<rect key="frame" x="36" y="9" width="16" height="16"/>
<rect key="frame" x="29" y="9" width="16" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="ILs-aB-D7E"/>
<constraint firstAttribute="width" constant="16" id="Qyf-Aw-VnE"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="Audio-Mute" id="nSg-1b-1pf"/>
<color key="contentTintColor" red="0.0" green="0.0" blue="0.0" alpha="0.83999999999999997" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="jlg-2n-tzm" customClass="MouseOverView" customModule="DuckDuckGo_Privacy_Browser" customModuleProvider="target">
<rect key="frame" x="0.0" y="1" width="300" height="33"/>
Expand All @@ -41,10 +42,10 @@
</textFieldCell>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="A6g-eG-dOW">
<rect key="frame" x="8" y="5" width="24" height="24"/>
<rect key="frame" x="5" y="5" width="24" height="24"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Kky-kZ-lU9" userLabel="Favicon Image View">
<rect key="frame" x="4" y="4" width="16" height="16"/>
<rect key="frame" x="4" y="5" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="UYc-rf-9hh"/>
<constraint firstAttribute="height" constant="16" id="ey5-m5-Uxp"/>
Expand All @@ -55,8 +56,8 @@
<constraints>
<constraint firstAttribute="height" constant="24" id="JIG-o6-vrA"/>
<constraint firstAttribute="width" constant="24" id="b6u-P2-tfb"/>
<constraint firstItem="Kky-kZ-lU9" firstAttribute="centerY" secondItem="A6g-eG-dOW" secondAttribute="centerY" id="q7W-XH-qud"/>
<constraint firstItem="Kky-kZ-lU9" firstAttribute="centerX" secondItem="A6g-eG-dOW" secondAttribute="centerX" id="sh1-7s-uE8"/>
<constraint firstItem="Kky-kZ-lU9" firstAttribute="top" secondItem="A6g-eG-dOW" secondAttribute="top" constant="3" id="zDL-E0-5JQ"/>
</constraints>
</customView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="XdB-Qn-iD9" userLabel="Active Permission" customClass="MouseOverButton" customModule="DuckDuckGo_Privacy_Browser" customModuleProvider="target">
Expand Down Expand Up @@ -144,11 +145,11 @@
<constraint firstItem="Dwg-SU-uiu" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="OVJ-fQ-oPs"/>
<constraint firstItem="A6g-eG-dOW" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" priority="250" id="PF1-mZ-U4m"/>
<constraint firstAttribute="bottom" secondItem="vuD-rY-Vzl" secondAttribute="bottom" constant="8" id="Pgs-Ex-Cp9"/>
<constraint firstItem="A6g-eG-dOW" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="8" id="TSx-41-S2A"/>
<constraint firstItem="A6g-eG-dOW" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="5" id="TSx-41-S2A"/>
<constraint firstAttribute="trailing" secondItem="opQ-Od-dCO" secondAttribute="trailing" id="WPC-fb-K22"/>
<constraint firstItem="A6g-eG-dOW" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="aQg-CK-diJ"/>
<constraint firstItem="890-3t-v5O" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="giH-0s-4s4"/>
<constraint firstItem="Dwg-SU-uiu" firstAttribute="leading" secondItem="A6g-eG-dOW" secondAttribute="trailing" constant="4" id="h0G-ek-exQ"/>
<constraint firstItem="Dwg-SU-uiu" firstAttribute="leading" secondItem="A6g-eG-dOW" secondAttribute="trailing" id="h0G-ek-exQ"/>
<constraint firstItem="vuD-rY-Vzl" firstAttribute="leading" secondItem="XdB-Qn-iD9" secondAttribute="trailing" constant="4" id="lqC-R5-KOi"/>
<constraint firstItem="DFD-8r-YGx" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="oUc-dt-omj"/>
<constraint firstAttribute="trailing" secondItem="890-3t-v5O" secondAttribute="trailing" id="pJ6-DF-7Q7"/>
Expand Down

0 comments on commit 4e1939c

Please sign in to comment.