Skip to content

Commit

Permalink
Merge branch 'alex/cmd-tab-show-x' into alex/assorted-bugs-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx committed Sep 25, 2024
2 parents a2c0dd0 + 847a692 commit ba1ff69
Show file tree
Hide file tree
Showing 15 changed files with 843 additions and 650 deletions.
12 changes: 0 additions & 12 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@
3706FCCD293F65D500E42796 /* shield-dot.json in Resources */ = {isa = PBXBuildFile; fileRef = AA34396B2754D4E300B241FA /* shield-dot.json */; };
3706FCD0293F65D500E42796 /* BookmarksBarCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4BE53369286912D40019DBFD /* BookmarksBarCollectionViewItem.xib */; };
3706FCD2293F65D500E42796 /* shield.json in Resources */ = {isa = PBXBuildFile; fileRef = AA34396A2754D4E200B241FA /* shield.json */; };
3706FCD4293F65D500E42796 /* TabBarViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA7412B124D0B3AC00D22FE0 /* TabBarViewItem.xib */; };
3706FCD6293F65D500E42796 /* httpsMobileV2FalsePositives.json in Resources */ = {isa = PBXBuildFile; fileRef = 4B67742A255DBEB800025BD8 /* httpsMobileV2FalsePositives.json */; };
3706FCD8293F65D500E42796 /* BookmarksBar.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4BD18F04283F151F00058124 /* BookmarksBar.storyboard */; };
3706FCD9293F65D500E42796 /* trackers-1.json in Resources */ = {isa = PBXBuildFile; fileRef = AA3439732754D55100B241FA /* trackers-1.json */; };
Expand All @@ -809,7 +808,6 @@
3706FCEE293F65D500E42796 /* trackers-3.json in Resources */ = {isa = PBXBuildFile; fileRef = AA3439752754D55100B241FA /* trackers-3.json */; };
3706FCEF293F65D500E42796 /* macos-config.json in Resources */ = {isa = PBXBuildFile; fileRef = 026ADE1326C3010C002518EE /* macos-config.json */; };
3706FCF0293F65D500E42796 /* httpsMobileV2BloomSpec.json in Resources */ = {isa = PBXBuildFile; fileRef = 4B677427255DBEB800025BD8 /* httpsMobileV2BloomSpec.json */; };
3706FCF1293F65D500E42796 /* TabBarFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA2CB12C2587BB5600AA6FBE /* TabBarFooter.xib */; };
3706FCF3293F65D500E42796 /* FirePopoverCollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = AAE246F22709EF3B00BEEAEE /* FirePopoverCollectionViewItem.xib */; };
3706FCF5293F65D500E42796 /* dark-shield-dot.json in Resources */ = {isa = PBXBuildFile; fileRef = AA34396E2754D4E900B241FA /* dark-shield-dot.json */; };
3706FCF6293F65D500E42796 /* trackers-2.json in Resources */ = {isa = PBXBuildFile; fileRef = AA3439742754D55100B241FA /* trackers-2.json */; };
Expand Down Expand Up @@ -2076,7 +2074,6 @@
AA0F3DB7261A566C0077F2D9 /* SuggestionLoadingMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0F3DB6261A566C0077F2D9 /* SuggestionLoadingMock.swift */; };
AA13DCB4271480B0006D48D3 /* FirePopoverViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA13DCB3271480B0006D48D3 /* FirePopoverViewModel.swift */; };
AA222CB92760F74E00321475 /* FaviconReferenceCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA222CB82760F74E00321475 /* FaviconReferenceCache.swift */; };
AA2CB12D2587BB5600AA6FBE /* TabBarFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA2CB12C2587BB5600AA6FBE /* TabBarFooter.xib */; };
AA2CB1352587C29500AA6FBE /* TabBarFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA2CB1342587C29500AA6FBE /* TabBarFooter.swift */; };
AA34396C2754D4E300B241FA /* shield.json in Resources */ = {isa = PBXBuildFile; fileRef = AA34396A2754D4E200B241FA /* shield.json */; };
AA34396D2754D4E300B241FA /* shield-dot.json in Resources */ = {isa = PBXBuildFile; fileRef = AA34396B2754D4E300B241FA /* shield-dot.json */; };
Expand Down Expand Up @@ -2134,7 +2131,6 @@
AA6FFB4624DC3B5A0028F4D0 /* WebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA6FFB4524DC3B5A0028F4D0 /* WebView.swift */; };
AA72D5FE25FFF94E00C77619 /* NSMenuItemExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA72D5FD25FFF94E00C77619 /* NSMenuItemExtension.swift */; };
AA7412B224D0B3AC00D22FE0 /* TabBarViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7412B024D0B3AC00D22FE0 /* TabBarViewItem.swift */; };
AA7412B324D0B3AC00D22FE0 /* TabBarViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = AA7412B124D0B3AC00D22FE0 /* TabBarViewItem.xib */; };
AA7412B524D1536B00D22FE0 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7412B424D1536B00D22FE0 /* MainWindowController.swift */; };
AA7412B724D1687000D22FE0 /* TabBarScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7412B624D1687000D22FE0 /* TabBarScrollView.swift */; };
AA7412BD24D2BEEE00D22FE0 /* MainWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA7412BC24D2BEEE00D22FE0 /* MainWindow.swift */; };
Expand Down Expand Up @@ -4064,7 +4060,6 @@
AA0F3DB6261A566C0077F2D9 /* SuggestionLoadingMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionLoadingMock.swift; sourceTree = "<group>"; };
AA13DCB3271480B0006D48D3 /* FirePopoverViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirePopoverViewModel.swift; sourceTree = "<group>"; };
AA222CB82760F74E00321475 /* FaviconReferenceCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FaviconReferenceCache.swift; sourceTree = "<group>"; };
AA2CB12C2587BB5600AA6FBE /* TabBarFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TabBarFooter.xib; sourceTree = "<group>"; };
AA2CB1342587C29500AA6FBE /* TabBarFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarFooter.swift; sourceTree = "<group>"; };
AA34396A2754D4E200B241FA /* shield.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = shield.json; sourceTree = "<group>"; };
AA34396B2754D4E300B241FA /* shield-dot.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "shield-dot.json"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4127,7 +4122,6 @@
AA6FFB4524DC3B5A0028F4D0 /* WebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebView.swift; sourceTree = "<group>"; };
AA72D5FD25FFF94E00C77619 /* NSMenuItemExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSMenuItemExtension.swift; sourceTree = "<group>"; };
AA7412B024D0B3AC00D22FE0 /* TabBarViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarViewItem.swift; sourceTree = "<group>"; };
AA7412B124D0B3AC00D22FE0 /* TabBarViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TabBarViewItem.xib; sourceTree = "<group>"; };
AA7412B424D1536B00D22FE0 /* MainWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = "<group>"; };
AA7412B624D1687000D22FE0 /* TabBarScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarScrollView.swift; sourceTree = "<group>"; };
AA7412BC24D2BEEE00D22FE0 /* MainWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainWindow.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -7769,9 +7763,7 @@
1456D6E024EFCBC300775049 /* TabBarCollectionView.swift */,
AA7412B624D1687000D22FE0 /* TabBarScrollView.swift */,
AA7412B024D0B3AC00D22FE0 /* TabBarViewItem.swift */,
AA7412B124D0B3AC00D22FE0 /* TabBarViewItem.xib */,
AA2CB1342587C29500AA6FBE /* TabBarFooter.swift */,
AA2CB12C2587BB5600AA6FBE /* TabBarFooter.xib */,
AA9E9A5D25A4867200D1959D /* TabDragAndDropManager.swift */,
3154FD1328E6011A00909769 /* TabShadowView.swift */,
311B262628E73E0A00FD181A /* TabShadowConfig.swift */,
Expand Down Expand Up @@ -9965,7 +9957,6 @@
3706FCCD293F65D500E42796 /* shield-dot.json in Resources */,
3706FCD0293F65D500E42796 /* BookmarksBarCollectionViewItem.xib in Resources */,
3706FCD2293F65D500E42796 /* shield.json in Resources */,
3706FCD4293F65D500E42796 /* TabBarViewItem.xib in Resources */,
7B5A23762C46A4A8007213AC /* ExcludedDomains.storyboard in Resources */,
3706FCD6293F65D500E42796 /* httpsMobileV2FalsePositives.json in Resources */,
3706FCD8293F65D500E42796 /* BookmarksBar.storyboard in Resources */,
Expand All @@ -9990,7 +9981,6 @@
3706FCEE293F65D500E42796 /* trackers-3.json in Resources */,
3706FCEF293F65D500E42796 /* macos-config.json in Resources */,
3706FCF0293F65D500E42796 /* httpsMobileV2BloomSpec.json in Resources */,
3706FCF1293F65D500E42796 /* TabBarFooter.xib in Resources */,
3706FCF3293F65D500E42796 /* FirePopoverCollectionViewItem.xib in Resources */,
3706FCF5293F65D500E42796 /* dark-shield-dot.json in Resources */,
3706FCF6293F65D500E42796 /* trackers-2.json in Resources */,
Expand Down Expand Up @@ -10160,7 +10150,6 @@
AA34396D2754D4E300B241FA /* shield-dot.json in Resources */,
4BE5336B286912D40019DBFD /* BookmarksBarCollectionViewItem.xib in Resources */,
AA34396C2754D4E300B241FA /* shield.json in Resources */,
AA7412B324D0B3AC00D22FE0 /* TabBarViewItem.xib in Resources */,
7B5A23752C46A4A8007213AC /* ExcludedDomains.storyboard in Resources */,
4B677435255DBEB800025BD8 /* httpsMobileV2FalsePositives.json in Resources */,
4BD18F05283F151F00058124 /* BookmarksBar.storyboard in Resources */,
Expand All @@ -10185,7 +10174,6 @@
AA34397B2754D55100B241FA /* trackers-3.json in Resources */,
026ADE1426C3010C002518EE /* macos-config.json in Resources */,
4B677432255DBEB800025BD8 /* httpsMobileV2BloomSpec.json in Resources */,
AA2CB12D2587BB5600AA6FBE /* TabBarFooter.xib in Resources */,
AAE246F42709EF3B00BEEAEE /* FirePopoverCollectionViewItem.xib in Resources */,
AA3439702754D4E900B241FA /* dark-shield-dot.json in Resources */,
AA34397A2754D55100B241FA /* trackers-2.json in Resources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
14 changes: 7 additions & 7 deletions DuckDuckGo/Common/Extensions/NSViewControllerExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ extension NSViewController {
view.removeFromSuperview()
}

func withoutAnimation(_ closure: () -> Void) {
CATransaction.begin()
CATransaction.setDisableActions(true)
closure()
CATransaction.commit()
}

/// #Preview helper to hide Window controls on View Controller appearance
func _preview_hidingWindowControlsOnAppear() -> Self { // swiftlint:disable:this identifier_name
Preview_ViewControllerWindowObserver().attach(to: self)
Expand All @@ -107,6 +100,13 @@ extension NSViewController {

}

func withoutAnimation(_ closure: () -> Void) {
CATransaction.begin()
CATransaction.setDisableActions(true)
closure()
CATransaction.commit()
}

/// #Preview helper to hide Window controls on View Controller appearance
final class Preview_ViewControllerWindowObserver: NSObject {
func attach(to viewController: NSViewController) {
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Common/View/AppKit/HoverTrackingArea.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class HoverTrackingArea: NSTrackingArea {
view?.backgroundLayer(createIfNeeded: createIfNeeded)
}

func updateLayer(animated: Bool = true) {
func updateLayer(animated: Bool = !CATransaction.disableActions()) {
let color = currentBackgroundColor ?? .clear
guard let view, let layer = layer(createIfNeeded: color != .clear) else { return }

Expand Down
29 changes: 19 additions & 10 deletions DuckDuckGo/Common/View/AppKit/MouseOverView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ import Combine

@objc protocol MouseOverViewDelegate: AnyObject {

@objc optional func mouseOverView(_ mouseOverView: MouseOverView, isMouseOver: Bool)
@objc @MainActor optional func mouseOverView(_ mouseOverView: MouseOverView, isMouseOver: Bool)

@objc optional func mouseClickView(_ mouseClickView: MouseClickView, mouseDownEvent: NSEvent)
@objc optional func mouseClickView(_ mouseClickView: MouseClickView, mouseUpEvent: NSEvent)
@objc optional func mouseClickView(_ mouseClickView: MouseClickView, rightMouseDownEvent: NSEvent)
@objc optional func mouseClickView(_ mouseClickView: MouseClickView, otherMouseDownEvent: NSEvent)
@objc @MainActor optional func mouseClickView(_ mouseClickView: MouseClickView, mouseDownEvent: NSEvent)
@objc @MainActor optional func mouseClickView(_ mouseClickView: MouseClickView, mouseUpEvent: NSEvent)
@objc @MainActor optional func mouseClickView(_ mouseClickView: MouseClickView, rightMouseDownEvent: NSEvent)
@objc @MainActor optional func mouseClickView(_ mouseClickView: MouseClickView, otherMouseDownEvent: NSEvent)

@objc optional func mouseOverView(_ sender: MouseOverView, draggingEntered info: NSDraggingInfo, isMouseOver: UnsafeMutablePointer<Bool>) -> NSDragOperation
@objc optional func mouseOverView(_ sender: MouseOverView, draggingUpdatedWith info: NSDraggingInfo, isMouseOver: UnsafeMutablePointer<Bool>) -> NSDragOperation
@objc optional func mouseOverView(_ sender: MouseOverView, performDragOperation info: NSDraggingInfo) -> Bool
@objc optional func mouseOverView(_ sender: MouseOverView, draggingEndedWith info: NSDraggingInfo)
@objc optional func mouseOverView(_ sender: MouseOverView, draggingExitedWith info: NSDraggingInfo?)
@objc @MainActor optional func mouseOverView(_ sender: MouseOverView, draggingEntered info: NSDraggingInfo, isMouseOver: UnsafeMutablePointer<Bool>) -> NSDragOperation
@objc @MainActor optional func mouseOverView(_ sender: MouseOverView, draggingUpdatedWith info: NSDraggingInfo, isMouseOver: UnsafeMutablePointer<Bool>) -> NSDragOperation
@objc @MainActor optional func mouseOverView(_ sender: MouseOverView, performDragOperation info: NSDraggingInfo) -> Bool
@objc @MainActor optional func mouseOverView(_ sender: MouseOverView, draggingEndedWith info: NSDraggingInfo)
@objc @MainActor optional func mouseOverView(_ sender: MouseOverView, draggingExitedWith info: NSDraggingInfo?)

}
typealias MouseClickViewDelegate = MouseOverViewDelegate
Expand All @@ -52,6 +52,15 @@ internal class MouseOverView: NSControl, Hoverable {
@IBInspectable dynamic var backgroundColor: NSColor?

@IBInspectable dynamic var cornerRadius: CGFloat = 0.0
var maskedCorners: CACornerMask {
get {
backgroundLayer(createIfNeeded: true)?.maskedCorners ?? []
}
set {
backgroundLayer(createIfNeeded: true)?.maskedCorners = newValue
}
}

@IBInspectable dynamic var backgroundInset: NSPoint = .zero
@IBInspectable dynamic var mouseDownColor: NSColor?

Expand Down
9 changes: 5 additions & 4 deletions DuckDuckGo/TabBar/View/Base.lproj/TabBar.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="uSf-9n-QMw">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="23091" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="uSf-9n-QMw">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23091"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -149,13 +149,14 @@
</connections>
</button>
<button hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Avv-iY-qO8" userLabel="Add Button" customClass="MouseOverButton" customModule="DuckDuckGo_Privacy_Browser" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="16" height="28"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="Add" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="7j4-bt-brI">
<rect key="frame" x="0.0" y="0.0" width="28" height="28"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="Add" imagePosition="only" alignment="center" inset="2" id="7j4-bt-brI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<color key="contentTintColor" name="ButtonColor"/>
<constraints>
<constraint firstAttribute="width" constant="28" id="hs2-lp-uJL"/>
<constraint firstAttribute="height" constant="28" id="yDP-bt-OPj"/>
</constraints>
<userDefinedRuntimeAttributes>
Expand Down
5 changes: 3 additions & 2 deletions DuckDuckGo/TabBar/View/TabBarCollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ final class TabBarCollectionView: NSCollectionView {
override func awakeFromNib() {
super.awakeFromNib()

let nib = NSNib(nibNamed: "TabBarViewItem", bundle: nil)
register(nib, forItemWithIdentifier: TabBarViewItem.identifier)
register(TabBarViewItem.self, forItemWithIdentifier: TabBarViewItem.identifier)
register(TabBarFooter.self, forSupplementaryViewOfKind: NSCollectionView.elementKindSectionFooter, withIdentifier: TabBarFooter.identifier)

// Register for the dropped object types we can accept.
registerForDraggedTypes([.URL, .fileURL, TabBarViewItemPasteboardWriter.utiInternalType, .string])
Expand Down Expand Up @@ -95,6 +95,7 @@ final class TabBarCollectionView: NSCollectionView {
(item(at: leftToSelectionIndexPath) as? TabBarViewItem)?.isLeftToSelected = true
}
}

}

extension NSCollectionView {
Expand Down
70 changes: 68 additions & 2 deletions DuckDuckGo/TabBar/View/TabBarFooter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,76 @@

import Cocoa

final class TabBarFooter: NSView {
final class TabBarFooter: NSView, NSCollectionViewElement {

static let identifier = NSUserInterfaceItemIdentifier(rawValue: "TabBarFooter")

@IBOutlet weak var addButton: MouseOverButton!
let addButton = MouseOverButton(image: .add, target: nil, action: #selector(TabBarViewController.addButtonAction))

var target: MouseOverButtonDelegate? {
get {
addButton.delegate
}
set {
addButton.target = newValue
addButton.delegate = newValue
}
}

var isEnabled: Bool {
get {
addButton.isEnabled
}
set {
addButton.isEnabled = newValue
}
}

override init(frame: NSRect) {
super.init(frame: frame)

identifier = Self.identifier
translatesAutoresizingMaskIntoConstraints = false

addButton.translatesAutoresizingMaskIntoConstraints = false
addButton.isBordered = false
addButton.bezelStyle = .shadowlessSquare
addButton.cornerRadius = 4
addButton.normalTintColor = .button
addButton.mouseDownColor = .buttonMouseDown
addButton.mouseOverColor = .buttonMouseOver
addButton.imagePosition = .imageOnly
addButton.imageScaling = .scaleNone
addButton.registerForDraggedTypes([.string])
toolTip = UserText.newTabTooltip

addSubview(addButton)
}

required init?(coder: NSCoder) {
fatalError("TabBarFooter: Bad initializer")
}

override func layout() {
super.layout()

addButton.frame = NSRect(x: ((bounds.width - 28) * 0.5).rounded(), y: ((bounds.height - 28) * 0.5).rounded(), width: 28, height: 28)
}

}

#if DEBUG
extension TabBarFooter {
final class PreviewViewController: NSViewController {
override func loadView() {
view = NSView()
view.addSubview(TabBarFooter(frame: NSRect(x: 4, y: 2, width: 32, height: 32)))
}
}
}
@available(macOS 14.0, *)
#Preview(traits: .fixedLayout(width: 40, height: 40)) {
TabBarFooter.PreviewViewController()
._preview_hidingWindowControlsOnAppear()
}
#endif
Loading

0 comments on commit ba1ff69

Please sign in to comment.