 final class AppDelegate: NSObject, NSApplicationDelegate {
     private enum Constants {
         static let itemLength: CGFloat = 200
+        static let iconSize: CGFloat = 30
         static let widthConstraint: CGFloat = 170
         static let textViewLength: CGFloat = 150
-        static let baseLength: CGFloat = 30
         static let padding: CGFloat = 6
     }
 


    private lazy var statusItem: NSStatusItem = {
        let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
        statusItem.length = Constants.baseLength
        return statusItem
    }()


        NSLayoutConstraint.activate([
            applicationImageView.rightAnchor.constraint(equalTo: scrollingTextView.leftAnchor),
            applicationImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
            applicationImageView.heightAnchor.constraint(equalToConstant: contentView.frame.height - Constants.padding)])

        iconWidthConstraint.constant = applicationImageView.image == nil ? 0 : Constants.iconSize
    }

    private func updateTitle(newTitle: String) {
        scrollingTextView.setup(string: newTitle, width: Constants.textViewLength, speed: 0.04)

        if scrollingTextView.stringWidth > Constants.itemLength {
            statusItem.length = Constants.widthConstraint + iconWidthConstraint.constant
            textWidthConstraint.constant = Constants.widthConstraint
        } else {
            statusItem.length = scrollingTextView.stringWidth + iconWidthConstraint.constant + Constants.padding
            textWidthConstraint.constant = scrollingTextView.stringWidth + Constants.padding
        }

        lastStatusTitle = newTitle
        applicationImageView.image = chooseIcon(musicPlayerName: musicPlayerManager.currentPlayer?.name)

        if newTitle.count == 0 && statusItem.button != nil {
            statusItem.length = iconWidthConstraint.constant
            textWidthConstraint.constant = 0
            applicationImageView.image = chooseIcon(musicPlayerName: musicPlayerManager.currentPlayer?.name)
        }
    }
