This commit is contained in:
Eyck Jentzsch 2020-03-24 06:43:10 +00:00
parent 767b083a22
commit f1d080983a
2 changed files with 30 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@ -74,11 +75,15 @@ class ToolTipHandler {
if (tip != null && !tip.isDisposed ()) tip.dispose ();
tip = new Shell (parentShell, SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
tip.setBackground (display.getSystemColor (SWT.COLOR_INFO_BACKGROUND));
RowLayout layout=new RowLayout(SWT.VERTICAL);
layout.fill=true;
GridLayout layout = new GridLayout(1, true);
layout.verticalSpacing=0;
layout.horizontalSpacing=0;
layout.marginWidth = 0;
layout.marginHeight = 0;
tip.setLayout(layout);
boolean visible = provider.createContent(tip, pt);
tip.pack();
tip.setSize(tip.computeSize(SWT.DEFAULT, SWT.DEFAULT));
setHoverLocation(tip, tipPosition);
tip.setVisible (visible);
if(visible)

View File

@ -75,6 +75,7 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@ -403,18 +404,26 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
final Font font = new Font(Display.getCurrent(), "Terminal", 10, SWT.NORMAL);
final Label label = new Label(parent, SWT.NONE);
label.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
label.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
// label.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
// label.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
label.setText(tx.toString());
label.setFont(font);
GridData labelGridData = new GridData();
labelGridData.horizontalAlignment = GridData.FILL;
labelGridData.grabExcessHorizontalSpace = true;
label.setLayoutData(labelGridData);
final Table table = new Table(parent, SWT.NONE);
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setFont(font);
table.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
table.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
// table.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
// table.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
table.setRedraw(false);
GridData tableGridData = new GridData();
tableGridData.horizontalAlignment = GridData.FILL;
tableGridData.grabExcessHorizontalSpace = true;
table.setLayoutData(tableGridData);
final TableColumn nameCol = new TableColumn(table, SWT.LEFT);
nameCol.setText("Attribute");
@ -432,8 +441,12 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
item.setText(0, iTxAttribute.getName());
item.setText(1, value);
}
TableItem item = new TableItem(table, SWT.NONE);
item.setText(0, "");
item.setText(1, "");
nameCol.pack();
valueCol.pack();
table.pack();
table.setRedraw(true);
parent.addPaintListener(new PaintListener() {
@ -453,10 +466,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
final Font font = new Font(Display.getCurrent(), "Terminal", 10, SWT.NORMAL);
final Label label = new Label(parent, SWT.NONE);
label.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
label.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
//label.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
//label.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
label.setText(te.waveform.getFullName());
label.setFont(font);
GridData labelGridData = new GridData();
labelGridData.horizontalAlignment = GridData.FILL;
labelGridData.grabExcessHorizontalSpace = true;
label.setLayoutData(labelGridData);
return true;
}
return false;