diff options
author | Shawn Pearce <sop@google.com> | 2013-04-23 15:10:40 -0700 |
---|---|---|
committer | Steffen Gebert <steffen.gebert@typo3.org> | 2013-06-14 09:46:04 +0200 |
commit | e0005e1f8412cebb72ee01f6faa6bb2c8f6d6eca (patch) | |
tree | 7e77be88bc7046b3fd896f8ae7634267009698c7 | |
parent | 2f1ce34eb2db4fbc75884f2b866738ae810c9b39 (diff) |
Remove resizing search box and fix width at 70
Many Gerrit users have been complaining to me about the automatically
resizing search box. They find the UI confusing and unwanted. Remove
the resizing feature and fix the width at the full size, aka 70
columns wide.
Change-Id: I40b6d8060bc6c2258a00db177bff82f176edff39
-rw-r--r-- | ReleaseNotes/ReleaseNotes-2.6.txt | 5 | ||||
-rw-r--r-- | gerrit-gwtui/src/main/java/com/google/gerrit/client/SearchPanel.java | 45 |
2 files changed, 1 insertions, 49 deletions
diff --git a/ReleaseNotes/ReleaseNotes-2.6.txt b/ReleaseNotes/ReleaseNotes-2.6.txt index 2f065b88c1..b3442dd63a 100644 --- a/ReleaseNotes/ReleaseNotes-2.6.txt +++ b/ReleaseNotes/ReleaseNotes-2.6.txt @@ -95,11 +95,6 @@ has scrolled down the page. Search ^^^^^^ -* Animate search bar by expanding & unexpanding -+ -When the search bar is used, expand it to allow for more text to be -visible. When it is blurred, shrink it back to the original size. - * Suggest projects, groups and users in search panel + Suggest projects, groups and users in the search panel as parameter for diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/SearchPanel.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/SearchPanel.java index 2ae6005f68..46b7d4d2ec 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/SearchPanel.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/SearchPanel.java @@ -18,9 +18,6 @@ import com.google.gerrit.client.changes.QueryScreen; import com.google.gerrit.client.ui.HintTextBox; import com.google.gerrit.common.PageLinks; import com.google.gerrit.reviewdb.client.Change; -import com.google.gwt.animation.client.Animation; -import com.google.gwt.event.dom.client.BlurEvent; -import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; @@ -36,40 +33,11 @@ import com.google.gwtexpui.globalkey.client.GlobalKey; import com.google.gwtexpui.globalkey.client.KeyCommand; class SearchPanel extends Composite { - private static final int FULL_SIZE = 70; - private static final int SMALL_SIZE = 45; - - private class SizeAnimation extends Animation { - int targetSize; - int startSize; - public void run(boolean expand) { - if(expand) { - targetSize = FULL_SIZE; - startSize = SMALL_SIZE; - } else { - targetSize = SMALL_SIZE; - startSize = FULL_SIZE; - } - super.run(300); - } - @Override - protected void onUpdate(double progress) { - int size = (int) (targetSize * progress + startSize * (1-progress)); - searchBox.setVisibleLength(size); - } - - @Override - protected void onComplete() { - searchBox.setVisibleLength(targetSize); - } - } private final HintTextBox searchBox; private HandlerRegistration regFocus; - private final SizeAnimation sizeAnimation; SearchPanel() { final FlowPanel body = new FlowPanel(); - sizeAnimation = new SizeAnimation(); initWidget(body); setStyleName(Gerrit.RESOURCES.css().searchPanel()); @@ -78,9 +46,6 @@ class SearchPanel extends Composite { searchBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(final KeyPressEvent event) { - if (searchBox.getVisibleLength() == SMALL_SIZE) { - sizeAnimation.run(true); - } if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) { if (!suggestionDisplay.isSuggestionSelected) { doSearch(); @@ -88,19 +53,11 @@ class SearchPanel extends Composite { } } }); - searchBox.addBlurHandler(new BlurHandler() { - @Override - public void onBlur(BlurEvent event) { - if (searchBox.getVisibleLength() != SMALL_SIZE) { - sizeAnimation.run(false); - } - } - }); final SuggestBox suggestBox = new SuggestBox(new SearchSuggestOracle(), searchBox, suggestionDisplay); searchBox.setStyleName("gwt-TextBox"); - searchBox.setVisibleLength(SMALL_SIZE); + searchBox.setVisibleLength(70); searchBox.setHintText(Gerrit.C.searchHint()); final Button searchButton = new Button(Gerrit.C.searchButton()); |