Skip to content

Commit 4405565

Browse files
committed
enable "sort document list by project" by default.
this also fixes an inconsistency and renders the tab line on top when the setting is active (based on the UI property).
1 parent 4c7e626 commit 4405565

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

platform/core.multitabs/src/org/netbeans/core/multitabs/impl/TabDataRenderer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class TabDataRenderer implements TableCellRenderer {
5959
private static final Color inactiveUnderlineColor = UIManager.getColor("nb.multitabs.inactiveUnderlineColor"); // NOI18N
6060
private static final Color activeBackground = UIManager.getColor("nb.multitabs.activeBackground"); // NOI18N
6161
private static final Color hoverBackground = UIManager.getColor("nb.multitabs.hoverBackground"); // NOI18N
62+
private static final boolean underlineAtTop = UIManager.getBoolean("EditorTab.underlineAtTop");
6263

6364
private final RendererPanel renderer = new RendererPanel();
6465
private final List<TabDecorator> decorators = getDecorators();
@@ -238,10 +239,18 @@ public void paint( Graphics g ) {
238239
switch (tabsLocation) {
239240
default:
240241
case JTabbedPane.TOP:
241-
g.fillRect(0, rect.height - underlineHeight, rect.width, underlineHeight);
242+
if (underlineAtTop) {
243+
g.fillRect(0, 0, rect.width, underlineHeight);
244+
} else {
245+
g.fillRect(0, rect.height - underlineHeight, rect.width, underlineHeight);
246+
}
242247
break;
243248
case JTabbedPane.BOTTOM:
244-
g.fillRect(0, 0, rect.width, underlineHeight);
249+
if (underlineAtTop) {
250+
g.fillRect(0, rect.height - underlineHeight, rect.width, underlineHeight);
251+
} else {
252+
g.fillRect(0, 0, rect.width, underlineHeight);
253+
}
245254
break;
246255
case JTabbedPane.LEFT:
247256
g.fillRect(rect.width - underlineHeight, 0, underlineHeight, rect.height);

platform/core.multitabs/src/org/netbeans/core/multitabs/prefs/SettingsImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ boolean setSortDocumentListByProject( boolean sort ) {
105105
}
106106

107107
public boolean isSortDocumentListByProject() {
108-
return prefs.getBoolean( PROP_SORT_DOCUMENT_LIST_BY_PROJECT, false );
108+
return prefs.getBoolean( PROP_SORT_DOCUMENT_LIST_BY_PROJECT, true );
109109
}
110110

111111
public boolean isTabRowPerProject() {

0 commit comments

Comments
 (0)