Skip to content

Commit

Permalink
Removes custom fonts from all the places they have been used
Browse files Browse the repository at this point in the history
Goal is to promote a more bottom-up approach (adding styles only where
it is necessary, relying on the system defaults for the reamining
parts), and to use CSS theming/styling more extensively.
  • Loading branch information
AlexisDrogoul committed Jul 16, 2021
1 parent ee81d08 commit 7a2d5b6
Show file tree
Hide file tree
Showing 14 changed files with 268 additions and 383 deletions.
Expand Up @@ -6,7 +6,7 @@
* (c) 2007-2020 UMI 209 UMMISCO IRD/UPMC & Partners
*
* Visit https://github.com/gama-platform/gama for license information and developers contact.
*
*
*
**********************************************************************************************/
package ummisco.gama.ui.views;
Expand Down Expand Up @@ -38,7 +38,6 @@
import ummisco.gama.ui.controls.ParameterExpandItem;
import ummisco.gama.ui.resources.GamaColors;
import ummisco.gama.ui.resources.GamaColors.GamaUIColor;
import ummisco.gama.ui.resources.GamaFonts;
import ummisco.gama.ui.utils.PreferencesHelper;
import ummisco.gama.ui.utils.WebHelper;
import ummisco.gama.ui.utils.WorkbenchHelper;
Expand Down Expand Up @@ -73,7 +72,7 @@ public void ownCreatePartControl(final Composite view) {}
protected ParameterExpandItem createItem(final Composite parent, final GamaRuntimeException data,
final boolean expanded, final GamaUIColor color) {
createViewer(parent);
if (getViewer() == null) { return null; }
if (getViewer() == null) return null;
final ScrolledComposite control = createItemContentsFor(data);
ParameterExpandItem item;
if (expanded) {
Expand All @@ -98,7 +97,7 @@ protected ScrolledComposite createItemContentsFor(final GamaRuntimeException exc

private void createStackTrace(final ScrolledComposite compo, final GamaRuntimeException exception) {
final Table t = new Table(compo, SWT.H_SCROLL);
t.setFont(GamaFonts.getExpandfont());
// t.setFont(GamaFonts.getExpandfont());

t.addSelectionListener(new SelectionListener() {

Expand Down Expand Up @@ -154,11 +153,9 @@ public void resumeItem(final GamaRuntimeException obj) {}
public String getItemDisplayName(final GamaRuntimeException obj, final String previousName) {
final StringBuilder sb = new StringBuilder(300);
final String a = obj.getAgentSummary();
if (a != null) {
sb.append(a).append(" at ");
}
if (a != null) { sb.append(a).append(" at "); }
sb.append("cycle ").append(obj.getCycle()).append(ItemList.SEPARATION_CODE)
.append(obj.isWarning() ? ItemList.WARNING_CODE : ItemList.ERROR_CODE).append(obj.getMessage());
.append(obj.isWarning() ? ItemList.WARNING_CODE : ItemList.ERROR_CODE).append(obj.getMessage());
return sb.toString();
}

Expand All @@ -172,15 +169,13 @@ public List<GamaRuntimeException> getItems() {
final List<GamaRuntimeException> errors = new ArrayList<>();
final List<GamaRuntimeException> exceptions = getExceptionHandler().getCleanExceptions();
final int size = exceptions.size();
if (size == 0) { return errors; }
if (size == 0) return errors;
final int end = size;
int begin = end - numberOfDisplayedErrors;
begin = begin < 0 ? 0 : begin;
final List<GamaRuntimeException> except = new ArrayList<>(exceptions);
errors.addAll(except.subList(begin, end));
if (mostRecentFirst) {
Collections.reverse(errors);
}
if (mostRecentFirst) { Collections.reverse(errors); }
return errors;
}

Expand All @@ -201,7 +196,7 @@ public void reset() {

/**
* Method handleMenu()
*
*
* @see msi.gama.common.interfaces.ItemList#handleMenu(java.lang.Object)
*/
@Override
Expand All @@ -216,7 +211,7 @@ public Map<String, Runnable> handleMenu(final GamaRuntimeException item, final i
}

private void reportError(final GamaRuntimeException item) {
// final String data = item.getAllText();
// final String data = item.getAllText();
WebHelper.openPage("https://github.com/gama-platform/gama/issues/new");
}

Expand Down
Expand Up @@ -44,7 +44,6 @@
import ummisco.gama.ui.experiment.parameters.AgentAttributesEditorsList;
import ummisco.gama.ui.menus.AgentsMenu;
import ummisco.gama.ui.resources.GamaColors.GamaUIColor;
import ummisco.gama.ui.resources.GamaFonts;
import ummisco.gama.ui.resources.IGamaColors;
import ummisco.gama.ui.views.toolbar.IToolbarDecoratedView;

Expand Down Expand Up @@ -111,7 +110,7 @@ public Label createLeftLabel(final Composite parent, final String title, final S
d.minimumWidth = 70;
d.horizontalIndent = isSubParameter ? 30 : 0;
label.setLayoutData(d);
label.setFont(GamaFonts.getLabelfont());
// label.setFont(GamaFonts.getLabelfont());
label.setText(title);
label.setToolTipText(tooltip);
return label;
Expand All @@ -121,7 +120,7 @@ public Label createLeftLabel(final Composite parent, final String title, final S
protected Composite createItemContentsFor(final IAgent agent) {
final Composite attributes = super.createItemContentsFor(agent);
final Label l = createLeftLabel(attributes, "Actions", "", false);
l.setFont(GamaFonts.getExpandfont());
// l.setFont(GamaFonts.getExpandfont());
final Composite composite = new Composite(attributes, SWT.NONE);
composite.setBackground(attributes.getBackground());
final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
Expand Down

0 comments on commit 7a2d5b6

Please sign in to comment.