Stylesheet changes

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@122436 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-01-21 17:50:30 +00:00
parent 6054217c57
commit 077268ded8
4 changed files with 72 additions and 14 deletions

View File

@ -25,6 +25,6 @@ public class ImagePreviewer implements EntryPoint {
images.add(new EnhancedImage("http://nerdist.com/wp-content/uploads/2014/07/ned-stark-970x545.jpg"));
images.add(new EnhancedImage("http://vignette2.wikia.nocookie.net/gameofthrones/images/2/25/Eddard's_Head.png/revision/latest?cb=20121205211321"));
images.add(new EnhancedImage("https://upload.wikimedia.org/wikipedia/it/1/17/Il_grande_Lebowski.jpg"));
RootPanel.get("image-previewer-div").add(new Carousel(images));
RootPanel.get("image-previewer-div").add(Carousel.getImagePreviewerInstance(images));
}
}

View File

@ -26,12 +26,7 @@ public class Carousel extends Composite{
interface CarouselUiBinder extends UiBinder<Widget, Carousel> {
}
public Carousel() {
initWidget(uiBinder.createAndBindUi(this));
}
@UiField
Modal mainModalPanel;
@ -50,8 +45,23 @@ public class Carousel extends Composite{
private List<EnhancedImage> listOfAttachmentsToShow;
private int currentPreviewPosition;
private static Carousel instance;
public static Carousel getImagePreviewerInstance(List<EnhancedImage> imagesToShow){
if(instance == null){
instance = new Carousel(imagesToShow);
}
return instance;
}
private Carousel(List<EnhancedImage> imagesToShow) {
public Carousel(List<EnhancedImage> imagesToShow) {
initWidget(uiBinder.createAndBindUi(this));
// prev button
@ -59,7 +69,7 @@ public class Carousel extends Composite{
// next button
nextButton.setText(">>");
// save the attachments list
listOfAttachmentsToShow = imagesToShow;
@ -141,4 +151,30 @@ public class Carousel extends Composite{
}
/**
* Update the underneath set of enhanced images.
* @param imagesToShow the new set of images
*/
public void changeUnderneathImageSet(List<EnhancedImage> imagesToShowNew){
// hide the modal
mainModalPanel.hide();
// change the set
listOfAttachmentsToShow = imagesToShowNew;
// take the first object
currentPreviewPosition = 0;
// show it
shownImage.setUrl(listOfAttachmentsToShow.get(currentPreviewPosition).getImageUrl());
// change image tooltip
shownImage.setTitle(listOfAttachmentsToShow.get(currentPreviewPosition).getToolTipToShow());
// change the title to the modal
mainModalPanel.setTitle(listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow());
}
}

View File

@ -20,9 +20,31 @@
font-weight: bold;
}
.modal-text-size {
@external .modal-header;
.modal-header {
text-align: center;
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 14px;
height: 20px;
}
@external .modal-body;
.modal-body {
position: relative;
max-height: 400px;
padding: 0;
overflow-y: auto;
}
@external .modal-footer;
.modal-footer {
padding: 10px 10px 10px;
margin-bottom: 0px;
text-align: right;
background-color: #F5F5F5;
border-top: 1px solid #DDD;
border-radius: 0px 0px 6px 6px;
box-shadow: 0px 1px 0px #FFF inset;
}
}
</ui:style>
<g:HTMLPanel>

View File

@ -1,4 +1,4 @@
.modal-style {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
h3 {
font-size: 14px !important;
color: #3B5998!important;
}