mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-313596 Project and VCS popups might don't open on widget clicks
GitOrigin-RevId: 8ad3031827c4fc53bd1395256e024cff65d18ce2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
697b0b3502
commit
5a76ff3a64
+1
@@ -62,6 +62,7 @@ internal class MacToolbarFrameHeader(private val frame: JFrame,
|
||||
|
||||
private fun createToolBar(): MainToolbar {
|
||||
val toolbar = MainToolbar()
|
||||
toolbar.layoutCallBack = { updateCustomDecorationHitTestSpots() }
|
||||
toolbar.isOpaque = false
|
||||
toolbar.addComponentListener(object: ComponentAdapter() {
|
||||
override fun componentResized(e: ComponentEvent?) {
|
||||
|
||||
+1
@@ -118,6 +118,7 @@ internal class ToolbarFrameHeader(frame: JFrame, ideMenu: IdeMenuBar) : FrameHea
|
||||
removeToolbar()
|
||||
|
||||
val toolbar = MainToolbar()
|
||||
toolbar.layoutCallBack = { updateCustomDecorationHitTestSpots() }
|
||||
toolbar.init(toolbarActionGroups)
|
||||
toolbar.isOpaque = false
|
||||
toolbar.addComponentListener(contentResizeListener)
|
||||
|
||||
+12
-2
@@ -31,9 +31,12 @@ import javax.swing.JComponent
|
||||
import javax.swing.JPanel
|
||||
|
||||
internal class MainToolbar: JPanel(HorizontalLayout(10)) {
|
||||
|
||||
private val disposable = Disposer.newDisposable()
|
||||
private val mainMenuButton: MainMenuButton?
|
||||
|
||||
var layoutCallBack : LayoutCallBack? = null
|
||||
|
||||
init {
|
||||
background = JBUI.CurrentTheme.CustomFrameDecorations.mainToolbarBackground(true)
|
||||
isOpaque = true
|
||||
@@ -94,7 +97,7 @@ internal class MainToolbar: JPanel(HorizontalLayout(10)) {
|
||||
}
|
||||
|
||||
private fun createActionBar(group: ActionGroup): JComponent {
|
||||
val toolbar = MyActionToolbarImpl(group = group)
|
||||
val toolbar = MyActionToolbarImpl(group, layoutCallBack)
|
||||
toolbar.setActionButtonBorder(JBUI.Borders.empty(mainToolbarButtonInsets()))
|
||||
toolbar.setCustomButtonLook(HeaderToolbarButtonLook())
|
||||
|
||||
@@ -108,7 +111,9 @@ internal class MainToolbar: JPanel(HorizontalLayout(10)) {
|
||||
}
|
||||
}
|
||||
|
||||
private class MyActionToolbarImpl(group: ActionGroup) : ActionToolbarImpl(ActionPlaces.MAIN_TOOLBAR, group, true) {
|
||||
typealias LayoutCallBack = () -> Unit
|
||||
|
||||
private class MyActionToolbarImpl(group: ActionGroup, val layoutCallBack: LayoutCallBack?) : ActionToolbarImpl(ActionPlaces.MAIN_TOOLBAR, group, true) {
|
||||
|
||||
init {
|
||||
updateFont()
|
||||
@@ -119,6 +124,11 @@ private class MyActionToolbarImpl(group: ActionGroup) : ActionToolbarImpl(Action
|
||||
for (i in 0 until bounds.size) fitRectangle(bounds[i], getComponent(i))
|
||||
}
|
||||
|
||||
override fun doLayout() {
|
||||
super.doLayout()
|
||||
layoutCallBack?.invoke()
|
||||
}
|
||||
|
||||
private fun fitRectangle(rect: Rectangle, cmp: Component) {
|
||||
val minSize = ActionToolbar.experimentalToolbarMinimumButtonSize()
|
||||
if (!isSeparator(cmp)) rect.width = Integer.max(rect.width, minSize.width)
|
||||
|
||||
Reference in New Issue
Block a user