mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
Hide MT button from control strip when touch bar is empty
This commit is contained in:
parent
fa63734312
commit
9542e332f5
@ -294,20 +294,23 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateControlStripPresence() {
|
func updateControlStripPresence() {
|
||||||
DFRElementSetControlStripPresenceForIdentifier(.controlStripItem, true)
|
let showMtmrButtonOnControlStrip = touchBarContainsAnyItems()
|
||||||
|
DFRElementSetControlStripPresenceForIdentifier(.controlStripItem, showMtmrButtonOnControlStrip)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func presentTouchBar() {
|
@objc private func presentTouchBar() {
|
||||||
if AppSettings.showControlStripState {
|
if AppSettings.showControlStripState {
|
||||||
updateControlStripPresence()
|
|
||||||
presentSystemModal(touchBar, systemTrayItemIdentifier: .controlStripItem)
|
presentSystemModal(touchBar, systemTrayItemIdentifier: .controlStripItem)
|
||||||
} else {
|
} else {
|
||||||
presentSystemModal(touchBar, placement: 1, systemTrayItemIdentifier: .controlStripItem)
|
presentSystemModal(touchBar, placement: 1, systemTrayItemIdentifier: .controlStripItem)
|
||||||
}
|
}
|
||||||
|
updateControlStripPresence()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc private func dismissTouchBar() {
|
@objc private func dismissTouchBar() {
|
||||||
|
if touchBarContainsAnyItems() {
|
||||||
minimizeSystemModal(touchBar)
|
minimizeSystemModal(touchBar)
|
||||||
|
}
|
||||||
updateControlStripPresence()
|
updateControlStripPresence()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user