Skip to content

Commit dfc96f1

Browse files
authored
Refactor: Remove redundant downloadSourceComboBox from ModDownloadListPageSkin (HMCL-dev#6370)
1 parent a5c7fe0 commit dfc96f1

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -273,30 +273,18 @@ protected ModDownloadListPageSkin(DownloadListPage control) {
273273
{
274274
int rowIndex = 0;
275275

276-
if (control.versionSelection || !control.downloadSources.isEmpty()) {
276+
if (control.versionSelection) {
277277
searchPane.addRow(rowIndex);
278278
int columns = 0;
279279
Node lastNode = null;
280-
if (control.versionSelection) {
281-
JFXComboBox<String> versionsComboBox = new JFXComboBox<>();
282-
versionsComboBox.setMaxWidth(Double.MAX_VALUE);
283-
Bindings.bindContent(versionsComboBox.getItems(), control.versions);
284-
selectedItemPropertyFor(versionsComboBox).bindBidirectional(control.selectedVersion);
285-
286-
searchPane.add(new Label(i18n("version")), columns++, rowIndex);
287-
searchPane.add(lastNode = versionsComboBox, columns++, rowIndex);
288-
}
289280

290-
if (control.downloadSources.getSize() > 1) {
291-
JFXComboBox<String> downloadSourceComboBox = new JFXComboBox<>();
292-
downloadSourceComboBox.setMaxWidth(Double.MAX_VALUE);
293-
downloadSourceComboBox.getItems().setAll(control.downloadSources.get());
294-
downloadSourceComboBox.setConverter(stringConverter(I18n::i18n));
295-
selectedItemPropertyFor(downloadSourceComboBox).bindBidirectional(control.downloadSource);
281+
JFXComboBox<String> versionsComboBox = new JFXComboBox<>();
282+
versionsComboBox.setMaxWidth(Double.MAX_VALUE);
283+
Bindings.bindContent(versionsComboBox.getItems(), control.versions);
284+
selectedItemPropertyFor(versionsComboBox).bindBidirectional(control.selectedVersion);
296285

297-
searchPane.add(new Label(i18n("settings.launcher.download_source")), columns++, rowIndex);
298-
searchPane.add(lastNode = downloadSourceComboBox, columns++, rowIndex);
299-
}
286+
searchPane.add(new Label(i18n("version")), columns++, rowIndex);
287+
searchPane.add(lastNode = versionsComboBox, columns++, rowIndex);
300288

301289
if (columns == 2) {
302290
GridPane.setColumnSpan(lastNode, 3);

0 commit comments

Comments
 (0)