ui: better layout in 'Project Libraries' configurable

* Remove duplicated border
* Remove gap for invisible bottom warning label

GitOrigin-RevId: 1635c95fbacf4f0dd8bc413ecf8e7b5c243713f5
This commit is contained in:
Aleksey Pivovarov
2022-06-30 09:51:58 +00:00
committed by intellij-monorepo-bot
parent 4eb336aaa9
commit b6e8770e45
2 changed files with 16 additions and 11 deletions
@@ -33,14 +33,14 @@
<border type="none"/>
<children/>
</grid>
<grid id="69aae" binding="myBottomPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<component id="6595d" class="javax.swing.JLabel" binding="myBottomLabel" custom-create="true">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
</form>
@@ -68,10 +68,10 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
private JPanel myTreePanel;
private MultiLineLabel myPropertiesLabel;
private JPanel myPropertiesPanel;
private JPanel myBottomPanel;
private JLabel myBottomLabel;
private LibraryPropertiesEditor myPropertiesEditor;
private Tree myTree;
private final ModificationOfImportedModelWarningComponent myModificationOfImportedModelWarningComponent;
private ModificationOfImportedModelWarningComponent myModificationOfImportedModelWarningComponent;
private VirtualFile myLastChosen;
private final Collection<Runnable> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
@@ -105,8 +105,6 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
myDescriptor = new DefaultLibraryRootsComponentDescriptor();
}
myRootRemovalHandler = myDescriptor.createRootRemovalHandler();
myModificationOfImportedModelWarningComponent = new ModificationOfImportedModelWarningComponent();
myBottomPanel.add(BorderLayout.CENTER, myModificationOfImportedModelWarningComponent.getLabel());
init(new LibraryTreeStructure(this, myDescriptor));
updatePropertiesLabel();
onRootsChanged();
@@ -169,7 +167,6 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
myTreePanel.setLayout(new BorderLayout());
ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(myTree).disableUpDownActions()
.setPanelBorder(JBUI.Borders.empty())
.setRemoveActionName(JavaUiBundle.message("library.remove.action"))
.disableRemoveAction();
final List<AttachRootButtonDescriptor> popupItems = new ArrayList<>();
@@ -256,7 +253,10 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
}
});
myTreePanel.add(toolbarDecorator.createPanel(), BorderLayout.CENTER);
JPanel panel = toolbarDecorator.createPanel();
panel.setBorder(null);
myTreePanel.add(panel, BorderLayout.CENTER);
}
public JComponent getComponent() {
@@ -339,6 +339,11 @@ public class LibraryRootsComponent implements Disposable, LibraryEditorComponent
updateModificationOfImportedModelWarning();
}
private void createUIComponents() {
myModificationOfImportedModelWarningComponent = new ModificationOfImportedModelWarningComponent();
myBottomLabel = myModificationOfImportedModelWarningComponent.getLabel();
}
@Nullable
private static Object getPathElement(final TreePath selectionPath) {
if (selectionPath == null) {