Skip to content

Commit cbc43ff

Browse files
Merge pull request #6009 from Baaaaaz/bug/6006-overlays-do-not-display
Fix ChatTypingPanel and ChatActionLabel notifications not displaying Take 2
2 parents de86bfc + f2669b5 commit cbc43ff

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

src/main/java/net/rptools/maptool/client/ui/MapToolFrame.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ public MapToolFrame(JMenuBar menuBar) {
411411
currentRenderPanel = zoneRendererPanel;
412412

413413
zoneRendererPanel.add(getChatTypingPanel(), PositionalLayout.Position.NW);
414-
zoneRendererPanel.add(getChatActionLabel(), PositionalLayout.Position.SW);
415414

416415
commandPanel = new CommandPanel();
417416

@@ -423,13 +422,12 @@ public MapToolFrame(JMenuBar menuBar) {
423422
zoneRendererPanel.add(overlayPanel, PositionalLayout.Position.CENTER, 0);
424423
overlayPanel.setVisible(false); // disabled by default
425424

425+
// chat action label should be above overlays, otherwise unclickable when overlays visible
426+
zoneRendererPanel.add(getChatActionLabel(), PositionalLayout.Position.SW, 0);
427+
426428
pointerToolOverlay = new PointerToolOverlay();
427429
zoneRendererPanel.add(pointerToolOverlay, PositionalLayout.Position.CENTER, 0);
428430

429-
// bring chat notifications to the front
430-
zoneRendererPanel.setComponentZOrder(getChatTypingPanel(), 0);
431-
zoneRendererPanel.setComponentZOrder(getChatActionLabel(), 0);
432-
433431
// Put it all together
434432
setJMenuBar(menuBar);
435433
add(BorderLayout.NORTH, toolbarPanel);
@@ -1707,8 +1705,7 @@ public void setCurrentZoneRenderer(ZoneRenderer renderer) {
17071705
zoneRendererPanel.remove(currentRenderer);
17081706
}
17091707
if (renderer != null) {
1710-
zoneRendererPanel.add(
1711-
renderer, PositionalLayout.Position.CENTER, zoneRendererPanel.getComponentCount() - 2);
1708+
zoneRendererPanel.add(renderer, PositionalLayout.Position.CENTER);
17121709
zoneRendererPanel.doLayout();
17131710
}
17141711
currentRenderer = renderer;
@@ -1933,10 +1930,6 @@ public void showFullScreenTools() {
19331930
zoneRendererPanel.add(initiativePanel, PositionalLayout.Position.SE);
19341931
zoneRendererPanel.setComponentZOrder(initiativePanel, 0);
19351932

1936-
// bring chat notifications to the front
1937-
zoneRendererPanel.setComponentZOrder(getChatTypingPanel(), 0);
1938-
zoneRendererPanel.setComponentZOrder(getChatActionLabel(), 0);
1939-
19401933
zoneRendererPanel.revalidate();
19411934
zoneRendererPanel.doLayout();
19421935
zoneRendererPanel.repaint();
@@ -1988,6 +1981,11 @@ public void showWindowed() {
19881981
menuBar.setVisible(true);
19891982
this.setVisible(true);
19901983

1984+
// hide the chat action label if the chat window is already visible in windowed mode
1985+
if (chatActionLabel.isShowing() && isCommandPanelVisible()) {
1986+
chatActionLabel.setVisible(false);
1987+
}
1988+
19911989
fullScreenFrame.dispose();
19921990
fullScreenFrame = null;
19931991
}

0 commit comments

Comments
 (0)