From 3f62b626eccb7795b741d0821b63da37ad242459 Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Thu, 3 May 2012 18:27:08 +0300 Subject: [PATCH] Various CSS and cosmetic fixes --- src/gr/grnet/pithos/web/client/Pithos.java | 8 ++- src/gr/grnet/pithos/web/client/PithosCellTable.css | 2 +- .../pithos/web/client/PithosDisclosurePanel.css | 8 +-- .../web/client/foldertree/FolderTreeView.java | 4 +- .../grouptree/PithosGroupDisclosurePanel.css | 8 +-- .../client/mysharedtree/MysharedTreeViewModel.java | 11 ++-- .../mysharedtree/PithosMySharedDisclosurePanel.css | 9 ++-- .../othersharedtree/OtherSharedTreeView.java | 12 ++++- .../othersharedtree/OtherSharedTreeViewModel.java | 12 +++-- .../PithosOtherSharedDisclosurePanel.css | 55 ++++++++++++++++++++ src/gr/grnet/pithos/web/public/pithos.css | 5 +- 11 files changed, 109 insertions(+), 25 deletions(-) create mode 100644 src/gr/grnet/pithos/web/client/othersharedtree/PithosOtherSharedDisclosurePanel.css diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index 0e91be9..0da97e6 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -426,6 +426,12 @@ public class Pithos implements EntryPoint, ResizeHandler { createMySharedTree(); } }); + + HorizontalPanel separator = new HorizontalPanel(); + separator.addStyleName("pithos-statisticsSeparator"); + separator.add(new HTML("")); + trees.add(separator); + groupTreeViewModel = new GroupTreeViewModel(Pithos.this); groupTreeView = new GroupTreeView(groupTreeViewModel); treeViews.add(groupTreeView); @@ -1106,7 +1112,7 @@ public class Pithos implements EntryPoint, ResizeHandler { @Override public void execute() { mysharedTreeView = new MysharedTreeView(mysharedTreeViewModel); - trees.insert(mysharedTreeView, 1); + trees.insert(mysharedTreeView, 2); treeViews.add(mysharedTreeView); createOtherSharedTree(); } diff --git a/src/gr/grnet/pithos/web/client/PithosCellTable.css b/src/gr/grnet/pithos/web/client/PithosCellTable.css index 539f2cf..4cf7439 100644 --- a/src/gr/grnet/pithos/web/client/PithosCellTable.css +++ b/src/gr/grnet/pithos/web/client/PithosCellTable.css @@ -23,7 +23,7 @@ cursor: pointer; color: white; background-color: #74aec9; - height: 25px; + height: 28px; text-shadow: none; font-size: 13px; font-weight: normal; diff --git a/src/gr/grnet/pithos/web/client/PithosDisclosurePanel.css b/src/gr/grnet/pithos/web/client/PithosDisclosurePanel.css index 98c191d..0fd0c30 100644 --- a/src/gr/grnet/pithos/web/client/PithosDisclosurePanel.css +++ b/src/gr/grnet/pithos/web/client/PithosDisclosurePanel.css @@ -34,15 +34,15 @@ */ .disclosurePanel { - padding-left: 10px; width: 100%; + margin-bottom: 5px; } .header { background-color: #74aec9; - height: 25px; + height: 28px; width: 100%; - margin-bottom: 5px; + padding-left: 6px; } .arrow { @@ -50,6 +50,6 @@ } .content { - padding: 4px 0px 4px 8px; + padding: 4px 0px 4px 0px; margin-left: 6px; } diff --git a/src/gr/grnet/pithos/web/client/foldertree/FolderTreeView.java b/src/gr/grnet/pithos/web/client/foldertree/FolderTreeView.java index 2f86a37..c3641ef 100644 --- a/src/gr/grnet/pithos/web/client/foldertree/FolderTreeView.java +++ b/src/gr/grnet/pithos/web/client/foldertree/FolderTreeView.java @@ -156,7 +156,7 @@ public class FolderTreeView extends Composite implements TreeView { } interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources { - @Override + @Override @Source("gr/grnet/pithos/resources/home22.png") ImageResource icon(); } @@ -190,7 +190,9 @@ public class FolderTreeView extends Composite implements TreeView { HorizontalPanel separator = new HorizontalPanel(); separator.addStyleName("pithos-statisticsSeparator"); + separator.add(new HTML("")); content.add(separator); +// content.setCellHeight(separator, "3px"); HorizontalPanel statistics = new HorizontalPanel(); statistics.addStyleName("pithos-statistics"); diff --git a/src/gr/grnet/pithos/web/client/grouptree/PithosGroupDisclosurePanel.css b/src/gr/grnet/pithos/web/client/grouptree/PithosGroupDisclosurePanel.css index 759e29a..f3e139c 100644 --- a/src/gr/grnet/pithos/web/client/grouptree/PithosGroupDisclosurePanel.css +++ b/src/gr/grnet/pithos/web/client/grouptree/PithosGroupDisclosurePanel.css @@ -34,15 +34,15 @@ */ .disclosurePanel { - padding-left: 10px; width: 100%; + margin-bottom: 5px; } .header { background-color: #cdde87; - height: 25px; + height: 28px; width: 100%; - margin-bottom: 5px; + padding-left: 6px; } .arrow { @@ -50,6 +50,6 @@ } .content { - padding: 4px 0px 4px 8px; + padding: 4px 0px 4px 0px; margin-left: 6px; } diff --git a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java index e6d2323..baf1025 100644 --- a/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/mysharedtree/MysharedTreeViewModel.java @@ -80,12 +80,16 @@ public class MysharedTreeViewModel implements TreeViewModel { protected Pithos app; + Folder dummy = new Folder("No files shared by me"); + private Cell folderCell = new AbstractCell(ContextMenuEvent.getType().getName()) { @Override public void render(Context context, Folder folder, SafeHtmlBuilder safeHtmlBuilder) { - String html = AbstractImagePrototype.create(MysharedTreeView.images.folderYellow()).getHTML(); - safeHtmlBuilder.appendHtmlConstant(html).appendHtmlConstant(" "); + if (!folder.equals(dummy)) { + String html = AbstractImagePrototype.create(MysharedTreeView.images.folderYellow()).getHTML(); + safeHtmlBuilder.appendHtmlConstant(html).appendHtmlConstant(" "); + } safeHtmlBuilder.append(Templates.INSTANCE.nameSpan(folder.getName())); } @@ -132,13 +136,14 @@ public class MysharedTreeViewModel implements TreeViewModel { @Override public void onSuccess(final AccountResource _result) { firstLevelDataProvider.getList().clear(); - Folder t = null; for (Folder c : _result.getContainers()) { if (c.isHome()) firstLevelDataProvider.getList().add(0, c); //Pithos is always first else if (!c.isTrash()) firstLevelDataProvider.getList().add(c); } + if (firstLevelDataProvider.getList().isEmpty()) + firstLevelDataProvider.getList().add(dummy); if (callback != null) callback.execute(); } diff --git a/src/gr/grnet/pithos/web/client/mysharedtree/PithosMySharedDisclosurePanel.css b/src/gr/grnet/pithos/web/client/mysharedtree/PithosMySharedDisclosurePanel.css index fb4fe0d..adf6356 100644 --- a/src/gr/grnet/pithos/web/client/mysharedtree/PithosMySharedDisclosurePanel.css +++ b/src/gr/grnet/pithos/web/client/mysharedtree/PithosMySharedDisclosurePanel.css @@ -34,15 +34,16 @@ */ .disclosurePanel { - padding-left: 10px; width: 100%; + margin-top: 20px; + margin-bottom: 5px; } .header { background-color: #e9ddaf; - height: 25px; + height: 28px; width: 100%; - margin-bottom: 5px; + padding-left: 6px; } .arrow { @@ -50,6 +51,6 @@ } .content { - padding: 4px 0px 4px 8px; + padding: 4px 0px 4px 0px; margin-left: 6px; } diff --git a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java index 3727316..b003bec 100644 --- a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java +++ b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeView.java @@ -42,7 +42,6 @@ import gr.grnet.pithos.web.client.foldertree.Folder; import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.resources.client.ClientBundle.Source; import com.google.gwt.resources.client.ImageResource.ImageOptions; import com.google.gwt.resources.client.ImageResource.RepeatStyle; import com.google.gwt.safehtml.client.SafeHtmlTemplates; @@ -134,8 +133,17 @@ public class OtherSharedTreeView extends Composite implements TreeView { public SafeHtml nameSpan(String name); } - interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources { + interface Style extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Style { @Override + String disclosurePanel(); + } + + interface Resources extends gr.grnet.pithos.web.client.PithosDisclosurePanel.Resources { + @Override + @Source("PithosOtherSharedDisclosurePanel.css") + Style pithosDisclosurePanelCss(); + + @Override @Source("gr/grnet/pithos/resources/sharedtome22.png") ImageResource icon(); } diff --git a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java index 5e1ced8..588f1cc 100644 --- a/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java +++ b/src/gr/grnet/pithos/web/client/othersharedtree/OtherSharedTreeViewModel.java @@ -76,12 +76,14 @@ public class OtherSharedTreeViewModel implements TreeViewModel { protected Pithos app; + String dummy = "No shares by others yet"; + private Cell folderCell = new AbstractCell(ContextMenuEvent.getType().getName()) { @Override public void render(Context context, Folder folder, SafeHtmlBuilder safeHtmlBuilder) { String html = AbstractImagePrototype.create(OtherSharedTreeView.images.folderYellow()).getHTML(); - safeHtmlBuilder.appendHtmlConstant(html).appendHtmlConstant(" "); + safeHtmlBuilder.appendHtmlConstant(html).appendHtmlConstant(" "); safeHtmlBuilder.append(Templates.INSTANCE.nameSpan(folder.getName())); } @@ -132,8 +134,10 @@ public class OtherSharedTreeViewModel implements TreeViewModel { @Override public void render(String object, SafeHtmlBuilder builder) { - String html = AbstractImagePrototype.create(OtherSharedTreeView.images.myShared()).getHTML(); - builder.appendHtmlConstant(html).appendHtmlConstant(" "); + if (!object.equals(dummy)) { + String html = AbstractImagePrototype.create(OtherSharedTreeView.images.myShared()).getHTML(); + builder.appendHtmlConstant(html).appendHtmlConstant(" "); + } builder.append(OtherSharedTreeView.Templates.INSTANCE.nameSpan(object)); } }), null, null); @@ -164,6 +168,8 @@ public class OtherSharedTreeViewModel implements TreeViewModel { public void onSuccess(final SharingUsers _result) { userLevelDataProvider.getList().clear(); userLevelDataProvider.getList().addAll(_result.getUsers()); + if (userLevelDataProvider.getList().isEmpty()) + userLevelDataProvider.getList().add(dummy); Iterator iter = _result.getUsers().iterator(); fetchSharedContainers(iter, callback); } diff --git a/src/gr/grnet/pithos/web/client/othersharedtree/PithosOtherSharedDisclosurePanel.css b/src/gr/grnet/pithos/web/client/othersharedtree/PithosOtherSharedDisclosurePanel.css new file mode 100644 index 0000000..54b0038 --- /dev/null +++ b/src/gr/grnet/pithos/web/client/othersharedtree/PithosOtherSharedDisclosurePanel.css @@ -0,0 +1,55 @@ +/* + * Copyright 2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +.disclosurePanel { + width: 100%; + margin-bottom: 20px; +} + +.header { + background-color: #74aec9; + height: 28px; + width: 100%; + padding-left: 6px; +} + +.arrow { + padding-right: 2px; +} + +.content { + padding: 4px 0px 4px 0px; + margin-left: 6px; +} diff --git a/src/gr/grnet/pithos/web/public/pithos.css b/src/gr/grnet/pithos/web/public/pithos.css index c36d903..808a9e7 100644 --- a/src/gr/grnet/pithos/web/public/pithos.css +++ b/src/gr/grnet/pithos/web/public/pithos.css @@ -345,8 +345,8 @@ table.pithos-permList.props-labels { .pithos-statistics { color: black; - padding: 10px; -} +/* padding: 10px; + */} .pithos-statistics .gwt-HTML { font-size: smaller; @@ -387,6 +387,7 @@ table.pithos-permList.props-labels { padding: 8px; width: 134px; border: 0px; + color: black; } .pithos-uploadButton-loading { -- 1.7.10.4