float (@NotNull Icon icon) { // according to https://developer.apple.com/macos/human-interface-guidelines/touch-bar/touch-bar-icons-and-images/ // icons, generally should not exceed 44px in height (36px for circular icons) // Ideal icon size 36px X 36px (18pt X 18pt @2x) // Maximum icon size 44px X 44px (22pt X 22pt @2x) int iconHeight = icon.getIconHeight(); if (UISettings.getInstance().getPresentationMode()) { return 40.f / iconHeight; } else { return iconHeight < 24 ? 40.f / 16 : (44.f / iconHeight); } }