Skip to content

Commit

Permalink
Default colors adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Jun 19, 2023
1 parent b194ed2 commit 92d6ddc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

import com.maccasoft.propeller.internal.ColorRegistry;

public class OutlineViewStack {

Composite container;
StackLayout layout;
Color foreground;
Color background;

Map<Control, OutlineView> map = new HashMap<>();

Expand All @@ -42,14 +46,19 @@ public void widgetDisposed(DisposeEvent e) {
public OutlineViewStack(Composite parent, int style) {
layout = new StackLayout();

background = ColorRegistry.getColor(ColorRegistry.LIST_BACKGROUND);
foreground = ColorRegistry.getColor(ColorRegistry.LIST_FOREGROUND);

container = new Composite(parent, style);
container.setLayout(layout);
container.setBackground(background);
container.setForeground(foreground);
}

public OutlineView createNew() {
OutlineView view = new OutlineView(container);
view.setForeground(container.getForeground());
view.setBackground(container.getBackground());
view.setForeground(foreground);
view.setBackground(background);
view.getControl().addDisposeListener(disposeListener);
map.put(view.getControl(), view);
return view;
Expand All @@ -76,13 +85,15 @@ public void setVisible(boolean visible) {
}

public void setBackground(Color color) {
background = color;
for (OutlineView view : map.values()) {
view.setBackground(color);
}
container.setBackground(color);
}

public void setForeground(Color color) {
foreground = color;
for (OutlineView view : map.values()) {
view.setForeground(color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ else if ("light".equals(id)) {

styleMap.put(TokenId.TYPE, new TextStyle(fontBold, new Color(0x12, 0x90, 0xC3), null));
styleMap.put(TokenId.KEYWORD, new TextStyle(fontBold, new Color(0x00, 0xA0, 0x00), null));
styleMap.put(TokenId.FUNCTION, new TextStyle(fontBold, new Color(0xA7, 0xEC, 0x21), null));
styleMap.put(TokenId.FUNCTION, new TextStyle(fontBold, new Color(0x00, 0xA0, 0x00), null));
styleMap.put(TokenId.OBJECT, new TextStyle(font, new Color(0x66, 0xE1, 0xF8), null));
styleMap.put(TokenId.VARIABLE, new TextStyle(font, new Color(0x66, 0xE1, 0xF8), null));

Expand Down

0 comments on commit 92d6ddc

Please sign in to comment.