diff options
author | Veronika Irvine <veronika> | 2003-06-24 17:53:14 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2003-06-24 17:53:14 +0000 |
commit | 5b5f9526c7b9e96aff73ced02ddb3e552cbd7f68 (patch) | |
tree | 27414694a76fe3d0e3a6eab0afe870c97d0392bd | |
parent | ccee34c6ad1336c9450ee1310cda886c2fef8846 (diff) | |
download | eclipse.platform.swt-5b5f9526c7b9e96aff73ced02ddb3e552cbd7f68.tar.gz eclipse.platform.swt-5b5f9526c7b9e96aff73ced02ddb3e552cbd7f68.tar.xz eclipse.platform.swt-5b5f9526c7b9e96aff73ced02ddb3e552cbd7f68.zip |
*** empty log message ***
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java index d7b9683ce0..a9cdb93c5a 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java @@ -1767,6 +1767,7 @@ private void updateCloseBar() { if ("gtk".equals(platform)) toolbarTrim = 8; //$NON-NLS-1$ int maxHeight = tabHeight - CTabItem.TOP_MARGIN - CTabItem.BOTTOM_MARGIN - toolbarTrim; + if (maxHeight < 3) return; int imageHeight = Math.max(9, maxHeight); if (closeImage != null) { @@ -1811,10 +1812,14 @@ private void updateCloseBar() { gc.dispose(); if (maxHeight < imageHeight) { - //rescale image - Image temp = scaleImage(closeImage, imageHeight, maxHeight); - closeImage.dispose(); - closeImage = temp; + try { + //rescale image + Image temp = scaleImage(closeImage, imageHeight, maxHeight); + closeImage.dispose(); + closeImage = temp; + } catch (IllegalArgumentException e) { + } catch (SWTException e) { + } } closeItem.setImage(closeImage); inactiveCloseItem.setImage(closeImage); @@ -1827,6 +1832,7 @@ private void updateArrowBar() { if ("gtk".equals(platform)) toolbarTrim = 8; //$NON-NLS-1$ int maxHeight = tabHeight - toolbarTrim; + if (maxHeight < 3) return; int imageHeight = Math.max(9, maxHeight); if (arrowLeftImage != null) { @@ -1883,14 +1889,22 @@ private void updateArrowBar() { gc.dispose(); if (maxHeight < imageHeight) { - //rescale image - Image leftTemp = scaleImage(arrowLeftImage, imageHeight, maxHeight); - arrowLeftImage.dispose(); - arrowLeftImage = leftTemp; + try { + //rescale image + Image leftTemp = scaleImage(arrowLeftImage, imageHeight, maxHeight); + arrowLeftImage.dispose(); + arrowLeftImage = leftTemp; + } catch (IllegalArgumentException e) { + } catch (SWTException e) { + } - Image rightTemp = scaleImage(arrowRightImage, imageHeight, maxHeight); - arrowRightImage.dispose(); - arrowRightImage = rightTemp; + try { + Image rightTemp = scaleImage(arrowRightImage, imageHeight, maxHeight); + arrowRightImage.dispose(); + arrowRightImage = rightTemp; + } catch (IllegalArgumentException e) { + } catch (SWTException e) { + } } left.setImage(arrowLeftImage); right.setImage(arrowRightImage); |