mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
improve tabs and transaction diagram tooltips with long labels
This commit is contained in:
parent
a8f7ce9e34
commit
2fa8e5fd70
2 changed files with 19 additions and 4 deletions
|
|
@ -78,6 +78,7 @@ public class AppController implements Initializable {
|
|||
private static final Logger log = LoggerFactory.getLogger(AppController.class);
|
||||
|
||||
public static final String DRAG_OVER_CLASS = "drag-over";
|
||||
public static final int TAB_LABEL_MAX_WIDTH = 300;
|
||||
public static final double TAB_LABEL_GRAPHIC_OPACITY_INACTIVE = 0.8;
|
||||
public static final double TAB_LABEL_GRAPHIC_OPACITY_ACTIVE = 0.95;
|
||||
public static final String LOADING_TRANSACTIONS_MESSAGE = "Loading wallet, select Transactions tab to view...";
|
||||
|
|
@ -1990,8 +1991,15 @@ public class AppController implements Initializable {
|
|||
glyph.setFontSize(10.0);
|
||||
glyph.setOpacity(TAB_LABEL_GRAPHIC_OPACITY_ACTIVE);
|
||||
Label tabLabel = new Label(tabName);
|
||||
tabLabel.setMaxWidth(TAB_LABEL_MAX_WIDTH);
|
||||
tabLabel.setGraphic(glyph);
|
||||
tabLabel.setGraphicTextGap(5.0);
|
||||
tabLabel.textTruncatedProperty().addListener((_, _, newValue) -> {
|
||||
if(newValue && name != null && !name.isEmpty()) {
|
||||
Tooltip tooltip = new Tooltip(name);
|
||||
tabLabel.setTooltip(tooltip);
|
||||
}
|
||||
});
|
||||
tab.setGraphic(tabLabel);
|
||||
tab.setContextMenu(getTabContextMenu(tab));
|
||||
tab.setClosable(true);
|
||||
|
|
|
|||
|
|
@ -40,10 +40,7 @@ import javafx.scene.paint.Color;
|
|||
import javafx.scene.shape.Circle;
|
||||
import javafx.scene.shape.CubicCurve;
|
||||
import javafx.scene.shape.Line;
|
||||
import javafx.stage.FileChooser;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
import javafx.stage.*;
|
||||
import javafx.util.Duration;
|
||||
import org.controlsfx.glyphfont.Glyph;
|
||||
|
||||
|
|
@ -491,6 +488,11 @@ public class TransactionDiagram extends GridPane {
|
|||
}
|
||||
tooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
||||
tooltip.setShowDuration(Duration.INDEFINITE);
|
||||
tooltip.setWrapText(true);
|
||||
Window activeWindow = AppServices.getActiveWindow();
|
||||
if(activeWindow != null) {
|
||||
tooltip.setMaxWidth(activeWindow.getWidth());
|
||||
}
|
||||
if(!tooltip.getText().isEmpty()) {
|
||||
label.setTooltip(tooltip);
|
||||
}
|
||||
|
|
@ -688,6 +690,11 @@ public class TransactionDiagram extends GridPane {
|
|||
recipientTooltip.getStyleClass().add("recipient-label");
|
||||
recipientTooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
|
||||
recipientTooltip.setShowDuration(Duration.INDEFINITE);
|
||||
recipientTooltip.setWrapText(true);
|
||||
Window activeWindow = AppServices.getActiveWindow();
|
||||
if(activeWindow != null) {
|
||||
recipientTooltip.setMaxWidth(activeWindow.getWidth());
|
||||
}
|
||||
recipientLabel.setTooltip(recipientTooltip);
|
||||
HBox paymentBox = new HBox();
|
||||
paymentBox.setAlignment(Pos.CENTER_LEFT);
|
||||
|
|
|
|||
Loading…
Reference in a new issue