Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite background color is not handled consistently between android / ios / browser #427

Open
evolanakis opened this issue Oct 16, 2015 · 4 comments
Labels

Comments

@evolanakis
Copy link
Member

evolanakis commented Oct 16, 2015

  • On Android a tree inherits the background color of the parent
  • On iOs it is initialized to the default color.

Expected: the code snippet below should have the same result on both platforms.

package app;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;

import com.eclipsesource.tabris.ui.AbstractPage;
import com.eclipsesource.tabris.ui.PageData;

@SuppressWarnings("serial")
public class TopLevelPage extends AbstractPage {

    private Text text;

    @Override
    public void createContent(final Composite parent, PageData data) {
        parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_RED));
        parent.setLayout(new FillLayout());

        Composite c = new Composite(parent, SWT.NONE); // also for Tree
    }

}
@mpost
Copy link
Member

mpost commented Oct 16, 2015

There is no background on tree on Android i think. It is transparent.

@evolanakis
Copy link
Member Author

But after tree.setBackground(...) it has a color on android.

My point is, it is not cross platform as currently implemented. It should be fairly trivial to make it consistent on both platforms.

@mpost
Copy link
Member

mpost commented Oct 16, 2015

That is true.

@evolanakis evolanakis changed the title Tree background color is not handled consistently between android / ios Composite background color is not handled consistently between android / ios Jul 20, 2017
@evolanakis evolanakis changed the title Composite background color is not handled consistently between android / ios Composite background color is not handled consistently between android / ios / browser Jul 20, 2017
@evolanakis
Copy link
Member Author

BTW: Saw this again today in another app. It happens for any Composite (snippet adjusted).

In a nutshell: if the background color of a composite is not set, there is a different result between iOs and Browser / Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants