From cfea07a17925d6d4446898cb256d7f67b5ea8884 Mon Sep 17 00:00:00 2001 From: Claudecio Martins Date: Tue, 20 Oct 2026 22:16:50 -0300 Subject: [PATCH] fix(ui): prevent button text truncation across all dialogs with USE_PREF_SIZE and sizeToScene --- .../signer/ui/view/A1PasswordDialog.java | 17 ++++++++++++---- .../ui/view/ApplicationApprovalDialog.java | 12 ++++++++++- .../signer/ui/view/BatchSigningDialog.java | 13 +++++++++--- .../ui/view/CertificateDetailsDialog.java | 8 ++++++-- .../ui/view/CertificatesManagerDialog.java | 8 ++++++++ .../ui/view/ExitConfirmationDialog.java | 6 ++++-- .../signer/ui/view/FileSignDialog.java | 17 +++++++++++++--- .../signer/ui/view/LogsViewerDialog.java | 20 +++++++++++++------ .../ui/view/PdfCertificateSignDialog.java | 8 ++++---- .../signer/ui/view/PdfSignDialog.java | 13 +++++++++--- .../signer/ui/view/SealDesignerDialog.java | 17 ++++++++++++++-- .../signer/ui/view/SealManagementDialog.java | 10 +++++++--- .../signer/ui/view/SignaturePromptDialog.java | 16 +++++++++++---- .../ui/view/SignatureValidationDialog.java | 18 +++++++++++++++-- .../signer/ui/view/TutorialDialog.java | 10 +++++++--- .../signer/ui/view/XmlSignDialog.java | 6 ++++++ 16 files changed, 157 insertions(+), 42 deletions(-) diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/A1PasswordDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/A1PasswordDialog.java index 2b7ee3d..3ae89ee 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/A1PasswordDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/A1PasswordDialog.java @@ -41,7 +41,6 @@ public class A1PasswordDialog { VBox root = new VBox(16); root.getStyleClass().add("dialog-container"); root.setPadding(new Insets(24)); - root.setPrefWidth(440); Label header = new Label("IMPORTAR CERTIFICADO A1"); header.getStyleClass().add("dialog-header"); @@ -70,14 +69,19 @@ public class A1PasswordDialog { actionsRow.setAlignment(Pos.CENTER_RIGHT); Button btnCancel = new Button("Cancelar"); - btnCancel.getStyleClass().add("btn-secondary"); + btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnCancel.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> { passwordFuture.complete(null); stage.close(); }); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnConfirm = new Button("Importar"); - btnConfirm.getStyleClass().add("btn-primary"); + btnConfirm.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnConfirm.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnConfirm.setDefaultButton(true); btnConfirm.setOnAction(e -> { String text = passwordField.getText(); @@ -85,7 +89,7 @@ public class A1PasswordDialog { stage.close(); }); - actionsRow.getChildren().addAll(btnCancel, btnConfirm); + actionsRow.getChildren().addAll(btnCancel, spacer, btnConfirm); root.getChildren().addAll(header, desc, fileBox, inputGroup, actionsRow); @@ -93,6 +97,7 @@ public class A1PasswordDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); stage.setOnCloseRequest(e -> passwordFuture.complete(null)); } @@ -100,4 +105,8 @@ public class A1PasswordDialog { stage.show(); return passwordFuture; } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ApplicationApprovalDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ApplicationApprovalDialog.java index 7bab0a0..b18f456 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ApplicationApprovalDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ApplicationApprovalDialog.java @@ -95,20 +95,25 @@ public class ApplicationApprovalDialog { Button btnReject = new Button("Recusar Acesso"); btnReject.getStyleClass().addAll("btn-danger-outline", "btn-dialog"); + btnReject.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnReject.setOnAction(e -> { approvalFuture.complete(false); stage.close(); }); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnAuthorize = new Button("Autorizar Conexão"); btnAuthorize.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnAuthorize.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnAuthorize.setDefaultButton(true); btnAuthorize.setOnAction(e -> { approvalFuture.complete(true); stage.close(); }); - actionsRow.getChildren().addAll(btnReject, btnAuthorize); + actionsRow.getChildren().addAll(btnReject, spacer, btnAuthorize); root.getChildren().addAll(header, detailsBox, secWarning, actionsRow); @@ -116,6 +121,7 @@ public class ApplicationApprovalDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); stage.setOnCloseRequest(e -> approvalFuture.complete(false)); } @@ -124,4 +130,8 @@ public class ApplicationApprovalDialog { stage.toFront(); return approvalFuture; } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/BatchSigningDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/BatchSigningDialog.java index 1346f65..3fcbfea 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/BatchSigningDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/BatchSigningDialog.java @@ -245,6 +245,7 @@ public final class BatchSigningDialog { btnChooseOutputDir = new Button("Selecionar..."); btnChooseOutputDir.getStyleClass().add("btn-secondary"); + btnChooseOutputDir.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnChooseOutputDir.setOnAction(e -> handleChooseOutputDir()); outputRow.getChildren().addAll(lblOutput, txtOutputDir, btnChooseOutputDir); @@ -266,16 +267,21 @@ public final class BatchSigningDialog { footer.setAlignment(Pos.CENTER_RIGHT); Button btnClose = new Button("Fechar"); - btnClose.getStyleClass().add("btn-secondary"); + btnClose.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> { if (!isRunning) stage.close(); }); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + btnStart = new Button("Iniciar Assinatura em Lote"); - btnStart.getStyleClass().add("btn-primary"); + btnStart.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnStart.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnStart.setOnAction(e -> startBatchSigning()); - footer.getChildren().addAll(btnClose, btnStart); + footer.getChildren().addAll(btnClose, spacer, btnStart); root.getChildren().addAll(header, fileActions, tableView, configBox, progressBox, footer); @@ -283,6 +289,7 @@ public final class BatchSigningDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void handleAddFiles() { diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificateDetailsDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificateDetailsDialog.java index 501a939..66d72bc 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificateDetailsDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificateDetailsDialog.java @@ -129,8 +129,7 @@ public class CertificateDetailsDialog { Button btnClose = new Button(" Fechar", SvgIcons.closeIcon(13)); btnClose.getStyleClass().addAll("btn-ghost", "btn-dialog"); - btnClose.setPrefWidth(110); - btnClose.setMinWidth(110); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); actionsRow.getChildren().add(btnClose); @@ -141,12 +140,17 @@ public class CertificateDetailsDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } public void show() { stage.show(); } + public Stage getStage() { + return this.stage; + } + private void addField(GridPane grid, int row, String label, String value) { Label lbl = new Label(label); lbl.getStyleClass().add("dialog-field-title"); diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificatesManagerDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificatesManagerDialog.java index 33c61d7..2b4c72f 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificatesManagerDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/CertificatesManagerDialog.java @@ -75,10 +75,12 @@ public final class CertificatesManagerDialog { Button btnAddA1 = new Button("Importar A1 (.pfx / .p12)..."); btnAddA1.getStyleClass().add("btn-primary"); + btnAddA1.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnAddA1.setOnAction(e -> handleImportA1()); Button btnRefresh = new Button(" Atualizar Lista", SvgIcons.refreshIcon(14)); btnRefresh.getStyleClass().add("btn-secondary"); + btnRefresh.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnRefresh.setOnAction(e -> refreshList()); actions.getChildren().addAll(btnAddA1, btnRefresh); @@ -95,6 +97,7 @@ public final class CertificatesManagerDialog { footer.setAlignment(Pos.CENTER_RIGHT); Button btnClose = new Button(" Fechar", SvgIcons.closeIcon(13)); btnClose.getStyleClass().add("btn-secondary"); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); footer.getChildren().add(btnClose); @@ -104,6 +107,7 @@ public final class CertificatesManagerDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void refreshList() { @@ -189,4 +193,8 @@ public final class CertificatesManagerDialog { public void show() { stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ExitConfirmationDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ExitConfirmationDialog.java index b8ef87d..b41482f 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ExitConfirmationDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/ExitConfirmationDialog.java @@ -37,8 +37,6 @@ public final class ExitConfirmationDialog { } this.stage.setTitle("CyberCore Signer — Encerrar ou Manter na Bandeja"); this.stage.setResizable(false); - this.stage.setMinWidth(520); - this.stage.setMinHeight(190); initLayout(); } @@ -71,6 +69,7 @@ public final class ExitConfirmationDialog { Button btnCancel = new Button("Cancelar"); btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnCancel.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> { chosenAction = ExitChoice.CANCEL; stage.close(); @@ -81,6 +80,7 @@ public final class ExitConfirmationDialog { Button btnExit = new Button("Encerrar Definitivamente"); btnExit.getStyleClass().addAll("btn-danger-outline", "btn-dialog"); + btnExit.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnExit.setOnAction(e -> { chosenAction = ExitChoice.EXIT_COMPLETELY; stage.close(); @@ -88,6 +88,7 @@ public final class ExitConfirmationDialog { Button btnMinimize = new Button("Minimizar para a Bandeja"); btnMinimize.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnMinimize.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnMinimize.setDefaultButton(true); btnMinimize.setOnAction(e -> { chosenAction = ExitChoice.MINIMIZE_TO_TRAY; @@ -101,6 +102,7 @@ public final class ExitConfirmationDialog { Scene scene = new Scene(root); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); stage.setOnCloseRequest(e -> chosenAction = ExitChoice.CANCEL); } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/FileSignDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/FileSignDialog.java index 8490bee..9252d31 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/FileSignDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/FileSignDialog.java @@ -112,6 +112,7 @@ public final class FileSignDialog { Button btnBrowse = new Button("Procurar..."); btnBrowse.getStyleClass().add("btn-secondary"); + btnBrowse.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnBrowse.setOnAction(e -> handleBrowseFile()); fileRow.getChildren().addAll(txtFilePath, btnBrowse); @@ -159,15 +160,20 @@ public final class FileSignDialog { footer.setAlignment(Pos.CENTER_RIGHT); Button btnCancel = new Button("Cancelar"); - btnCancel.getStyleClass().add("btn-secondary"); + btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnCancel.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> stage.close()); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnSign = new Button("Assinar Documento"); - btnSign.getStyleClass().add("btn-primary"); + btnSign.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnSign.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnSign.setDefaultButton(true); btnSign.setOnAction(e -> executeSignature()); - footer.getChildren().addAll(btnCancel, btnSign); + footer.getChildren().addAll(btnCancel, spacer, btnSign); root.getChildren().addAll(header, fileBox, certBox, footer); @@ -175,6 +181,7 @@ public final class FileSignDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void handleBrowseFile() { @@ -257,4 +264,8 @@ public final class FileSignDialog { public void show() { stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/LogsViewerDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/LogsViewerDialog.java index c517767..3df8bc5 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/LogsViewerDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/LogsViewerDialog.java @@ -64,7 +64,7 @@ public final class LogsViewerDialog { Button btnCopy = new Button("Copiar"); btnCopy.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnCopy.setPrefWidth(90); + btnCopy.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCopy.setOnAction(e -> { javafx.scene.input.ClipboardContent content = new javafx.scene.input.ClipboardContent(); content.putString(txtLogs.getText()); @@ -77,7 +77,7 @@ public final class LogsViewerDialog { Button btnClear = new Button("Limpar"); btnClear.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnClear.setPrefWidth(90); + btnClear.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClear.setOnAction(e -> { br.com.cybercore.signer.core.log.AppLogBuffer.clear(); loadLogs(); @@ -85,15 +85,18 @@ public final class LogsViewerDialog { Button btnRefresh = new Button("Atualizar"); btnRefresh.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnRefresh.setPrefWidth(100); + btnRefresh.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnRefresh.setOnAction(e -> loadLogs()); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnClose = new Button(" Fechar", SvgIcons.closeIcon(13)); - btnClose.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnClose.setPrefWidth(100); + btnClose.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); - footer.getChildren().addAll(btnCopy, btnClear, btnRefresh, btnClose); + footer.getChildren().addAll(btnCopy, btnClear, btnRefresh, spacer, btnClose); root.getChildren().addAll(header, txtLogs, footer); @@ -101,6 +104,7 @@ public final class LogsViewerDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void loadLogs() { @@ -127,4 +131,8 @@ public final class LogsViewerDialog { public void show() { stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfCertificateSignDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfCertificateSignDialog.java index 0736470..71b4d2f 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfCertificateSignDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfCertificateSignDialog.java @@ -304,13 +304,12 @@ public final class PdfCertificateSignDialog { btnCancel = new Button("Cancelar"); btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); - btnCancel.setMinWidth(110); + btnCancel.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> stage.close()); btnSign = new Button("Assinar Documento PDF"); btnSign.getStyleClass().addAll("btn-primary", "btn-dialog-wide"); - btnSign.setMinWidth(220); - btnSign.setPrefWidth(Region.USE_COMPUTED_SIZE); + btnSign.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnSign.setDefaultButton(true); btnSign.setOnAction(e -> handleSign()); @@ -318,9 +317,10 @@ public final class PdfCertificateSignDialog { root.getChildren().addAll(header, summaryBox, certSection, footer); - Scene scene = new Scene(root, 720, 500); + Scene scene = new Scene(root); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); updatePinFieldVisibility(); } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfSignDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfSignDialog.java index d1536f6..08f64fc 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfSignDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/PdfSignDialog.java @@ -270,14 +270,13 @@ public final class PdfSignDialog { btnCancel = new Button("Cancelar"); btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); - btnCancel.setMinWidth(110); + btnCancel.setMinWidth(Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> stage.close()); btnNextToCert = new Button("Avançar", SvgIcons.arrowRightIcon(12)); btnNextToCert.setContentDisplay(javafx.scene.control.ContentDisplay.RIGHT); btnNextToCert.getStyleClass().addAll("btn-primary", "btn-dialog-wide"); - btnNextToCert.setMinWidth(240); - btnNextToCert.setPrefWidth(250); + btnNextToCert.setMinWidth(Region.USE_PREF_SIZE); btnNextToCert.setDefaultButton(true); btnNextToCert.setOnAction(e -> handleAdvanceToCertificate()); @@ -291,6 +290,7 @@ public final class PdfSignDialog { Scene scene = new Scene(root, 1020, 680); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); updateSealPreview(); } @@ -429,6 +429,7 @@ public final class PdfSignDialog { btnPrevPage = new Button("◀"); btnPrevPage.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnPrevPage.setMinWidth(Region.USE_PREF_SIZE); btnPrevPage.setTooltip(new Tooltip("Página Anterior")); btnPrevPage.setDisable(true); btnPrevPage.setOnAction(e -> navigatePage(-1)); @@ -438,6 +439,7 @@ public final class PdfSignDialog { btnNextPage = new Button("▶"); btnNextPage.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnNextPage.setMinWidth(Region.USE_PREF_SIZE); btnNextPage.setTooltip(new Tooltip("Próxima Página")); btnNextPage.setDisable(true); btnNextPage.setOnAction(e -> navigatePage(1)); @@ -456,6 +458,7 @@ public final class PdfSignDialog { btnZoomOut = new Button(); btnZoomOut.setGraphic(SvgIcons.zoomOutIcon(13)); btnZoomOut.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnZoomOut.setMinWidth(Region.USE_PREF_SIZE); btnZoomOut.setTooltip(new Tooltip("Diminuir Zoom")); btnZoomOut.setOnAction(e -> adjustZoom(-ZOOM_STEP)); @@ -465,12 +468,14 @@ public final class PdfSignDialog { btnZoomIn = new Button(); btnZoomIn.setGraphic(SvgIcons.zoomInIcon(13)); btnZoomIn.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnZoomIn.setMinWidth(Region.USE_PREF_SIZE); btnZoomIn.setTooltip(new Tooltip("Aumentar Zoom")); btnZoomIn.setOnAction(e -> adjustZoom(ZOOM_STEP)); btnZoomFit = new Button("Ajustar"); btnZoomFit.setGraphic(SvgIcons.zoomFitIcon(12)); btnZoomFit.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnZoomFit.setMinWidth(Region.USE_PREF_SIZE); btnZoomFit.setTooltip(new Tooltip("Ajustar à janela")); btnZoomFit.setOnAction(e -> setZoom(1.0)); @@ -483,6 +488,7 @@ public final class PdfSignDialog { btnToggleResize = new Button(" Redimensionar", SvgIcons.zoomFitIcon(13)); btnToggleResize.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnToggleResize.setMinWidth(Region.USE_PREF_SIZE); btnToggleResize.setTooltip(new Tooltip("Ativar/desativar alça interativa para alterar o tamanho do selo")); btnToggleResize.setOnAction(e -> toggleResizeMode()); @@ -491,6 +497,7 @@ public final class PdfSignDialog { btnResetSealScale = new Button(" 100%", SvgIcons.refreshIcon(12)); btnResetSealScale.getStyleClass().addAll("btn-secondary", "btn-compact"); + btnResetSealScale.setMinWidth(Region.USE_PREF_SIZE); btnResetSealScale.setTooltip(new Tooltip("Restaurar tamanho padrão original (100%)")); btnResetSealScale.setVisible(false); btnResetSealScale.setOnAction(e -> applySealScale(1.0)); diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealDesignerDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealDesignerDialog.java index 6975387..a0f855e 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealDesignerDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealDesignerDialog.java @@ -383,24 +383,33 @@ public final class SealDesignerDialog { footer.setAlignment(Pos.CENTER_RIGHT); footer.setPadding(new Insets(6, 0, 0, 0)); + Region spacer = new Region(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnCancel = new Button("Cancelar"); - btnCancel.getStyleClass().add("btn-secondary"); + btnCancel.getStyleClass().add("btn-ghost"); + btnCancel.setMinWidth(Region.USE_PREF_SIZE); btnCancel.setPrefHeight(34); btnCancel.setOnAction(e -> stage.close()); Button btnInstall = new Button("💾 Instalar Selo no Sistema"); btnInstall.getStyleClass().add("btn-primary"); + btnInstall.setMinWidth(Region.USE_PREF_SIZE); btnInstall.setPrefHeight(34); btnInstall.setDefaultButton(true); btnInstall.setOnAction(e -> handleInstallSeal()); - footer.getChildren().addAll(btnCancel, btnInstall); + btnImport.setMinWidth(Region.USE_PREF_SIZE); + btnExport.setMinWidth(Region.USE_PREF_SIZE); + + footer.getChildren().addAll(spacer, btnCancel, btnInstall); root.getChildren().addAll(header, mainSplit, footer); Scene scene = new Scene(root, 880, 580); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void updatePreview() { @@ -640,4 +649,8 @@ public final class SealDesignerDialog { stage.centerOnScreen(); stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealManagementDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealManagementDialog.java index ecd3e50..60ce1de 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealManagementDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SealManagementDialog.java @@ -222,9 +222,8 @@ public final class SealManagementDialog { footer.setAlignment(Pos.CENTER_RIGHT); Button btnClose = new Button(" Fechar", SvgIcons.closeIcon(13)); - btnClose.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnClose.setPrefWidth(110); - btnClose.setMinWidth(110); + btnClose.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); footer.getChildren().add(btnClose); @@ -234,6 +233,7 @@ public final class SealManagementDialog { Scene scene = new Scene(root, 880, 560); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void refreshSealsList() { @@ -441,6 +441,10 @@ public final class SealManagementDialog { stage.showAndWait(); } + public Stage getStage() { + return this.stage; + } + /** * Célula customizada para a listagem visual dos selos. */ diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignaturePromptDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignaturePromptDialog.java index 0cc8490..df83d40 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignaturePromptDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignaturePromptDialog.java @@ -66,7 +66,6 @@ public class SignaturePromptDialog { VBox root = new VBox(16); root.getStyleClass().add("dialog-container"); root.setPadding(new Insets(20, 24, 20, 24)); - root.setPrefWidth(560); HBox headerBox = new HBox(14); headerBox.setAlignment(Pos.CENTER_LEFT); @@ -240,14 +239,19 @@ public class SignaturePromptDialog { actionsRow.setPadding(new Insets(4, 0, 0, 0)); Button btnCancel = new Button("Cancelar"); - btnCancel.getStyleClass().add("btn-cancel"); + btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnCancel.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> { approvalFuture.complete(false); stage.close(); }); + HBox spacer = new HBox(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnConfirm = new Button(isAuthentication ? "Confirmar e Entrar" : "Confirmar e Assinar"); - btnConfirm.getStyleClass().add("btn-primary"); + btnConfirm.getStyleClass().addAll("btn-primary", "btn-dialog"); + btnConfirm.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnConfirm.setDefaultButton(true); btnConfirm.setOnAction(e -> { if (isA3 && !isWindowsStore) { @@ -277,7 +281,7 @@ public class SignaturePromptDialog { stage.close(); }); - actionsRow.getChildren().addAll(btnCancel, btnConfirm); + actionsRow.getChildren().addAll(btnCancel, spacer, btnConfirm); if (isA3) { root.getChildren().addAll(headerBox, detailsBox, pinContainer, validationLabel, actionsRow); @@ -335,4 +339,8 @@ public class SignaturePromptDialog { } return sb.toString(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignatureValidationDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignatureValidationDialog.java index ffce1d4..0205d66 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignatureValidationDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/SignatureValidationDialog.java @@ -19,6 +19,7 @@ import javafx.scene.control.TextField; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; +import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import javafx.stage.FileChooser; import javafx.stage.Modality; @@ -120,6 +121,7 @@ public final class SignatureValidationDialog { Button btnBrowseSig = new Button("Procurar..."); btnBrowseSig.getStyleClass().add("btn-secondary"); + btnBrowseSig.setMinWidth(Region.USE_PREF_SIZE); btnBrowseSig.setOnAction(e -> handleBrowseSig()); sigRow.getChildren().addAll(txtSigPath, btnBrowseSig); @@ -139,6 +141,7 @@ public final class SignatureValidationDialog { Button btnBrowseDoc = new Button("Procurar..."); btnBrowseDoc.getStyleClass().add("btn-secondary"); + btnBrowseDoc.setMinWidth(Region.USE_PREF_SIZE); btnBrowseDoc.setOnAction(e -> handleBrowseDoc()); docRow.getChildren().addAll(txtDocPath, btnBrowseDoc); @@ -161,28 +164,35 @@ public final class SignatureValidationDialog { btnSaveExtracted = new Button("Salvar Conteúdo Extraído..."); btnSaveExtracted.getStyleClass().add("btn-secondary"); + btnSaveExtracted.setMinWidth(Region.USE_PREF_SIZE); btnSaveExtracted.setVisible(false); btnSaveExtracted.setManaged(false); btnSaveExtracted.setOnAction(e -> handleSaveExtracted()); HBox.setHgrow(btnSaveExtracted, Priority.NEVER); + Region spacer = new Region(); + HBox.setHgrow(spacer, Priority.ALWAYS); + Button btnClose = new Button("Fechar"); - btnClose.getStyleClass().add("btn-secondary"); + btnClose.getStyleClass().add("btn-ghost"); + btnClose.setMinWidth(Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); Button btnValidate = new Button("Validar Agora"); btnValidate.getStyleClass().add("btn-primary"); + btnValidate.setMinWidth(Region.USE_PREF_SIZE); btnValidate.setDefaultButton(true); btnValidate.setOnAction(e -> handleValidate()); - footer.getChildren().addAll(btnSaveExtracted, btnClose, btnValidate); + footer.getChildren().addAll(btnSaveExtracted, spacer, btnClose, btnValidate); root.getChildren().addAll(header, typeBox, sigBox, docBox, scrollResult, footer); Scene scene = new Scene(root); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); updateModeView(); } @@ -382,4 +392,8 @@ public final class SignatureValidationDialog { public void show() { stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/TutorialDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/TutorialDialog.java index 0b980ec..79daf68 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/TutorialDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/TutorialDialog.java @@ -77,9 +77,8 @@ public final class TutorialDialog { HBox footer = new HBox(); footer.setAlignment(Pos.CENTER_RIGHT); Button btnClose = new Button(" Entendi", SvgIcons.closeIcon(13)); - btnClose.getStyleClass().addAll("btn-secondary", "btn-dialog"); - btnClose.setPrefWidth(110); - btnClose.setMinWidth(110); + btnClose.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnClose.setMinWidth(javafx.scene.layout.Region.USE_PREF_SIZE); btnClose.setOnAction(e -> stage.close()); footer.getChildren().add(btnClose); @@ -89,6 +88,7 @@ public final class TutorialDialog { ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); } private void addStep(VBox container, String title, String description) { @@ -116,4 +116,8 @@ public final class TutorialDialog { public void show() { stage.show(); } + + public Stage getStage() { + return this.stage; + } } diff --git a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/XmlSignDialog.java b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/XmlSignDialog.java index cbaa48a..1069f30 100644 --- a/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/XmlSignDialog.java +++ b/modules/cybercore-ui/src/main/java/br/com/cybercore/signer/ui/view/XmlSignDialog.java @@ -294,6 +294,7 @@ public final class XmlSignDialog { btnCancel = new Button("Cancelar"); btnCancel.getStyleClass().addAll("btn-ghost", "btn-dialog"); + btnCancel.setMinWidth(Region.USE_PREF_SIZE); btnCancel.setOnAction(e -> stage.close()); btnSign = new Button("Assinar Documento XML"); @@ -309,6 +310,7 @@ public final class XmlSignDialog { Scene scene = new Scene(root); ThemeManager.applyTheme(scene); stage.setScene(scene); + stage.sizeToScene(); updatePinFieldVisibility(); } @@ -554,4 +556,8 @@ public final class XmlSignDialog { stage.show(); stage.toFront(); } + + public Stage getStage() { + return this.stage; + } }