Skip to content

Commit

Permalink
Restored tooltips and tab focus fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Mar 26, 2024
1 parent da4bcfd commit fec2cda
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/spin-tools/src/com/maccasoft/propeller/EditorTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ private EditorTab(CTabFolder folder, File file, String name, SourcePool sourcePo
tabItem = new CTabItem(folder, SWT.NONE);
tabItem.setShowClose(true);
tabItem.setText(tabItemText);
if (file != null) {
tabItem.setToolTipText(file.getAbsolutePath());
}
tabItem.setData(this);

FontData[] fontData = tabItem.getFont().getFontData();
Expand Down Expand Up @@ -753,6 +756,9 @@ public void setFile(File file) {
File localFile = this.file != null ? this.file : new File(tabItemText).getAbsoluteFile();
sourcePool.removeParsedSource(localFile);

if (file != null) {
tabItem.setToolTipText(file.getAbsolutePath());
}
this.file = file;

if (tabItemText.toLowerCase().endsWith(".spin")) {
Expand Down
13 changes: 13 additions & 0 deletions modules/spin-tools/src/com/maccasoft/propeller/SpinTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.events.MouseAdapter;
Expand Down Expand Up @@ -458,6 +460,17 @@ public void selectionChanged(SelectionChangedEvent event) {
});
fileBrowser.addOpenListener(openListener);

tabFolder.addFocusListener(new FocusAdapter() {

@Override
public void focusGained(FocusEvent event) {
CTabItem tabItem = tabFolder.getSelection();
if (tabItem != null) {
EditorTab editorTab = (EditorTab) tabItem.getData();
editorTab.setFocus();
}
}
});
tabFolder.addTraverseListener(new TraverseListener() {

@Override
Expand Down

0 comments on commit fec2cda

Please sign in to comment.