changeset 121:cc1df2f32f2b

TabColumnBoard and TabCalendarBoard cards now expand vertically to accomodate longer titless
author Fox
date Sat, 25 Nov 2023 15:18:53 +0100
parents 6a78c671a7cf
children ad6ad9f695bb
files src/junotu/ColumnCardWidget.java
diffstat 1 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/junotu/ColumnCardWidget.java	Sat Nov 25 13:10:43 2023 +0100
+++ b/src/junotu/ColumnCardWidget.java	Sat Nov 25 15:18:53 2023 +0100
@@ -23,6 +23,8 @@
 
 class ColumnCardWidget extends JPanel {
 	
+	final static int CARD_MINIMUM_HEIGHT = 64;
+	
 	public boolean newCard;
 	public long identifier;
 	public JTextArea title;
@@ -35,12 +37,6 @@
 		
 		title.setFont( new Font( "Monospaced", Font.BOLD, 16 ) );
 		
-		this.setMinimumSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 64 ) );
-		this.setPreferredSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 64 ) );
-		this.setMaximumSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 128 ) );
-		
-		//title.setMinimumSize( new Dimension( 32, 32 ) );
-		
 		this.setBorder( BorderFactory.createRaisedBevelBorder() );
 		title.setEditable( true );
 		title.setLineWrap( true );
@@ -69,6 +65,27 @@
 		
 	}
 	
+	public Dimension getMinimumSize()
+	{
+		Dimension d = super.getMinimumSize();
+		d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height );
+		return d;
+	}
+	
+	public Dimension getMaximumSize()
+	{
+		Dimension d = super.getMaximumSize();
+		d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height );
+		return d;
+	}
+	
+	public Dimension getPreferredSize()
+	{
+		Dimension d = super.getPreferredSize();
+		d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height );
+		return d;
+	}
+	
 	public void save()
 	{
 		try {