diff --git a/gui/griffon-app/lifecycle/Initialize.groovy b/gui/griffon-app/lifecycle/Initialize.groovy index 74391282..9839d9df 100644 --- a/gui/griffon-app/lifecycle/Initialize.groovy +++ b/gui/griffon-app/lifecycle/Initialize.groovy @@ -117,6 +117,7 @@ class Initialize extends AbstractLifecycleHandler { def guiPropsFile = new File(home, "gui.properties") UISettings uiSettings + int rowHeight = 14 if (guiPropsFile.exists()) { Properties props = new Properties() guiPropsFile.withInputStream { props.load(it) } @@ -149,7 +150,7 @@ class Initialize extends AbstractLifecycleHandler { } else { fontSize = uiSettings.fontSize } - + rowHeight = fontSize + 2 FontUIResource font = new FontUIResource(fontName, Font.PLAIN, fontSize) def keys = lnf.getDefaults().keys() @@ -183,6 +184,7 @@ class Initialize extends AbstractLifecycleHandler { } } + application.context.put("row-height", rowHeight) application.context.put("ui-settings", uiSettings) } diff --git a/gui/griffon-app/views/com/muwire/gui/AdvancedSharingView.groovy b/gui/griffon-app/views/com/muwire/gui/AdvancedSharingView.groovy index c5362676..6dba0ba2 100644 --- a/gui/griffon-app/views/com/muwire/gui/AdvancedSharingView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/AdvancedSharingView.groovy @@ -31,6 +31,7 @@ class AdvancedSharingView { void initUI() { mainFrame = application.windowManager.findWindow("main-frame") + int rowHeight = application.context.get("row-height") dialog = new JDialog(mainFrame,"Advanced Sharing",true) dialog.setResizable(true) @@ -40,7 +41,7 @@ class AdvancedSharingView { label(text : "Directories watched for file changes") } scrollPane( constraints : BorderLayout.CENTER ) { - watchedDirsTable = table(autoCreateRowSorter : true) { + watchedDirsTable = table(autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.watchedDirectories) { closureColumn(header : "Directory", type : String, read : {it}) } diff --git a/gui/griffon-app/views/com/muwire/gui/ContentPanelView.groovy b/gui/griffon-app/views/com/muwire/gui/ContentPanelView.groovy index 4d788b97..84c95c10 100644 --- a/gui/griffon-app/views/com/muwire/gui/ContentPanelView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/ContentPanelView.groovy @@ -38,6 +38,7 @@ class ContentPanelView { void initUI() { mainFrame = application.windowManager.findWindow("main-frame") + int rowHeight = application.context.get("row-height") dialog = new JDialog(mainFrame, "Content Control Panel", true) mainPanel = builder.panel { @@ -48,7 +49,7 @@ class ContentPanelView { label(text : "Rules") } scrollPane (constraints : BorderLayout.CENTER) { - rulesTable = table(id : "rules-table", autoCreateRowSorter : true) { + rulesTable = table(id : "rules-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.rules) { closureColumn(header: "Term", type:String, read: {row -> row.getTerm()}) closureColumn(header: "Regex?", type:Boolean, read: {row -> row instanceof RegexMatcher}) @@ -74,7 +75,7 @@ class ContentPanelView { label(text : "Hits") } scrollPane(constraints : BorderLayout.CENTER) { - hitsTable = table(id : "hits-table", autoCreateRowSorter : true) { + hitsTable = table(id : "hits-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.hits) { closureColumn(header : "Searcher", type : String, read : {row -> row.persona.getHumanReadableName()}) closureColumn(header : "Keywords", type : String, read : {row -> row.keywords.join(" ")}) diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index bd5c6bac..e9de14be 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -72,6 +72,7 @@ class MainFrameView { void initUI() { settings = application.context.get("ui-settings") + int rowHeight = application.context.get("row-height") builder.with { application(size : [1024,768], id: 'main-frame', locationRelativeTo : null, @@ -152,7 +153,7 @@ class MainFrameView { panel { borderLayout() scrollPane (constraints : BorderLayout.CENTER) { - downloadsTable = table(id : "downloads-table", autoCreateRowSorter : true) { + downloadsTable = table(id : "downloads-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list: model.downloads) { closureColumn(header: "Name", preferredWidth: 300, type: String, read : {row -> row.downloader.file.getName()}) closureColumn(header: "Status", preferredWidth: 50, type: String, read : {row -> row.downloader.getCurrentState().toString()}) @@ -231,7 +232,7 @@ class MainFrameView { panel (constraints : "shared files table") { borderLayout() scrollPane(constraints : BorderLayout.CENTER) { - table(id : "shared-files-table", autoCreateRowSorter: true) { + table(id : "shared-files-table", autoCreateRowSorter: true, rowHeight : rowHeight) { tableModel(list : model.shared) { closureColumn(header : "Name", preferredWidth : 500, type : String, read : {row -> row.getCachedPath()}) closureColumn(header : "Size", preferredWidth : 50, type : Long, read : {row -> row.getCachedLength() }) @@ -277,7 +278,7 @@ class MainFrameView { label("Uploads") } scrollPane (constraints : BorderLayout.CENTER) { - table(id : "uploads-table") { + table(id : "uploads-table", rowHeight : rowHeight) { tableModel(list : model.uploads) { closureColumn(header : "Name", type : String, read : {row -> row.uploader.getName() }) closureColumn(header : "Progress", type : String, read : { row -> @@ -323,7 +324,7 @@ class MainFrameView { label("Connections") } scrollPane(constraints : BorderLayout.CENTER) { - table(id : "connections-table") { + table(id : "connections-table", rowHeight : rowHeight) { tableModel(list : model.connectionList) { closureColumn(header : "Destination", preferredWidth: 250, type: String, read : { row -> row.destination.toBase32() }) closureColumn(header : "Direction", preferredWidth: 20, type: String, read : { row -> @@ -342,7 +343,7 @@ class MainFrameView { label("Incoming searches") } scrollPane(constraints : BorderLayout.CENTER) { - table(id : "searches-table") { + table(id : "searches-table", rowHeight : rowHeight) { tableModel(list : model.searches) { closureColumn(header : "Keywords", type : String, read : { sanitized = it.search.replace('<', ' ') @@ -375,7 +376,7 @@ class MainFrameView { panel (border : etchedBorder()){ borderLayout() scrollPane(constraints : BorderLayout.CENTER) { - table(id : "trusted-table", autoCreateRowSorter : true) { + table(id : "trusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.trusted) { closureColumn(header : "Trusted Users", type : String, read : { it.getHumanReadableName() } ) } @@ -391,7 +392,7 @@ class MainFrameView { panel (border : etchedBorder()){ borderLayout() scrollPane(constraints : BorderLayout.CENTER) { - table(id : "distrusted-table", autoCreateRowSorter : true) { + table(id : "distrusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.distrusted) { closureColumn(header: "Distrusted Users", type : String, read : { it.getHumanReadableName() } ) } @@ -410,7 +411,7 @@ class MainFrameView { label(text : "Trust List Subscriptions") } scrollPane(constraints : BorderLayout.CENTER) { - table(id : "subscription-table", autoCreateRowSorter : true) { + table(id : "subscription-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.subscriptions) { closureColumn(header : "Name", preferredWidth: 200, type: String, read : {it.persona.getHumanReadableName()}) closureColumn(header : "Trusted", preferredWidth : 20, type: Integer, read : {it.good.size()}) diff --git a/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy b/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy index 2b8878ac..b417922e 100644 --- a/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/SearchTabView.groovy @@ -49,6 +49,7 @@ class SearchTabView { def sequentialDownloadCheckbox void initUI() { + int rowHeight = application.context.get("row-height") builder.with { def resultsTable def sendersTable @@ -59,7 +60,7 @@ class SearchTabView { panel { borderLayout() scrollPane (constraints : BorderLayout.CENTER) { - sendersTable = table(id : "senders-table", autoCreateRowSorter : true) { + sendersTable = table(id : "senders-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.senders) { closureColumn(header : "Sender", preferredWidth : 500, type: String, read : {row -> row.getHumanReadableName()}) closureColumn(header : "Results", preferredWidth : 20, type: Integer, read : {row -> model.sendersBucket[row].size()}) @@ -85,7 +86,7 @@ class SearchTabView { panel { borderLayout() scrollPane (constraints : BorderLayout.CENTER) { - resultsTable = table(id : "results-table", autoCreateRowSorter : true) { + resultsTable = table(id : "results-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list: model.results) { closureColumn(header: "Name", preferredWidth: 350, type: String, read : {row -> row.name.replace('<','_')}) closureColumn(header: "Size", preferredWidth: 20, type: Long, read : {row -> row.size}) diff --git a/gui/griffon-app/views/com/muwire/gui/TrustListView.groovy b/gui/griffon-app/views/com/muwire/gui/TrustListView.groovy index da500796..b6ea40a5 100644 --- a/gui/griffon-app/views/com/muwire/gui/TrustListView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/TrustListView.groovy @@ -29,6 +29,7 @@ class TrustListView { void initUI() { mainFrame = application.windowManager.findWindow("main-frame") + int rowHeight = application.context.get("row-height") dialog = new JDialog(mainFrame, model.trustList.persona.getHumanReadableName(), true) mainPanel = builder.panel { borderLayout() @@ -46,7 +47,7 @@ class TrustListView { panel { borderLayout() scrollPane (constraints : BorderLayout.CENTER){ - table(id : "trusted-table", autoCreateRowSorter : true) { + table(id : "trusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.trusted) { closureColumn(header: "Trusted Users", type : String, read : {it.getHumanReadableName()}) closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.destination).toString()}) @@ -62,7 +63,7 @@ class TrustListView { panel { borderLayout() scrollPane (constraints : BorderLayout.CENTER ){ - table(id : "distrusted-table", autoCreateRowSorter : true) { + table(id : "distrusted-table", autoCreateRowSorter : true, rowHeight : rowHeight) { tableModel(list : model.distrusted) { closureColumn(header: "Distrusted Users", type : String, read : {it.getHumanReadableName()}) closureColumn(header: "Your Trust", type : String, read : {model.trustService.getLevel(it.destination).toString()})