active panel indicator moved

This commit is contained in:
Radek Davidek 2026-01-19 13:51:01 +01:00
parent 0ac0f0a8c7
commit 357aea509a
2 changed files with 19 additions and 11 deletions

View File

@ -499,6 +499,22 @@ public class FilePanel extends JPanel {
updateTabStyles();
}
/**
* Set the active state of this panel to show/hide the focus indicator strip.
* The indicator is placed between the drive dropdown and the tabs.
*/
public void setActive(boolean active, Color activeColor) {
// Inactive indicator is subtle dark gray
Color inactiveColor = new Color(60, 60, 60);
Color targetColor = active ? activeColor : inactiveColor;
// Apply a matte border to the top of tabbedPane - this places it between
// the topPanel (dropdown) and the tabs themselves.
tabbedPane.setBorder(BorderFactory.createMatteBorder(3, 0, 0, 0, targetColor));
revalidate();
repaint();
}
/**
* Updates tab style - highlights the active tab with bold font and color.
*/

View File

@ -960,17 +960,9 @@ public class MainWindow extends JFrame {
Color selColor = config.getSelectionColor();
if (selColor == null) selColor = new Color(184, 207, 229);
// Inactive indicator is more subtle (darker)
Color inactiveColor = new Color(60, 60, 60);
// We use a MatteBorder to create a "strip" only on the top edge
leftPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(3, 0, 0, 0, activePanel == leftPanel ? selColor : inactiveColor),
BorderFactory.createEmptyBorder(3, 5, 5, 5)));
rightPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(3, 0, 0, 0, activePanel == rightPanel ? selColor : inactiveColor),
BorderFactory.createEmptyBorder(3, 5, 5, 5)));
// Delegate active state visualization to the panels themselves
leftPanel.setActive(activePanel == leftPanel, selColor);
rightPanel.setActive(activePanel == rightPanel, selColor);
}
/**