Skip to content

Commit 6ebb32d

Browse files
committed
C++ std dropdown: position directly next to version label in Box layout
1 parent 78ab9ae commit 6ebb32d

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

mode/CppMode.jar

27 Bytes
Binary file not shown.

src/java/CppEditor.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,17 @@ public java.awt.Component getListCellRendererComponent(
109109
prefs.put(PREF_KEY, (String) stdCombo.getSelectedItem());
110110
});
111111

112-
JPanel wrapper = new JPanel(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 4, 0));
113-
wrapper.setOpaque(false);
114-
wrapper.add(stdCombo);
115-
112+
// Insert combo + small gap directly before the version label in the Box.
116113
int versionIdx = -1;
117114
for (int i = 0; i < tabBar.getComponentCount(); i++)
118115
if (tabBar.getComponent(i) == versionLabel) { versionIdx = i; break; }
119-
if (versionIdx >= 0) tabBar.add(wrapper, versionIdx);
120-
else tabBar.add(wrapper);
116+
if (versionIdx >= 0) {
117+
tabBar.add(javax.swing.Box.createHorizontalStrut(6), versionIdx);
118+
tabBar.add(stdCombo, versionIdx);
119+
tabBar.add(javax.swing.Box.createHorizontalStrut(4), versionIdx);
120+
} else {
121+
tabBar.add(stdCombo);
122+
}
121123
tabBar.revalidate();
122124
tabBar.repaint();
123125
}

0 commit comments

Comments
 (0)