mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Show tooltip for truncated caption
This commit is contained in:
@@ -324,8 +324,12 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel {
|
||||
int cbViewsWidth = this.cbViews.getAutoSizeWidth();
|
||||
int availableCaptionWidth = helper.getParentWidth() - cbViewsWidth - ratioWidth - helper.getX() - 9;
|
||||
if (captionWidth > availableCaptionWidth) { //truncate caption if not enough room for it
|
||||
this.lblCaption.setToolTipText(this.lblCaption.getText());
|
||||
captionWidth = availableCaptionWidth;
|
||||
}
|
||||
else {
|
||||
this.lblCaption.setToolTipText(null);
|
||||
}
|
||||
helper.include(this.lblCaption, captionWidth, FTextField.HEIGHT);
|
||||
helper.fillLine(this.lblRatio, FTextField.HEIGHT, cbViewsWidth); //leave room for cbViews
|
||||
helper.fillLine(this.cbViews.getComponent(), FTextField.HEIGHT);
|
||||
|
||||
Reference in New Issue
Block a user