1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 17:08:39 +00:00

Hide MT button from control strip when touch bar is empty

This commit is contained in:
Wiktor Latanowicz 2021-10-31 13:29:23 +01:00
parent fa63734312
commit 9542e332f5

View File

@ -294,20 +294,23 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
}
func updateControlStripPresence() {
DFRElementSetControlStripPresenceForIdentifier(.controlStripItem, true)
let showMtmrButtonOnControlStrip = touchBarContainsAnyItems()
DFRElementSetControlStripPresenceForIdentifier(.controlStripItem, showMtmrButtonOnControlStrip)
}
@objc private func presentTouchBar() {
if AppSettings.showControlStripState {
updateControlStripPresence()
presentSystemModal(touchBar, systemTrayItemIdentifier: .controlStripItem)
} else {
presentSystemModal(touchBar, placement: 1, systemTrayItemIdentifier: .controlStripItem)
}
updateControlStripPresence()
}
@objc private func dismissTouchBar() {
minimizeSystemModal(touchBar)
if touchBarContainsAnyItems() {
minimizeSystemModal(touchBar)
}
updateControlStripPresence()
}