Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2015-05-05 18:51:09 +0000
committerLars Vogel2015-05-06 05:35:08 +0000
commit4247f7ff11b48b557322bfd51f476e838fe9553b (patch)
tree5e3371046fe970e24cbe5d10b262f580c8f6ce7f
parent6448848ce4aaffc0f3d4cc6d240f4478eef33ca0 (diff)
downloadegit-4247f7ff11b48b557322bfd51f476e838fe9553b.tar.gz
egit-4247f7ff11b48b557322bfd51f476e838fe9553b.tar.xz
egit-4247f7ff11b48b557322bfd51f476e838fe9553b.zip
Properly style PushResultDialog in dark theme
Convert anonymous inner class SpellcheckableMessageAreaExtension to static inner class to have a better CSS selector for it and add styling for the newly created selector. Bug: 466486 Change-Id: I6a106d63ef8201ba38d9cccbd3efe4c6646bd77b Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css9
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java11
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java25
3 files changed, 35 insertions, 10 deletions
diff --git a/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css b/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
index ecbee3632d..3d21bc5165 100644
--- a/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
+++ b/org.eclipse.egit.ui/css/e4-dark_egit_prefstyle.css
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014 Andrea Guarinoni and others.
+ * Copyright (c) 2014, 2015 Andrea Guarinoni 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
@@ -8,6 +8,7 @@
* Contributors:
* Andrea Guarinoni - initial API and implementation
* Fabio Zadrozny - Bug 465672 - EGit staging view and commit page are not properly styled
+ * Lars Vogel <Lars.Vogel@vogella.com> - Bug 466486
*******************************************************************************/
/* ############################## EGIT preferences ############################## */
@@ -35,3 +36,9 @@ Form Section LayoutComposite StyledText
background-color: #313538;
color: #dddddd;
}
+
+PushResultTable-SpellcheckableMessageAreaExtension StyledText {
+ background-color: #313538;
+ color: #dddddd;
+}
+
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
index 975f0313d4..b2db3b0053 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
@@ -76,6 +76,7 @@ import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -1024,6 +1025,16 @@ public class SpellcheckableMessageArea extends Composite {
}
/**
+ * Set the same background color to the styledText widget as the Composite
+ */
+ @Override
+ public void setBackground(Color color) {
+ super.setBackground(color);
+ StyledText textWidget = getTextWidget();
+ textWidget.setBackground(color);
+ }
+
+ /**
*
*/
@Override
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java
index 4b5ece3851..e85b6307e7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushResultTable.java
@@ -58,6 +58,20 @@ import org.eclipse.ui.model.IWorkbenchAdapter3;
* Table displaying push operation results.
*/
class PushResultTable {
+
+ private final static class SpellcheckableMessageAreaExtension
+ extends SpellcheckableMessageArea {
+ private SpellcheckableMessageAreaExtension(Composite parent,
+ String initialText, boolean readOnly, int styles) {
+ super(parent, initialText, readOnly, styles);
+ }
+
+ @Override
+ protected void createMarginPainter() {
+ // Disabled intentionally
+ }
+ }
+
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
@@ -191,15 +205,8 @@ class PushResultTable {
GridDataFactory.fillDefaults().grab(true, false).span(2, 1)
.applyTo(messageGroup);
- final SpellcheckableMessageArea text = new SpellcheckableMessageArea(
- messageGroup, EMPTY_STRING, true, SWT.BORDER) {
-
- @Override
- protected void createMarginPainter() {
- // Disabled intentionally
- }
-
- };
+ final SpellcheckableMessageArea text = new SpellcheckableMessageAreaExtension(messageGroup, EMPTY_STRING, true,
+ SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, true).applyTo(text);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override

Back to the top