From 9c970aff637fd5234ac511e28d570589b93ec651 Mon Sep 17 00:00:00 2001 From: Toxblh Date: Mon, 30 Apr 2018 19:19:33 +0100 Subject: [PATCH] if button have only image, change position to .imageonly --- MTMR/TouchBarController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MTMR/TouchBarController.swift b/MTMR/TouchBarController.swift index a3b28ca..3a5744a 100644 --- a/MTMR/TouchBarController.swift +++ b/MTMR/TouchBarController.swift @@ -215,6 +215,11 @@ class TouchBarController: NSObject, NSTouchBarDelegate { let button = item.button! button.imageScaling = .scaleProportionallyDown button.imagePosition = .imageLeading + + if (button.title == "") { + button.imagePosition = .imageOnly + } + button.imageHugsTitle = true button.cell?.image = source.image button.bezelColor = .clear