# HG changeset patch # User dadubrow # Date 1281967403 18000 # Node ID 3319dd95321275432a3bdf14108732404cb4b3be # Parent 1349793e6b11ae3b96ab0702ced443666bb57b4e UI tweaks diff -r 1349793e6b11 -r 3319dd953212 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/RoundedCornerComposite.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/RoundedCornerComposite.java Fri Aug 13 15:37:14 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/RoundedCornerComposite.java Mon Aug 16 09:03:23 2010 -0500 @@ -22,6 +22,7 @@ class RoundedCornerComposite extends SharedBackgroundComposite { + private static final int ARC = 9; private final Color background; private final Color outline; @@ -36,11 +37,11 @@ super.drawBackground(gc, x, y, width, height); if (background != null) { gc.setBackground(background); - gc.fillRoundRectangle(0, 0, width, height, 6, 6); + gc.fillRoundRectangle(0, 0, width, height, ARC, ARC); } if (outline != null) { gc.setForeground(outline); - gc.drawRoundRectangle(0, 0, width - 1, height - 1, 6, 6); + gc.drawRoundRectangle(0, 0, width - 1, height - 1, ARC, ARC); } } } diff -r 1349793e6b11 -r 3319dd953212 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Fri Aug 13 15:37:14 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Mon Aug 16 09:03:23 2010 -0500 @@ -64,7 +64,7 @@ parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); createTitle(actionBar); createActions(actionBar); - RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(10, 10).extendedMargins(5, 5, 5, 10).fill(true).wrap(false).applyTo(this); + RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(5, 5).extendedMargins(7, 7, 7, 7).fill(true).wrap(false).applyTo(this); } private void createTitle(IActionBar actionBar) { diff -r 1349793e6b11 -r 3319dd953212 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Fri Aug 13 15:37:14 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Mon Aug 16 09:03:23 2010 -0500 @@ -167,8 +167,9 @@ public void run() { URL url = getURL(); if (url != null) { - browser.setUrl(url.toString()); - actionBar.setLoading(true); + if (!browser.setUrl(url.toString())) { + browser.redraw(); + } } actionBar.hookBrowser(); actionBar.update(); diff -r 1349793e6b11 -r 3319dd953212 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java Fri Aug 13 15:37:14 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java Mon Aug 16 09:03:23 2010 -0500 @@ -26,8 +26,13 @@ import java.util.Set; import java.util.regex.Pattern; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; +import org.eclipse.swt.widgets.Display; import com.nokia.carbide.discovery.ui.Activator; import com.nokia.carbide.discovery.ui.Messages; @@ -109,14 +114,24 @@ } protected void readRSS() { - URL url = getURL(); + final URL url = getURL(); if (url != null) { - try { - rss = SimpleRSSReader.readRSS(url); - displayRSS(); - } catch (Exception e) { - Activator.logError(MessageFormat.format(Messages.AbstractRSSPortalPageLayer_RSSReadError, url), e); - } + Job j = new Job("Getting RSS feed") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + rss = SimpleRSSReader.readRSS(url); + displayRSS(); + } catch (Exception e) { + Activator.logError(MessageFormat.format(Messages.AbstractRSSPortalPageLayer_RSSReadError, url), e); + } + return Status.OK_STATUS; + } + + }; + j.setUser(true); + j.schedule(); } } @@ -152,7 +167,13 @@ buf.append(""); //$NON-NLS-1$ } buf.append(HTML_BODY_FOOTER); - browser.setText(buf.toString()); + final String s = buf.toString(); + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + browser.setText(s); + } + }); } private String clean(String s) {