From eeb5e538b6867881aef74f8725ac9fcc675027a1 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 1 Oct 2012 08:30:40 +0000 Subject: Added custom border to MainBar buttons Added Hand cursor for MainBar buttons git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12535 3a0b52a2-8410-0410-bc02-ff6273a87459 --- .../at/asit/pdfover/gui/controls/MainBarEndButton.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java index b80b9645..2542d805 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarEndButton.java @@ -48,7 +48,7 @@ public class MainBarEndButton extends MainBarButton { * at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt * .events.PaintEvent) */ - /*@Override + @Override protected void paintButton(PaintEvent e) { Point size = this.getSize(); int height = size.y - 2; @@ -56,22 +56,14 @@ public class MainBarEndButton extends MainBarButton { int split = 10; int width = size.x; - int textlen = 0; - - if(this.getText() != null) { - textlen = this.getText().length(); - } - e.gc.drawLine(0, 0, width, 0); e.gc.drawLine(width, 0, width+split, (height) / 2); e.gc.drawLine(width, height, 0, height); e.gc.drawLine(0, height, 0+split, (height) / 2); e.gc.drawLine(0+split, (height) / 2, 0, 0); - int texty = (height - e.gc.getFontMetrics().getHeight()) / 2; - int textx = (width - e.gc.getFontMetrics().getAverageCharWidth() * textlen) / 2; - e.gc.drawText(this.getText(), textx, texty); - }*/ + super.paintButton(e); + } /* * (non-Javadoc) -- cgit v1.2.3