-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1039 from GwtMaterialDesign/release_2.8.0
Release 2.8.0
- Loading branch information
Showing
9 changed files
with
220 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
set -ev | ||
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.7.1" ]; then | ||
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.8.0" ]; then | ||
echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml | ||
mvn deploy -DskipTests --settings ~/settings.xml | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
gwt-material/src/main/java/gwt/material/design/client/base/HasSymbols.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* #%L | ||
* GwtMaterial | ||
* %% | ||
* Copyright (C) 2015 - 2023 GwtMaterialDesign | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package gwt.material.design.client.base; | ||
|
||
import gwt.material.design.client.constants.Color; | ||
import gwt.material.design.client.constants.SymbolType; | ||
|
||
public interface HasSymbols { | ||
|
||
void setType(SymbolType type); | ||
|
||
void setSymbol(String symbol); | ||
|
||
void setColor(Color color); | ||
|
||
void setSymbolSize(String size); | ||
|
||
void setFilled(boolean filled); | ||
|
||
void setWeight(int weight); | ||
|
||
void setGrade(int grade); | ||
|
||
void setOpticalSize(int size); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
gwt-material/src/main/java/gwt/material/design/client/constants/SymbolType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* #%L | ||
* GwtMaterial | ||
* %% | ||
* Copyright (C) 2015 - 2023 GwtMaterialDesign | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package gwt.material.design.client.constants; | ||
|
||
import gwt.material.design.client.base.helper.EnumHelper; | ||
|
||
public enum SymbolType implements CssType { | ||
|
||
OUTLINED("material-symbols-outlined", "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"), | ||
ROUNDED("material-symbols-rounded", "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"), | ||
SHARP("material-symbols-sharp", "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"); | ||
|
||
protected String name; | ||
protected String cssLink; | ||
|
||
SymbolType(String name, String cssLink) { | ||
this.name = name; | ||
this.cssLink = cssLink; | ||
} | ||
|
||
@Override | ||
public String getCssName() { | ||
return name; | ||
} | ||
|
||
public String getCssLink() { | ||
return cssLink; | ||
} | ||
|
||
public static SymbolType fromStyleName(final String styleName) { | ||
return EnumHelper.fromStyleName(styleName, SymbolType.class, OUTLINED); | ||
} | ||
} |
119 changes: 119 additions & 0 deletions
119
gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSymbol.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/* | ||
* #%L | ||
* GwtMaterial | ||
* %% | ||
* Copyright (C) 2015 - 2023 GwtMaterialDesign | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package gwt.material.design.client.ui; | ||
|
||
import com.google.gwt.dom.client.Document; | ||
import com.google.gwt.dom.client.LinkElement; | ||
import gwt.material.design.client.base.HasSymbols; | ||
import gwt.material.design.client.base.MaterialWidget; | ||
import gwt.material.design.client.base.mixin.ColorsMixin; | ||
import gwt.material.design.client.base.mixin.CssNameMixin; | ||
import gwt.material.design.client.constants.Color; | ||
import gwt.material.design.client.constants.SymbolType; | ||
import gwt.material.design.client.ui.html.Span; | ||
|
||
public class MaterialSymbol extends MaterialWidget implements HasSymbols { | ||
|
||
protected Span span = new Span(); | ||
protected static LinkElement linkElement = Document.get().createLinkElement(); | ||
protected CssNameMixin<Span, SymbolType> symbolTypeMixin; | ||
protected ColorsMixin<MaterialSymbol> symbolColorsMixin; | ||
protected boolean filled; | ||
protected int weight = 400; | ||
protected int grade = 0; | ||
protected int opticalSize = 48; | ||
|
||
static { | ||
linkElement.setRel("stylesheet"); | ||
body().append(linkElement); | ||
} | ||
|
||
public MaterialSymbol() { | ||
super(Document.get().createElement("div")); | ||
setType(SymbolType.OUTLINED); | ||
} | ||
|
||
@Override | ||
protected void onLoad() { | ||
super.onLoad(); | ||
|
||
load(); | ||
add(span); | ||
} | ||
|
||
@Override | ||
public void setSymbol(String symbol) { | ||
span.setText(symbol); | ||
} | ||
|
||
@Override | ||
public void setColor(Color color) { | ||
getSymbolColorsMixin().setTextColor(color); | ||
} | ||
|
||
@Override | ||
public void setSymbolSize(String size) { | ||
span.getElement().getStyle().setProperty("fontSize", size); | ||
} | ||
|
||
@Override | ||
public void setType(SymbolType type) { | ||
getSymbolTypeMixin().setCssName(type); | ||
linkElement.setHref(type.getCssLink()); | ||
} | ||
|
||
@Override | ||
public void setFilled(boolean filled) { | ||
this.filled = filled; | ||
} | ||
|
||
@Override | ||
public void setWeight(int weight) { | ||
this.weight = weight; | ||
} | ||
|
||
@Override | ||
public void setGrade(int grade) { | ||
this.grade = grade; | ||
} | ||
|
||
@Override | ||
public void setOpticalSize(int size) { | ||
this.opticalSize = size; | ||
} | ||
|
||
protected void load() { | ||
span.getElement().getStyle().setProperty("fontVariationSettings", "'FILL' " + (filled ? 1 : 0) + ", 'wght' " + weight + ", 'GRAD' " + grade + ", 'opsz' " + opticalSize); | ||
} | ||
|
||
public ColorsMixin<MaterialSymbol> getSymbolColorsMixin() { | ||
if (symbolColorsMixin == null) { | ||
symbolColorsMixin = new ColorsMixin<>(this); | ||
} | ||
return symbolColorsMixin; | ||
} | ||
|
||
public CssNameMixin<Span, SymbolType> getSymbolTypeMixin() { | ||
if (symbolTypeMixin == null) { | ||
symbolTypeMixin = new CssNameMixin<>(span); | ||
} | ||
return symbolTypeMixin; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters