use split pane in downloads tab as well

This commit is contained in:
Zlatin Balevsky
2019-07-11 03:57:49 +01:00
parent dcbe09886d
commit f7b43304d4

View File

@@ -121,35 +121,37 @@ class MainFrameView {
tabbedPane(id : "result-tabs", constraints: BorderLayout.CENTER) tabbedPane(id : "result-tabs", constraints: BorderLayout.CENTER)
} }
panel (constraints: "downloads window") { panel (constraints: "downloads window") {
gridLayout(rows : 2, cols: 1) gridLayout(rows : 1, cols : 1)
panel { splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) {
borderLayout() panel {
scrollPane (constraints : BorderLayout.CENTER) { borderLayout()
downloadsTable = table(id : "downloads-table", autoCreateRowSorter : true) { scrollPane (constraints : BorderLayout.CENTER) {
tableModel(list: model.downloads) { downloadsTable = table(id : "downloads-table", autoCreateRowSorter : true) {
closureColumn(header: "Name", preferredWidth: 300, type: String, read : {row -> row.downloader.file.getName()}) tableModel(list: model.downloads) {
closureColumn(header: "Status", preferredWidth: 50, type: String, read : {row -> row.downloader.getCurrentState().toString()}) closureColumn(header: "Name", preferredWidth: 300, type: String, read : {row -> row.downloader.file.getName()})
closureColumn(header: "Progress", preferredWidth: 70, type: Downloader, read: { row -> row.downloader }) closureColumn(header: "Status", preferredWidth: 50, type: String, read : {row -> row.downloader.getCurrentState().toString()})
closureColumn(header: "Sources", preferredWidth : 10, type: Integer, read : {row -> row.downloader.activeWorkers()}) closureColumn(header: "Progress", preferredWidth: 70, type: Downloader, read: { row -> row.downloader })
closureColumn(header: "Speed", preferredWidth: 50, type:String, read :{row -> closureColumn(header: "Sources", preferredWidth : 10, type: Integer, read : {row -> row.downloader.activeWorkers()})
DataHelper.formatSize2Decimal(row.downloader.speed(), false) + "B/sec" closureColumn(header: "Speed", preferredWidth: 50, type:String, read :{row ->
}) DataHelper.formatSize2Decimal(row.downloader.speed(), false) + "B/sec"
})
}
} }
} }
panel (constraints : BorderLayout.SOUTH) {
button(text: "Pause", enabled : bind {model.pauseButtonEnabled}, pauseAction)
button(text: "Cancel", enabled : bind {model.cancelButtonEnabled }, cancelAction )
button(text: bind { model.resumeButtonText }, enabled : bind {model.retryButtonEnabled}, resumeAction)
}
} }
panel (constraints : BorderLayout.SOUTH) { panel {
button(text: "Pause", enabled : bind {model.pauseButtonEnabled}, pauseAction) borderLayout()
button(text: "Cancel", enabled : bind {model.cancelButtonEnabled }, cancelAction ) panel(constraints : BorderLayout.NORTH) {
button(text: bind { model.resumeButtonText }, enabled : bind {model.retryButtonEnabled}, resumeAction) label(text : "Download Details")
} }
} scrollPane(constraints : BorderLayout.CENTER) {
panel { label(text : "Details go here...")
borderLayout() }
panel(constraints : BorderLayout.NORTH) {
label(text : "Download Details")
}
panel(constraints : BorderLayout.CENTER) {
label(text : "Details go here...")
} }
} }
} }