Merge changes from topic 'silk-icons'

* changes:
  ChangeScreen: Add icons for hashtags
  ChangeScreen: Add icon for adding reviewer
  Use silk icons
This commit is contained in:
Dave Borowitz 2016-01-05 19:10:19 +00:00 committed by Gerrit Code Review
commit c4934dfdb1
63 changed files with 163 additions and 106 deletions

View File

@ -18,42 +18,84 @@ import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
public interface Resources extends ClientBundle {
@Source("addFileComment.png")
/**
* silk icons (CC-BY3.0): http://famfamfam.com/lab/icons/silk/
*/
@Source("note_add.png")
ImageResource addFileComment();
@Source("arrowDown.png")
@Source("tag_blue_add.png")
ImageResource addHashtag();
@Source("user_add.png")
ImageResource addUser();
// derived from resultset_next.png
@Source("resultset_down_gray.png")
ImageResource arrowDown();
@Source("arrowRight.png")
// derived from resultset_next.png
@Source("resultset_next_gray.png")
ImageResource arrowRight();
@Source("arrowUp.png")
// derived from resultset_next.png
@Source("resultset_up_gray.png")
ImageResource arrowUp();
@Source("deleteHover.png")
ImageResource deleteHover();
@Source("deleteNormal.png")
ImageResource deleteNormal();
@Source("diffy26.png")
ImageResource gerritAvatar26();
@Source("downloadIcon.png")
@Source("page_white_put.png")
ImageResource downloadIcon();
@Source("draftComments.png")
// derived from comment.png
@Source("comment_draft.png")
ImageResource draftComments();
@Source("editText.png")
@Source("page_edit.png")
ImageResource edit();
@Source("editUndo.png")
@Source("arrow_undo.png")
ImageResource editUndo();
@Source("gear.png")
@Source("cog.png")
ImageResource gear();
@Source("tick.png")
ImageResource greenCheck();
@Source("tag_blue.png")
ImageResource hashtag();
@Source("lightbulb.png")
ImageResource info();
@Source("find.png")
ImageResource queryIcon();
@Source("lock.png")
ImageResource readOnly();
@Source("cross.png")
ImageResource redNot();
@Source("disk.png")
ImageResource save();
@Source("star.png")
ImageResource starFilled();
// derived from star.png
@Source("star-open.png")
ImageResource starOpen();
@Source("exclamation.png")
ImageResource warning();
@Source("help.png")
ImageResource question();
/**
* tango icon library (public domain):
* http://tango.freedesktop.org/Tango_Icon_Library
*/
@Source("goNext.png")
ImageResource goNext();
@ -63,48 +105,25 @@ public interface Resources extends ClientBundle {
@Source("goUp.png")
ImageResource goUp();
@Source("greenCheck.png")
ImageResource greenCheck();
@Source("info.png")
ImageResource info();
@Source("listAdd.png")
ImageResource listAdd();
@Source("mediaFloppy.png")
ImageResource save();
// derived from important.png
@Source("merge.png")
ImageResource merge();
@Source("queryIcon.png")
ImageResource queryIcon();
@Source("readOnly.png")
ImageResource readOnly();
@Source("redNot.png")
ImageResource redNot();
/**
* contributed by the artist under Apache2.0
*/
@Source("sideBySideDiff.png")
ImageResource sideBySideDiff();
@Source("starFilled.png")
ImageResource starFilled();
@Source("starOpen.png")
ImageResource starOpen();
@Source("undoNormal.png")
ImageResource undoNormal();
@Source("unifiedDiff.png")
ImageResource unifiedDiff();
@Source("warning.png")
ImageResource warning();
@Source("question.png")
ImageResource question();
/**
* contributed by the artist under CC-BY3.0
*/
@Source("diffy26.png")
ImageResource gerritAvatar26();
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

View File

@ -26,6 +26,7 @@ gwt_module(
resources = glob(['src/main/java/**/*']),
deps = [
':freebie_application_icon_set',
':silk_icons',
'//gerrit-gwtui-common:diffy_logo',
'//gerrit-gwtui-common:client',
'//gerrit-gwtexpui:CSS',
@ -47,6 +48,14 @@ java_library(
],
)
java_library(
name = 'silk_icons',
deps = [
'//lib:LICENSE-silk_icons',
'//lib:LICENSE-CC-BY3.0',
],
)
java_test(
name = 'ui_tests',
srcs = glob(['src/test/java/**/*.java']),

View File

@ -160,6 +160,7 @@ public interface GerritCss extends CssResource {
String projectFilterLabel();
String projectFilterPanel();
String projectNameColumn();
String queryIcon();
String rebaseContentPanel();
String rebaseSuggestBox();
String registerScreenExplain();

View File

@ -24,12 +24,19 @@ public interface AdminResources extends ClientBundle {
@Source("admin.css")
AdminCss css();
/**
* unknown origin
* TODO replace icons
*/
@Source("deleteNormal.png")
ImageResource deleteNormal();
@Source("deleteHover.png")
ImageResource deleteHover();
@Source("undoNormal.png")
/**
* silk icons (CC-BY3.0): http://famfamfam.com/lab/icons/silk/
*/
@Source("arrow_undo.png")
ImageResource undoNormal();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

View File

@ -115,6 +115,7 @@ public class ChangeScreen extends Screen {
interface Style extends CssResource {
String avatar();
String hashtagName();
String hashtagIcon();
String highlight();
String labelName();
String label_may();

View File

@ -228,8 +228,9 @@ limitations under the License.
.hashtagName {
display: inline-block;
height: 15px;
margin-bottom: 2px;
padding: 1px 3px 0px 3px;
padding: 1px 3px 1px 3px;
border-radius: 5px;
-webkit-border-radius: 5px;
background: #E2F5FF;
@ -237,6 +238,12 @@ limitations under the License.
white-space: nowrap;
}
.hashtagName a,
.hashtagName button {
position: relative;
top: -4px;
}
.hashtagName button {
cursor: pointer;
padding: 0;
@ -246,6 +253,11 @@ limitations under the License.
white-space: nowrap;
}
.hashtagIcon img {
position: relative;
top: 4px;
}
.headerButtons button {
margin: 5.286px 3px 0 0;
text-align: center;

View File

@ -26,6 +26,7 @@ import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
@ -34,9 +35,10 @@ import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.rpc.StatusCodeException;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ImageResourceRenderer;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwtexpui.globalkey.client.NpTextBox;
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
@ -93,7 +95,7 @@ public class Hashtags extends Composite {
}
@UiField Element hashtagsText;
@UiField Button openForm;
@UiField Image addHashtagIcon;
@UiField Element form;
@UiField Element error;
@UiField NpTextBox hashtagTextBox;
@ -116,6 +118,15 @@ public class Hashtags extends Composite {
}
}
});
addHashtagIcon.addDomHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
onOpenForm();
}
},
ClickEvent.getType());
}
void init(ChangeScreen.Style style){
@ -126,18 +137,13 @@ public class Hashtags extends Composite {
canEdit = info.hasActions() && info.actions().containsKey("hashtags");
this.changeId = info.legacyId();
display(info);
openForm.setVisible(canEdit);
}
@UiHandler("openForm")
void onOpenForm(@SuppressWarnings("unused") ClickEvent e) {
onOpenForm();
addHashtagIcon.setVisible(canEdit);
}
void onOpenForm() {
UIObject.setVisible(form, true);
UIObject.setVisible(error, false);
openForm.setVisible(false);
addHashtagIcon.setVisible(false);
hashtagTextBox.setFocus(true);
}
@ -167,7 +173,13 @@ public class Hashtags extends Composite {
.setAttribute("href",
"#" + PageLinks.toChangeQuery("hashtag:\"" + hashtagName + "\""))
.setAttribute("role", "listitem")
.append("#").append(hashtagName)
.openSpan()
.setStyleName(style.hashtagIcon())
.append(new ImageResourceRenderer().render(
Gerrit.RESOURCES.hashtag()))
.closeSpan()
.append(" ")
.append(hashtagName)
.closeAnchor();
if (canEdit) {
html.openElement("button")
@ -186,7 +198,7 @@ public class Hashtags extends Composite {
@UiHandler("cancel")
void onCancel(@SuppressWarnings("unused") ClickEvent e) {
openForm.setVisible(true);
addHashtagIcon.setVisible(true);
UIObject.setVisible(form, false);
hashtagTextBox.setFocus(false);
}

View File

@ -18,6 +18,7 @@ limitations under the License.
xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:c='urn:import:com.google.gwtexpui.globalkey.client'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<ui:with field='ico' type='com.google.gerrit.client.GerritResources'/>
<ui:with field='res' type='com.google.gerrit.client.change.Resources'/>
<ui:style gss='false'>
button.openAdd {
@ -47,6 +48,7 @@ limitations under the License.
font-weight: bold;
}
.addHashtag,
.cancel {
float: right;
}
@ -54,14 +56,10 @@ limitations under the License.
<g:HTMLPanel>
<div>
<span ui:field='hashtagsText'/>
<g:Button ui:field='openForm'
title='Add hashtags to this change'
styleName='{res.style.button}'
addStyleNames='{style.openAdd}'
visible='false'>
<ui:attribute name='title'/>
<div><ui:msg>Add #...</ui:msg></div>
</g:Button>
<g:Image ui:field='addHashtagIcon'
resource='{ico.addHashtag}'
styleName='{style.addHashtag}'
title='Add Hashtag'/>
</div>
<div ui:field='form' style='display: none' aria-hidden='true'>
<c:NpTextBox ui:field='hashtagTextBox' styleName='{style.hashtagTextBox}'/>

View File

@ -35,6 +35,7 @@ import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
@ -46,6 +47,7 @@ import com.google.gwt.user.client.rpc.StatusCodeException;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwtexpui.safehtml.client.SafeHtml;
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
@ -60,7 +62,7 @@ public class Reviewers extends Composite {
private static final Binder uiBinder = GWT.create(Binder.class);
@UiField Element reviewersText;
@UiField Button openForm;
@UiField Image addReviewerIcon;
@UiField Button addMe;
@UiField Element form;
@UiField Element error;
@ -92,6 +94,14 @@ public class Reviewers extends Composite {
});
initWidget(uiBinder.createAndBindUi(this));
addReviewerIcon.addDomHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
onOpenForm();
}
},
ClickEvent.getType());
}
void init(ChangeScreen.Style style, Element ccText) {
@ -103,18 +113,13 @@ public class Reviewers extends Composite {
this.changeId = info.legacyId();
display(info);
reviewerSuggestOracle.setChange(changeId);
openForm.setVisible(Gerrit.isSignedIn());
}
@UiHandler("openForm")
void onOpenForm(@SuppressWarnings("unused") ClickEvent e) {
onOpenForm();
addReviewerIcon.setVisible(Gerrit.isSignedIn());
}
void onOpenForm() {
UIObject.setVisible(form, true);
UIObject.setVisible(error, false);
openForm.setVisible(false);
addReviewerIcon.setVisible(false);
suggestBox.setFocus(true);
}
@ -131,7 +136,7 @@ public class Reviewers extends Composite {
@UiHandler("cancel")
void onCancel(@SuppressWarnings("unused") ClickEvent e) {
openForm.setVisible(true);
addReviewerIcon.setVisible(true);
UIObject.setVisible(form, false);
suggestBox.setFocus(false);
}

View File

@ -19,26 +19,9 @@ limitations under the License.
xmlns:c='urn:import:com.google.gwtexpui.globalkey.client'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:u='urn:import:com.google.gerrit.client.ui'>
<ui:with field='ico' type='com.google.gerrit.client.GerritResources'/>
<ui:with field='res' type='com.google.gerrit.client.change.Resources'/>
<ui:style gss='false'>
button.openAdd {
margin: 3px 3px 0 0;
float: right;
color: rgba(0, 0, 0, 0.15);
background-color: #f5f5f5;
background-image: none;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
button.openAdd div {
width: auto;
color: #444;
}
.suggestBox {
margin-bottom: 2px;
}
@ -48,6 +31,7 @@ limitations under the License.
font-weight: bold;
}
.addReviewer,
.cancel {
float: right;
}
@ -55,14 +39,10 @@ limitations under the License.
<g:HTMLPanel>
<div>
<span ui:field='reviewersText'/>
<g:Button ui:field='openForm'
title='Add reviewers to this change'
styleName='{res.style.button}'
addStyleNames='{style.openAdd}'
visible='false'>
<ui:attribute name='title'/>
<div><ui:msg>Add&#8230;</ui:msg></div>
</g:Button>
<g:Image ui:field='addReviewerIcon'
resource='{ico.addUser}'
styleName='{style.addReviewer}'
title='Add Reviewer'/>
</div>
<div ui:field='form' style='display: none' aria-hidden='true'>
<u:RemoteSuggestBox ui:field='suggestBox' styleName='{style.suggestBox}'/>

View File

@ -25,6 +25,10 @@ interface Resources extends ClientBundle {
@Source("CommentBox.css") CommentBox.Style style();
@Source("Scrollbar.css") Scrollbar.Style scrollbarStyle();
/**
* tango icon library (public domain):
* http://tango.freedesktop.org/Tango_Icon_Library
*/
@Source("goPrev.png") ImageResource goPrev();
@Source("goNext.png") ImageResource goNext();
@Source("goUp.png") ImageResource goUp();

View File

@ -1306,6 +1306,12 @@ a:hover.downloadLink {
min-width: 300px;
}
.queryIcon {
position: relative;
top: 2px;
margin-right: 3px;
}
/** ProjectSettings */
.maxObjectSizeLimitEffectiveLabel {
padding-top: 5px;

View File

@ -27,6 +27,7 @@ public class ProjectSearchLink extends InlineHyperlink {
super(" ", PageLinks.toProjectDefaultDashboard(projectName));
setTitle(Util.C.projectListQueryLink());
final Image image = new Image(Gerrit.RESOURCES.queryIcon());
image.setStyleName(Gerrit.RESOURCES.css().queryIcon());
DOM.insertBefore(getElement(), image.getElement(),
DOM.getFirstChild(getElement()));
}

View File

@ -24,6 +24,7 @@ define_license(name = 'prologcafe')
define_license(name = 'promise-polyfill')
define_license(name = 'protobuf')
define_license(name = 'PublicDomain')
define_license(name = 'silk_icons')
define_license(name = 'slf4j')
define_license(name = 'xz')

1
lib/LICENSE-silk_icons Normal file
View File

@ -0,0 +1 @@
link:http://creativecommons.org/licenses/by/3.0/us/[CC-BY 3.0] (c) Mark James, link:http://famfamfam.com/lab/icons/silk/[SILK ICONS]