From f352daa4543e4622657e827d6c09f400a7252502 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Wed, 2 Dec 2015 12:52:54 +0100 Subject: [PATCH] Add close button at top of project list popup The list of projects in the project list popup can be very long and then the close button is inconveniently far down the page. Add a second close button at the top of the popup. Change-Id: Ib33cd00db31a561f3932a02ec1a8556d256845ed Signed-off-by: Edwin Kempin --- .../gerrit/client/ui/ProjectListPopup.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectListPopup.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectListPopup.java index 8b58403d40..36708dc846 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectListPopup.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/ProjectListPopup.java @@ -43,7 +43,8 @@ public class ProjectListPopup { private HorizontalPanel filterPanel; private String match; private Query query; - private Button close; + private Button closeTop; + private Button closeBottom; private ScrollPanel sp; private PopupPanel.PositionCallback popupPosition; private int preferredTop; @@ -55,10 +56,11 @@ public class ProjectListPopup { createWidgets(popupText, currentPageLink); final FlowPanel pfp = new FlowPanel(); pfp.add(filterPanel); + pfp.add(closeTop); sp = new ScrollPanel(projectsTab); sp.setSize("100%", "100%"); pfp.add(sp); - pfp.add(close); + pfp.add(closeBottom); popup.setWidget(pfp); popup.setHeight("100%"); popupPosition = getPositionCallback(); @@ -147,17 +149,23 @@ public class ProjectListPopup { }; projectsTab.setSavePointerId(currentPageLink); - close = new Button(Util.C.projectsClose()); + closeTop = createCloseButton(); + closeBottom = createCloseButton(); + + popup = new DialogBox(); + popup.setModal(false); + popup.setText(popupText); + } + + private Button createCloseButton() { + Button close = new Button(Util.C.projectsClose()); close.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { closePopup(); } }); - - popup = new DialogBox(); - popup.setModal(false); - popup.setText(popupText); + return close; } public void displayPopup() {