Open NicoPrediger opened 5 years ago
wonder whats different on my machine.
@Hejado which underlying eclipse version did you choose?
It was 2019-03 configured
@Hejado can you provide the config log in the about dialog as file attached here
another machine. same behaviour => wonder which distro with which gtk version and theme is used on your machine
@kthoms @Hejado did you choose "latest" as xtext version?
Yes, xtext version was "latest".
GTK 2 and 3 are installed, but should be GTK 3, config.log is attached. config.log
i dont see any chance to analyze this => you need to find out which swt styles are used for foreground and background
on my first machine there is
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=Clearlooks-Phenix
org.eclipse.swt.internal.gtk.version=3.22.10
and on the second
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=Mint-Y
org.eclipse.swt.internal.gtk.version=3.22.30
thus i wonder if that is specific to adwaita and if other eclipse views are affected as well. (might even be a platform bug)
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=Adwaita
org.eclipse.swt.internal.gtk.version=3.24.8
which background does e.g. the javadoc view have?
=> would be interesting to evalute COLOR_INFO_BACKGROUND COLOR_INFO_FOREGROUND and why they both are black
Other views have a white background.
hmmm i wonder which others use
xxxx.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); xxxx.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
and why both are black (should be seeable in debugger) and would be a platform bug imho cc @kthoms
Could be a platform bug of course. @Hejado is the issue reproducible when you oomph a second Xtext dev workspace?
I assume this can be reproduced with a hello world view using the two colors mentioned above
@Hejado
how does this simple swt app look on your machine
package org.eclipse.xtext.xbase.ui.hover;
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
public class LayoutExample {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
// Create the layout.
RowLayout layout = new RowLayout();
// Optionally set layout fields.
layout.wrap = true;
// Set the layout into the composite.
shell.setLayout(layout);
// Create the children of the composite.
Composite button1 = new Composite(shell, SWT.NONE);
Composite button2 = new Composite(shell, SWT.NONE);
button1.setBackground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
button2.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
@cdietrich
@kthoms Will oomph a new workspace now, report later.
hmmm i wonder why the background is black. we dont use information color foreground for the font
<fontDefinition
label="%xtendEditorFontDefiniton.label"
defaultsTo="org.eclipse.jface.textfont"
categoryId="org.eclipse.xtend.ui.presentation"
id="org.eclipse.xtend.ui.editors.textfont">
maybe that is the problem
=> i assume we have to define and use foreground color as well. you should be ablte to do this in your workspace and then run a runtime ws to test the fix
=> which os do you use?
Fedora 30
hmmm. i dont have that one on any of my machines. => i assume you and karsten should somewhen sit together and have a look at
org.eclipse.xtext.ui.views.AbstractSourceView.inititalizeColors() org.eclipse.xtend.ide.view.DerivedSourceView.inititalizeColors()
and see if we have to deal with the foreground color differently
the
textWidget.setForeground(
getColorFromStore(store,
AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT,
SWT.COLOR_WIDGET_FOREGROUND,
AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND));
textWidget.setBackground(
getColorFromStore(store,
AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT,
SWT.COLOR_INFO_BACKGROUND,
AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND));
looks bogus to me.
SWT.COLOR_WIDGET_FOREGROUND,
maybe that is a typo and should be
SWT.COLOR_INFO_FOREGROUND,
does not help problem can be reproduced by setting GTK_THEME=Adwaita in environment tab
@szarnekow can you have a look at my change. do you have a better idea? why do we change colors and fonts at all?
=> wont it be better to let jdt do all the work?
AbstractSourceView does similar strange things
still behaves bad.
bad behaviour can also be seen on mac switching from dark to light and back
Steps to reproduce: