[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit:[14247]
From:       shlomy () users ! sourceforge ! net
Date:       2008-12-29 19:10:53
Message-ID: E1LHNVt-0000TZ-0D () bj8yhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14247
          http://jedit.svn.sourceforge.net/jedit/?rev=14247&view=rev
Author:   shlomy
Date:     2008-12-29 19:10:52 +0000 (Mon, 29 Dec 2008)

Log Message:
-----------
Improved the looks of the close button on the buffer tabs, and color it red when the \
mouse is over it.

Modified Paths:
--------------
    plugins/BufferTabs/trunk/buffertabs/BufferTabComponent.java

Modified: plugins/BufferTabs/trunk/buffertabs/BufferTabComponent.java
===================================================================
--- plugins/BufferTabs/trunk/buffertabs/BufferTabComponent.java	2008-12-29 16:09:19 \
                UTC (rev 14246)
+++ plugins/BufferTabs/trunk/buffertabs/BufferTabComponent.java	2008-12-29 19:10:52 \
UTC (rev 14247) @@ -46,11 +46,22 @@
 			}
 		};
 		add(l);
-		JLabel close = new JLabel(icon);
+		final JLabel close = new JLabel(icon);
 		close.setPreferredSize(iconDimension);
+		close.setForeground(Color.BLACK);
 		add(close);
 		close.addMouseListener(new MouseAdapter() {
 			@Override
+			public void mouseEntered(MouseEvent e) {
+				close.setForeground(Color.RED);
+			}
+
+			@Override
+			public void mouseExited(MouseEvent e) {
+				close.setForeground(Color.BLACK);
+			}
+
+			@Override
 			public void mouseClicked(MouseEvent e) {
 				int index = pane.indexOfTabComponent(BufferTabComponent.this);
 				if (index < 0)
@@ -62,18 +73,20 @@
 	}
 	
 	static private class CloseIcon implements Icon {
+		static final private int width = 9;
+		static final private int height = 11;
+		static final private int top = 3;
 		public void paintIcon(Component c, Graphics g, int x, int y) {
-			g.setColor(Color.BLACK);
-			g.drawLine(0, 0, getIconWidth() - 2, getIconHeight() - 1);
-			g.drawLine(1, 0, getIconWidth() - 1, getIconHeight() - 1);
-			g.drawLine(getIconWidth() - 1, 0, 1, getIconHeight() - 1);
-			g.drawLine(getIconWidth() - 2, 0, 0, getIconHeight() - 1);
+			g.drawLine(0, top, width - 2, height - 1);
+			g.drawLine(1, top, width - 1, height - 1);
+			g.drawLine(width - 1, top, 1, height - 1);
+			g.drawLine(width - 2, top, 0, height - 1);
 		}
 		public int getIconWidth() {
-			return 7;
+			return width;
 		}
 		public int getIconHeight() {
-			return 6;
+			return height;
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic