From f34176108e02e2f3122d8023dfc2d68fd12da7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 23 May 2025 20:51:37 +0200 Subject: [PATCH] Always on top not in dialogs. --- .../substance/internal/resources/Labels.properties | 2 +- .../substance/internal/resources/Labels_cs.properties | 2 +- .../substance/internal/utils/SubstanceTitlePane.java | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels.properties b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels.properties index 6c28433f7..46abb093f 100644 --- a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels.properties +++ b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels.properties @@ -30,4 +30,4 @@ Xoetrope.decimalRGB=Decimal RGB Xoetrope.webSafeColors=Use web safe colors -SystemMenu.alwaysOnTop=Toggle Always on top +SystemMenu.alwaysOnTop=Toggle "Always on top" diff --git a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels_cs.properties b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels_cs.properties index 48676c9c7..0f92158b8 100644 --- a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels_cs.properties +++ b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/resources/Labels_cs.properties @@ -30,4 +30,4 @@ Xoetrope.decimalRGB=Des\u00fdtkov\u00e9 RGB Xoetrope.webSafeColors=Pou\u017e\u00fd barvy bezpe\u010dn\u00e9 pro web -SystemMenu.alwaysOnTop=P\u0159epnout V\u017edy na vrchu \ No newline at end of file +SystemMenu.alwaysOnTop=P\u0159epnout "V\u017edy na vrchu" \ No newline at end of file diff --git a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/utils/SubstanceTitlePane.java b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/utils/SubstanceTitlePane.java index 7400d782e..ee7812586 100644 --- a/libsrc/substance-fix/src/org/pushingpixels/substance/internal/utils/SubstanceTitlePane.java +++ b/libsrc/substance-fix/src/org/pushingpixels/substance/internal/utils/SubstanceTitlePane.java @@ -1157,13 +1157,17 @@ public class SubstanceTitlePane extends JComponent { this.restoreAction.setEnabled(false); } if ((this.toggleButton.getParent() == null) - || (this.minimizeButton.getParent() == null)) { + || (this.minimizeButton.getParent() == null) + || (this.alwaysOnTopButton.getParent() == null) + ) { + this.add(this.alwaysOnTopButton); this.add(this.toggleButton); this.add(this.minimizeButton); this.revalidate(); this.repaint(); } this.toggleButton.setText(null); + this.alwaysOnTopAction.setEnabled(true); } else { this.maximizeAction.setEnabled(false); this.restoreAction.setEnabled(false); @@ -1175,9 +1179,11 @@ public class SubstanceTitlePane extends JComponent { } } else { // Not contained in a Frame + this.alwaysOnTopAction.setEnabled(false); this.maximizeAction.setEnabled(false); this.restoreAction.setEnabled(false); this.iconifyAction.setEnabled(false); + this.remove(this.alwaysOnTopButton); this.remove(this.toggleButton); this.remove(this.minimizeButton); this.revalidate();