mirror of https://github.com/zlatinb/muwire
Position result details frame at center of MW screen. Not clear why it didn't work before. GitHub issue #130
parent
0ca754d1da
commit
84beced43d
|
@ -1,7 +1,9 @@
|
||||||
package com.muwire.gui.resultdetails
|
package com.muwire.gui.resultdetails
|
||||||
|
|
||||||
|
import griffon.core.GriffonApplication
|
||||||
import net.i2p.data.Destination
|
import net.i2p.data.Destination
|
||||||
|
|
||||||
|
import javax.inject.Inject
|
||||||
import javax.swing.JPanel
|
import javax.swing.JPanel
|
||||||
import javax.swing.border.Border
|
import javax.swing.border.Border
|
||||||
import java.awt.BorderLayout
|
import java.awt.BorderLayout
|
||||||
|
@ -22,6 +24,8 @@ import java.awt.GridBagConstraints
|
||||||
|
|
||||||
@ArtifactProviderFor(GriffonView)
|
@ArtifactProviderFor(GriffonView)
|
||||||
class ResultDetailsFrameView {
|
class ResultDetailsFrameView {
|
||||||
|
@Inject
|
||||||
|
GriffonApplication application
|
||||||
@MVCMember @Nonnull
|
@MVCMember @Nonnull
|
||||||
FactoryBuilderSupport builder
|
FactoryBuilderSupport builder
|
||||||
@MVCMember @Nonnull
|
@MVCMember @Nonnull
|
||||||
|
@ -35,10 +39,11 @@ class ResultDetailsFrameView {
|
||||||
def certificatesGroup, collectionsGroup
|
def certificatesGroup, collectionsGroup
|
||||||
|
|
||||||
void initUI() {
|
void initUI() {
|
||||||
|
def mainFrame = application.windowManager.findWindow("main-frame")
|
||||||
int rowHeight = application.context.get("row-height")
|
int rowHeight = application.context.get("row-height")
|
||||||
|
|
||||||
int frameHeight = 150
|
int frameHeight = 150
|
||||||
window = builder.frame(visible : false, locationRelativeTo: application.windowManager.findWindow("main-frame"),
|
window = builder.frame(visible : false, locationRelativeTo: mainFrame,
|
||||||
defaultCloseOperation: JFrame.DISPOSE_ON_CLOSE,
|
defaultCloseOperation: JFrame.DISPOSE_ON_CLOSE,
|
||||||
iconImage: builder.imageIcon("/MuWire-48x48.png").image,
|
iconImage: builder.imageIcon("/MuWire-48x48.png").image,
|
||||||
title: trans("DETAILS_FOR", model.resultEvent.name)) {
|
title: trans("DETAILS_FOR", model.resultEvent.name)) {
|
||||||
|
|
Loading…
Reference in New Issue