mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DarculaJBPopupComboPopup - disable macOS touchbar for ComboBox popups and ListPopupImpls with custom renderers
Complex items with custom rendering are not the best candidates for macOS touchbar, as the different rendering from the ListPopupStep is used for the touchbar presentation. Thus it's too unexpected to have two unaligned presentations. Better not not. There are error messages list these in the log: 2019-11-27 18:31:00.814 java[44579:4946691] ERROR: scrubber [(null)]: called showScrubberItems 4, but item-data at this index is null GitOrigin-RevId: 54bb22f6fef7ddc3a71416c4c63753731f71d889
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e06197047b
commit
67220f7da4
@@ -33,6 +33,7 @@ import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.ui.mac.TouchbarDataKeys;
|
||||
import com.intellij.ui.mac.foundation.NSDefaults;
|
||||
import com.intellij.ui.popup.list.ListPopupImpl;
|
||||
import com.intellij.ui.popup.list.PopupListElementRenderer;
|
||||
import com.intellij.util.containers.JBIterable;
|
||||
import com.intellij.util.containers.Predicate;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -397,6 +398,10 @@ public final class TouchBarsManager {
|
||||
return null;
|
||||
|
||||
@NotNull ListPopupImpl listPopup = (ListPopupImpl)popup;
|
||||
|
||||
//some toolbars, e.g. one from DarculaJBPopupComboPopup are too custom to be supported here
|
||||
if (!(listPopup.getList().getCellRenderer() instanceof PopupListElementRenderer)) return null;
|
||||
|
||||
final TouchBar tb = BuildUtils.createScrubberBarFromPopup(listPopup);
|
||||
BarContainer container = new BarContainer(BarType.POPUP, tb, null, popupComponent);
|
||||
ourTemporaryBars.put(popupComponent, container);
|
||||
|
||||
Reference in New Issue
Block a user