center all frames correctly relative to main frame. GitHub issues #130 and #133

dbus-notify
Zlatin Balevsky 2022-04-07 12:36:14 +01:00
parent e4ef0035fd
commit 6f0450ec1c
No known key found for this signature in database
GPG Key ID: A72832072D525E41
5 changed files with 24 additions and 9 deletions

View File

@ -22,13 +22,15 @@ class ChatMonitorView {
@MVCMember @Nonnull @MVCMember @Nonnull
ChatMonitorModel model ChatMonitorModel model
def window JFrame window
def roomsTable def roomsTable
def mainFrame
void initUI() { void initUI() {
int rowHeight = application.context.getAsInt("row-height") int rowHeight = application.context.getAsInt("row-height")
mainFrame = application.windowManager.findWindow("main-frame")
window = builder.frame (visible : false, locationRelativeTo : null, 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,
preferredSize: [800,800]){ preferredSize: [800,800]){
@ -62,6 +64,7 @@ class ChatMonitorView {
} }
}) })
window.pack() window.pack()
window.setLocationRelativeTo(mainFrame)
window.setVisible(true) window.setVisible(true)
} }
} }

View File

@ -36,7 +36,7 @@ class CollectionWizardView {
@MVCMember @Nonnull @MVCMember @Nonnull
CollectionWizardModel model CollectionWizardModel model
def window JFrame window
JPanel mainPanel JPanel mainPanel
def nameTextField def nameTextField
@ -45,11 +45,13 @@ class CollectionWizardView {
def lastFilesTableSortEvent def lastFilesTableSortEvent
JTree jTree JTree jTree
void initUI() { def mainFrame
void initUI() {
mainFrame = application.windowManager.findWindow("main-frame")
int rowHeight = application.context.get("row-height") int rowHeight = application.context.get("row-height")
window = builder.frame(visible: false, locationRelativeTo : null, 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,
preferredSize: [800,800]){ preferredSize: [800,800]){
@ -163,6 +165,7 @@ class CollectionWizardView {
} }
}) })
window.pack() window.pack()
window.setLocationRelativeTo(mainFrame)
window.setVisible(true) window.setVisible(true)
} }

View File

@ -47,15 +47,17 @@ class NewMessageView {
@MVCMember @Nonnull @MVCMember @Nonnull
NewMessageModel model NewMessageModel model
def window JFrame window
DefaultListModel recipientsModel DefaultListModel recipientsModel
JList recipientsList JList recipientsList
JTextField subjectField JTextField subjectField
JTextArea bodyArea JTextArea bodyArea
JTable attachmentsTable JTable attachmentsTable
def lastAttachmentsTableSortEvent def lastAttachmentsTableSortEvent
def mainFrame
void initUI() { void initUI() {
mainFrame = application.windowManager.findWindow("main-frame")
int rowHeight = application.context.get("row-height") int rowHeight = application.context.get("row-height")
recipientsModel = new DefaultListModel() recipientsModel = new DefaultListModel()
@ -64,7 +66,7 @@ class NewMessageView {
} }
recipientsList = new JList(recipientsModel) recipientsList = new JList(recipientsModel)
window = builder.frame(visible : false, locationRelativeTo : null, 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,
preferredSize: [800, 800]){ preferredSize: [800, 800]){
@ -174,6 +176,7 @@ class NewMessageView {
} }
}) })
window.pack() window.pack()
window.setLocationRelativeTo(mainFrame)
window.setVisible(true) window.setVisible(true)
} }

View File

@ -28,8 +28,10 @@ class ChatFavoritesView {
JFrame window JFrame window
private JTable favoritesTable private JTable favoritesTable
def mainFrame
void initUI() { void initUI() {
def mainFrame = application.windowManager.findWindow("main-frame") mainFrame = application.windowManager.findWindow("main-frame")
int rowHeight = application.context.get("row-height") int rowHeight = application.context.get("row-height")
window = builder.frame(visible : false, locationRelativeTo: mainFrame, window = builder.frame(visible : false, locationRelativeTo: mainFrame,
@ -89,6 +91,7 @@ class ChatFavoritesView {
} }
}) })
window.pack() window.pack()
window.setLocationRelativeTo(mainFrame)
window.setVisible(true) window.setVisible(true)
} }

View File

@ -38,8 +38,10 @@ class ResultDetailsFrameView {
def certificatesGroup, collectionsGroup def certificatesGroup, collectionsGroup
def mainFrame
void initUI() { void initUI() {
def mainFrame = application.windowManager.findWindow("main-frame") 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
@ -140,6 +142,7 @@ class ResultDetailsFrameView {
} }
}) })
window.pack() window.pack()
window.setLocationRelativeTo(mainFrame)
window.setVisible(true) window.setVisible(true)
} }