diff options
author | Andrew Johnson | 2020-10-04 09:51:12 +0000 |
---|---|---|
committer | Andrew Johnson | 2020-10-04 10:01:41 +0000 |
commit | c33b21b029691792cfdd16c449a64226208e1608 (patch) | |
tree | 13b7f5b4314ef4e61d598814867af65360100654 | |
parent | afc2b7d5e4b6784f526c86950dfea2a35b1cf834 (diff) | |
download | org.eclipse.mat-c33b21b029691792cfdd16c449a64226208e1608.tar.gz org.eclipse.mat-c33b21b029691792cfdd16c449a64226208e1608.tar.xz org.eclipse.mat-c33b21b029691792cfdd16c449a64226208e1608.zip |
567533: Reports have a white background with dark theme
Only IE browser needs forced dark mode
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=567533
Change-Id: I9dc5fb0ddfd7331852d3440109dff6c647b32b20
3 files changed, 33 insertions, 12 deletions
diff --git a/plugins/org.eclipse.mat.report/META-INF/html/styles-dark.css b/plugins/org.eclipse.mat.report/META-INF/html/styles-dark.css index f9ac1f71..7f3d98a9 100644 --- a/plugins/org.eclipse.mat.report/META-INF/html/styles-dark.css +++ b/plugins/org.eclipse.mat.report/META-INF/html/styles-dark.css @@ -16,10 +16,16 @@ body { font-size: 10pt;
font-family: verdana, arial, helvetica, sans-serif;
}
+:root {
+ --dark-color: white;
+ --dark-background: #101010;
+}
@media screen {
body {
background: #101010;
+ background: var(--dark-background);
color: white;
+ color: var(--dark-color)
}
}
@@ -111,6 +117,7 @@ img { .important {
background-color: #c27f20;
border: 1px dotted white;
+ border: 1px dotted var(--dark-color);
}
}
@@ -146,7 +153,7 @@ img { /* For the tree icons */
/* flips white and black, but keeps hues */
/* 94% means white goes to near black matching background */
- .line {
+ img.line {
filter: invert(94%) hue-rotate(180deg);
}
}
@@ -160,6 +167,7 @@ img { @media screen {
.evenrow {
background-color: #101010;
+ background-color: var(--dark-background);
}
.oddrow {
background-color: #181818;
@@ -177,6 +185,7 @@ img { .result tbody tr.selected td {
background-color: #4d90ef;
color: #101010;
+ color: var(--dark-background);
border-left: 1px solid #8DBAFA;
border-bottom: 1px solid #447DCE;
}
@@ -188,17 +197,19 @@ img { @media screen {
.result tbody tr.selected td a {
color: #101010;
+ color: var(--dark-background);
}
}
.result tbody tr.selected td a:focus {
- outline-style: dotted;
- outline-width: 1px;
- outline-color: #ffffff
+ outline-style: dotted;
+ outline-width: 1px;
+ outline-color: #ffffff
}
@media screen {
.result tbody tr.selected td a:focus {
- outline-color: #101010;
+ outline-color: #101010;
+ outline-color: var(--dark-background);
}
}
diff --git a/plugins/org.eclipse.mat.report/META-INF/html/styles.css b/plugins/org.eclipse.mat.report/META-INF/html/styles.css index 0c8249e6..68bd8bca 100644 --- a/plugins/org.eclipse.mat.report/META-INF/html/styles.css +++ b/plugins/org.eclipse.mat.report/META-INF/html/styles.css @@ -16,10 +16,16 @@ body { font-size: 10pt;
font-family: verdana, arial, helvetica, sans-serif;
}
+:root {
+ --dark-color: white;
+ --dark-background: #101010;
+}
@media screen and (prefers-color-scheme: dark) {
body {
background: #101010;
+ background: var(--dark-background);
color: white;
+ color: var(--dark-color)
}
}
@@ -111,6 +117,7 @@ img { .important {
background-color: #c27f20;
border: 1px dotted white;
+ border: 1px dotted var(--dark-color);
}
}
@@ -160,6 +167,7 @@ img { @media screen and (prefers-color-scheme: dark) {
.evenrow {
background-color: #101010;
+ background-color: var(--dark-background);
}
.oddrow {
background-color: #181818;
@@ -177,6 +185,7 @@ img { .result tbody tr.selected td {
background-color: #4d90ef;
color: #101010;
+ color: var(--dark-background);
border-left: 1px solid #8DBAFA;
border-bottom: 1px solid #447DCE;
}
@@ -188,17 +197,19 @@ img { @media screen and (prefers-color-scheme: dark) {
.result tbody tr.selected td a {
color: #101010;
+ color: var(--dark-background);
}
}
.result tbody tr.selected td a:focus {
- outline-style: dotted;
- outline-width: 1px;
- outline-color: #ffffff
+ outline-style: dotted;
+ outline-width: 1px;
+ outline-color: #ffffff
}
@media screen and (prefers-color-scheme: dark) {
.result tbody tr.selected td a:focus {
- outline-color: #101010;
+ outline-color: #101010;
+ outline-color: var(--dark-background);
}
}
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/panes/QueryTextResultPane.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/panes/QueryTextResultPane.java index 911ce4a1..65515f59 100644 --- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/panes/QueryTextResultPane.java +++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/panes/QueryTextResultPane.java @@ -14,7 +14,6 @@ package org.eclipse.mat.ui.internal.panes; import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
-import java.nio.file.CopyOption;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
@@ -196,8 +195,8 @@ public class QueryTextResultPane extends AbstractEditorPane implements ISelectio DisplayFileResult r = (DisplayFileResult) queryResult.getSubject();
if (browser != null)
{
- // Current Eclipse browser doesn't handle @media prefers-color-scheme
- if (darkMode())
+ // Current Eclipse IE browser doesn't handle @media prefers-color-scheme
+ if (browser.getBrowserType().equals("ie") && darkMode()) //$NON-NLS-1$
{
File p = r.getFile().getParentFile();
File styles = new File(p, "styles.css"); //$NON-NLS-1$
|