Dialog moved to top-right (in way that it doesn't cover top menu bar). (#317)

Fixed formatting.

SPARK-939_Stretch_and_move_Find_dialog - moved to NORTHEAST
This commit is contained in:
Paweł Ścibiorski
2017-03-18 20:34:36 +01:00
committed by wroot
parent 2cd2f1d613
commit 326382562b
2 changed files with 7 additions and 2 deletions

View File

@ -448,7 +448,7 @@ public class UserManager {
final JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.setLayout(new GridBagLayout());
mainPanel.add(layoutPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 200, 0));
mainPanel.add(layoutPanel, new GridBagConstraints(0, 0, 1, 1, 0.5, 0.5, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(20, 1, 5, 1), 200, 0));
mainPanel.setOpaque(false);
contactField.setText(contact);

View File

@ -16,6 +16,7 @@
package org.jivesoftware.spark.component;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.ui.ContactItem;
import org.jivesoftware.spark.util.ModelUtil;
@ -176,7 +177,11 @@ public class JContactItemField extends JPanel {
if (validItems.size() != 0 && !popup.isVisible()) {
popup.pack();
popup.setSize(textField.getWidth(), 200);
if(validItems.size()*16<=SparkManager.getMainWindow().getHeight()-SparkManager.getSearchManager().getSearchServiceUI().getHeight()-SparkManager.getMainWindow().getTopToolBar().getHeight()-SparkManager.getWorkspace().getStatusBar().getHeight()-48){
popup.setSize(textField.getWidth(), validItems.size()*16+5);
}else{
popup.setSize(textField.getWidth(), SparkManager.getMainWindow().getHeight()-SparkManager.getSearchManager().getSearchServiceUI().getHeight()-SparkManager.getMainWindow().getTopToolBar().getHeight()-SparkManager.getWorkspace().getStatusBar().getHeight()-48);
}
Point pt = textField.getLocationOnScreen();
pt.translate(0, textField.getHeight());
popup.setLocation(pt);