Skip to content

Commit

Permalink
Fixed tab color on MacOS (foreground)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juicestus authored and TheThirdOne committed Sep 25, 2021
1 parent 05111b3 commit cacf017
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/rars/venus/MainPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,24 @@ public MainPane(VenusUI appFrame, Editor editor, RegistersWindow regs,
FloatingPointWindow cop1Regs, ControlAndStatusWindow cop0Regs) {
super();
this.mainUI = appFrame;

this.setTabPlacement(JTabbedPane.TOP); //LEFT);
if (this.getUI() instanceof BasicTabbedPaneUI) {
BasicTabbedPaneUI ui = (BasicTabbedPaneUI) this.getUI();
}
editTabbedPane = new EditTabbedPane(appFrame, editor, this);
executeTab = new ExecutePane(appFrame, regs, cop1Regs, cop0Regs);
//String editTabTitle = "Edit";
String editTabTitle = "<html><center><p>Edit</p></center></html>";
//"<html><center>&nbsp;<br>E<br>d<br>i<br>t<br>&nbsp;</center></html>";
//String executeTabTitle = "Execute"; //"<html><center>&nbsp;<br>E<br>x<br>e<br>c<br>u<br>t<br>e<br>&nbsp;</center></html>";
String executeTabTitle = "<html><center><p>Execute</p></center></html>";
String editTabTitle = "Edit";
//String editTabTitle = "<html><center><p>Edit</p></center></html>";
//"<html><center>&nbsp;<br>E<br>d<br>i<br>t<br>&nbsp;</center></html>";
String executeTabTitle = "Execute"; //"<html><center>&nbsp;<br>E<br>x<br>e<br>c<br>u<br>t<br>e<br>&nbsp;</center></html>";
//String executeTabTitle = "<html><center><p>Execute</p></center></html>";
Icon editTabIcon = null;//new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Globals.imagesPath+"Edit_tab.jpg")));
Icon executeTabIcon = null;//new ImageIcon(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Globals.imagesPath+"Execute_tab.jpg")));

this.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
this.addTab(editTabTitle, editTabIcon, editTabbedPane);
this.setForeground(Color.black);

// this.addTab("<html><center>&nbsp;<br>P<br>r<br>o<br>j<br>&nbsp;<br>1<br&nbsp;</center></html>", null, new JTabbedPane());
// this.addTab("<html><center>&nbsp;<br>P<br>r<br>o<br>j<br>&nbsp;<br>2<br&nbsp;</center></html>", null, new JTabbedPane());
Expand Down
8 changes: 8 additions & 0 deletions src/rars/venus/MessagesPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,16 @@ public void actionPerformed(ActionEvent e) {
runTab.add(createBoxForButton(runTabClearButton), BorderLayout.WEST);
runTab.add(new JScrollPane(run, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);

/* Bad HTML fix
this.addTab("<html><center><p>Messages</p></center></html>", assembleTab);
this.addTab("<html><center><p>Run I/O</p></center></html>", runTab);
*/

this.addTab("Messages", assembleTab);
this.addTab("Run I/O", runTab);
this.setForeground(Color.BLACK);

this.setToolTipTextAt(0, "Messages produced by Run menu. Click on assemble error message to select erroneous line");
this.setToolTipTextAt(1, "Simulated console input and output");
}
Expand Down
2 changes: 2 additions & 0 deletions src/rars/venus/VenusUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ public VenusUI(String s) {
mainPane = new MainPane(mainUI, editor, registersTab, fpTab, csrTab);
//UIManager.put("TabbedPane.tabInsets", defaultTabInsets);



mainPane.setPreferredSize(mainPanePreferredSize);
messagesPane = new MessagesPane();
messagesPane.setPreferredSize(messagesPanePreferredSize);
Expand Down
12 changes: 12 additions & 0 deletions src/rars/venus/registers/RegistersPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import rars.venus.VenusUI;

import javax.swing.*;
import java.awt.Color;

/*
Copyright (c) 2003-2006, Pete Sanderson and Kenneth Vollmar
Expand Down Expand Up @@ -54,15 +55,26 @@ public RegistersPane(VenusUI appFrame, RegistersWindow regs, FloatingPointWindow
ControlAndStatusWindow cop0) {
super();
this.mainUI = appFrame;

regsTab = regs;
fpTab = cop1;
csrTab = cop0;
regsTab.setVisible(true);
fpTab.setVisible(true);
csrTab.setVisible(true);

/* Bad HTML Fix
this.addTab("<html><center><p>Registers</p></center></html>", regsTab);
this.addTab("<html><center><p>Floating Point</p></center></html>", fpTab);
this.addTab("<html><center><p>Control and Status</p></center></html>", csrTab);
*/

// Good code fix
this.addTab("Registers", regsTab);
this.addTab("Floating Point", fpTab);
this.addTab("Control and Status", csrTab);
this.setForeground(Color.black);

this.setToolTipTextAt(0, "CPU registers");
this.setToolTipTextAt(1, "Floating point unit registers");
this.setToolTipTextAt(2, "Control and Status registers");
Expand Down

0 comments on commit cacf017

Please sign in to comment.