mirror of https://github.com/zlatinb/muwire
different row height for trees
parent
6b441d6ff9
commit
3465d89743
|
@ -1,4 +1,5 @@
|
||||||
import com.muwire.gui.LNFs
|
import com.muwire.gui.LNFs
|
||||||
|
import com.muwire.gui.profile.ProfileConstants
|
||||||
import com.muwire.gui.win.PrioritySetter
|
import com.muwire.gui.win.PrioritySetter
|
||||||
import griffon.core.GriffonApplication
|
import griffon.core.GriffonApplication
|
||||||
import groovy.swing.SwingBuilder
|
import groovy.swing.SwingBuilder
|
||||||
|
@ -67,6 +68,7 @@ class Initialize extends AbstractLifecycleHandler {
|
||||||
def guiPropsFile = new File(home, "gui.properties")
|
def guiPropsFile = new File(home, "gui.properties")
|
||||||
UISettings uiSettings
|
UISettings uiSettings
|
||||||
int rowHeight = 15
|
int rowHeight = 15
|
||||||
|
int treeRowHeight = 15
|
||||||
if (guiPropsFile.exists()) {
|
if (guiPropsFile.exists()) {
|
||||||
Properties props = new Properties()
|
Properties props = new Properties()
|
||||||
guiPropsFile.withInputStream { props.load(it) }
|
guiPropsFile.withInputStream { props.load(it) }
|
||||||
|
@ -105,7 +107,7 @@ class Initialize extends AbstractLifecycleHandler {
|
||||||
} else {
|
} else {
|
||||||
fontSize = uiSettings.fontSize
|
fontSize = uiSettings.fontSize
|
||||||
}
|
}
|
||||||
rowHeight = Math.max(24, fontSize + 3)
|
rowHeight = fontSize + 3
|
||||||
FontUIResource font = new FontUIResource(fontName, uiSettings.fontStyle, fontSize)
|
FontUIResource font = new FontUIResource(fontName, uiSettings.fontStyle, fontSize)
|
||||||
|
|
||||||
def keys = lnf.getDefaults().keys()
|
def keys = lnf.getDefaults().keys()
|
||||||
|
@ -136,6 +138,9 @@ class Initialize extends AbstractLifecycleHandler {
|
||||||
uiSettings.locale = showLanguageDialog()
|
uiSettings.locale = showLanguageDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
treeRowHeight = rowHeight
|
||||||
|
rowHeight = Math.max(ProfileConstants.MAX_THUMBNAIL_SIZE, rowHeight)
|
||||||
|
application.context.put("tree-row-height", treeRowHeight)
|
||||||
application.context.put("row-height", rowHeight)
|
application.context.put("row-height", rowHeight)
|
||||||
application.context.put("ui-settings", uiSettings)
|
application.context.put("ui-settings", uiSettings)
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ class BrowseView {
|
||||||
|
|
||||||
void initUI() {
|
void initUI() {
|
||||||
int rowHeight = application.context.get("row-height")
|
int rowHeight = application.context.get("row-height")
|
||||||
|
int treeRowHeight = application.context.get("tree-row-height")
|
||||||
|
|
||||||
p = builder.panel {
|
p = builder.panel {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
|
@ -94,7 +95,7 @@ class BrowseView {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
scrollPane(constraints: BorderLayout.CENTER) {
|
scrollPane(constraints: BorderLayout.CENTER) {
|
||||||
resultsTree = new ResultTree(model.resultsTreeModel)
|
resultsTree = new ResultTree(model.resultsTreeModel)
|
||||||
tree(id: "results-tree", rowHeight: rowHeight, resultsTree)
|
tree(id: "results-tree", rowHeight: treeRowHeight, resultsTree)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,7 @@ class MainFrameView {
|
||||||
|
|
||||||
settings = application.context.get("ui-settings")
|
settings = application.context.get("ui-settings")
|
||||||
int rowHeight = application.context.get("row-height")
|
int rowHeight = application.context.get("row-height")
|
||||||
|
int treeRowHeight = application.context.get("tree-row-height")
|
||||||
|
|
||||||
def screenDimensions = Toolkit.getDefaultToolkit().getScreenSize()
|
def screenDimensions = Toolkit.getDefaultToolkit().getScreenSize()
|
||||||
int mainFrameX = (int)Math.min(1400.0d, screenDimensions.getWidth())
|
int mainFrameX = (int)Math.min(1400.0d, screenDimensions.getWidth())
|
||||||
|
@ -387,7 +388,7 @@ class MainFrameView {
|
||||||
jtree.setDragEnabled(true)
|
jtree.setDragEnabled(true)
|
||||||
jtree.setTransferHandler(transferHandler)
|
jtree.setTransferHandler(transferHandler)
|
||||||
ToolTipManager.sharedInstance().registerComponent(jtree)
|
ToolTipManager.sharedInstance().registerComponent(jtree)
|
||||||
tree(id : "shared-files-tree", rowHeight : rowHeight, rootVisible : false, expandsSelectedPaths: true, largeModel : true, jtree)
|
tree(id : "shared-files-tree", rowHeight : treeRowHeight, rootVisible : false, expandsSelectedPaths: true, largeModel : true, jtree)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,7 @@ class SearchTabView {
|
||||||
|
|
||||||
void initUI() {
|
void initUI() {
|
||||||
int rowHeight = application.context.get("row-height")
|
int rowHeight = application.context.get("row-height")
|
||||||
|
int treeRowHeight = application.context.get("tree-row-height")
|
||||||
pane = builder.panel {
|
pane = builder.panel {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
panel (id : "results-panel", constraints : BorderLayout.CENTER) {
|
panel (id : "results-panel", constraints : BorderLayout.CENTER) {
|
||||||
|
@ -156,7 +157,7 @@ class SearchTabView {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
scrollPane(constraints: BorderLayout.CENTER) {
|
scrollPane(constraints: BorderLayout.CENTER) {
|
||||||
resultTree = new ResultTree(model.treeModel)
|
resultTree = new ResultTree(model.treeModel)
|
||||||
tree(id: "results-tree", rowHeight: rowHeight, resultTree)
|
tree(id: "results-tree", rowHeight: treeRowHeight, resultTree)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue