Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2017-04-06 15:05:50 +0000
committerIvan Furnadjiev2017-04-06 15:10:11 +0000
commitf971da8620dc9a93cbd4668930e4de9dfe565d3c (patch)
treecb6ddde2685857bb03dacb88eaf55fb84d8ae475
parentdcebb82cca0c0e24274c8066876e5a65814184e4 (diff)
downloadorg.eclipse.rap-f971da8620dc9a93cbd4668930e4de9dfe565d3c.tar.gz
org.eclipse.rap-f971da8620dc9a93cbd4668930e4de9dfe565d3c.tar.xz
org.eclipse.rap-f971da8620dc9a93cbd4668930e4de9dfe565d3c.zip
Fix CTabFolder top-right control layout
RAP is using very old implementation of the server-side CTabFolder control. In order to be used in e4, the widget was completely rewriten by the SWT team. To avoid some layouting problems of the top-right CTabFolder control, add missing redraw call to recalculate it's bounds. Increase CTabItem top/bottom padding a little in default theme to avoid the top-right control cut-off. 435499: CTabFolder#setTopRight does not layout appropriately when modified https://bugs.eclipse.org/bugs/show_bug.cgi?id=435499 512943: [e4] Rendering of toolbar broken after switching parts https://bugs.eclipse.org/bugs/show_bug.cgi?id=512943 Change-Id: I38c99d6bc7027bcf95279f19888981af6bd0d197
-rw-r--r--bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css4
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/custom/CTabFolder.java8
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/custom/ICTabFolderAdapter.java5
-rw-r--r--bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/custom/ctabfolderkit/CTabFolderLCA.java9
-rw-r--r--tests/org.eclipse.rap.rwt.themes.test/src/org/eclipse/rap/rwt/themes/test/rwtdefault/CTabFolder.test.css4
5 files changed, 23 insertions, 7 deletions
diff --git a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
index 4c869de57c..c358325759 100644
--- a/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
+++ b/bundles/org.eclipse.rap.rwt/resources/resource/theme/default.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2016 EclipseSource and others.
+ * Copyright (c) 2012, 2017 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -472,7 +472,7 @@ CTabItem {
color: #4a4a4a;
background-color: transparent;
background-image: none;
- padding: 6px 15px;
+ padding: 8px 15px;
spacing: 10px;
text-shadow: none;
text-decoration: none;
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/custom/CTabFolder.java
index 19cb5d2953..02dd1d9e0b 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/custom/CTabFolder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1611,6 +1611,7 @@ public class CTabFolder extends Composite {
// pt = toControl(pt);
// _setToolTipText(pt.x, pt.y);
// }
+ redraw();
return changed;
}
@@ -2478,6 +2479,11 @@ CTabItem[] items = itemHolder.getItems();
return selectionGraphicsAdapter;
}
+ @Override
+ public void doRedraw() {
+ setButtonBounds();
+ }
+
}
}
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/custom/ICTabFolderAdapter.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/custom/ICTabFolderAdapter.java
index 043da1f476..406e555fb3 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/custom/ICTabFolderAdapter.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/custom/ICTabFolderAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2012 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,4 +41,7 @@ public interface ICTabFolderAdapter {
// TODO [rst] This method should either return a suitable data structure or it
// should be replaced by separate methods for colors and percents.
public IWidgetGraphicsAdapter getUserSelectionBackgroundGradient();
+
+ void doRedraw();
+
}
diff --git a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/custom/ctabfolderkit/CTabFolderLCA.java b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/custom/ctabfolderkit/CTabFolderLCA.java
index 37cabc548a..bf49508e19 100644
--- a/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/custom/ctabfolderkit/CTabFolderLCA.java
+++ b/bundles/org.eclipse.rap.rwt/widgetkits/org/eclipse/swt/internal/custom/ctabfolderkit/CTabFolderLCA.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.custom.ICTabFolderAdapter;
import org.eclipse.swt.internal.widgets.IWidgetGraphicsAdapter;
+import org.eclipse.swt.widgets.Control;
public final class CTabFolderLCA extends WidgetLCA<CTabFolder> {
@@ -150,6 +151,12 @@ public final class CTabFolderLCA extends WidgetLCA<CTabFolder> {
renderListenDefaultSelection( folder );
}
+ @Override
+ public void doRedrawFake( Control control ) {
+ CTabFolder folder = ( CTabFolder )control;
+ getCTabFolderAdapter( folder ).doRedraw();
+ }
+
/////////////////////////////////////////
// Helping methods to preserve properties
diff --git a/tests/org.eclipse.rap.rwt.themes.test/src/org/eclipse/rap/rwt/themes/test/rwtdefault/CTabFolder.test.css b/tests/org.eclipse.rap.rwt.themes.test/src/org/eclipse/rap/rwt/themes/test/rwtdefault/CTabFolder.test.css
index 5b0e4b655e..5f0c7fb1b0 100644
--- a/tests/org.eclipse.rap.rwt.themes.test/src/org/eclipse/rap/rwt/themes/test/rwtdefault/CTabFolder.test.css
+++ b/tests/org.eclipse.rap.rwt.themes.test/src/org/eclipse/rap/rwt/themes/test/rwtdefault/CTabFolder.test.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 EclipseSource and others.
+ * Copyright (c) 2010, 2017 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,7 +21,7 @@ CTabItem {
color: #4a4a4a;
background-color: transparent;
background-image: none;
- padding: 6px 15px;
+ padding: 8px 15px;
spacing: 10px;
text-shadow: none;
text-decoration: none;

Back to the top