diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java index 27a19321..f7165ec5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/action/ActionPane.java @@ -233,14 +233,42 @@ public class ActionPane implements TemplateComposer { // title if (this.pageService.getI18nSupport().hasText(category.title)) { + final String titleText = this.pageService.getI18nSupport().getText(category.title); + final Label actionsTitle = this.widgetFactory.labelLocalized( composite, CustomVariant.TEXT_H3, category.title); + final GridData titleLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - if (" ".equals(this.pageService.getI18nSupport().getText(category.title))) { + if (" ".equals(titleText)) { titleLayout.heightHint = 6; + } else { + actionsTitle.setData(RWT.CUSTOM_VARIANT, "close"); + actionsTitle.setImage(WidgetFactory.ImageIcon.ACTIVE.getImage(parent.getDisplay())); + actionsTitle.setText("    " + titleText); + actionsTitle.addListener(SWT.MouseUp, event -> { + try { + final Control contentControl = composite.getChildren()[1]; + if (contentControl.isVisible()) { + actionsTitle.setData(RWT.CUSTOM_VARIANT, "open"); + contentControl.setVisible(false); + final GridData l = (GridData) contentControl.getLayoutData(); + l.heightHint = 0; + composite.getParent().layout(true, true); + } else { + actionsTitle.setData(RWT.CUSTOM_VARIANT, "close"); + contentControl.setVisible(true); + final GridData l = (GridData) contentControl.getLayoutData(); + l.heightHint = SWT.DEFAULT; + composite.getParent().layout(true, true); + } + } catch (final Exception e) { + // just ignore + } + }); } + actionsTitle.setLayoutData(titleLayout); } diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java index 7a07a2f3..5b15a4b7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/activity/ActivitiesPane.java @@ -88,7 +88,6 @@ public class ActivitiesPane implements TemplateComposer { pageContext.getParent(), SWT.SINGLE | SWT.FULL_SELECTION); final GridData navigationGridData = new GridData(SWT.FILL, SWT.FILL, true, true); - //navigationGridData.horizontalIndent = 10; navigation.setLayoutData(navigationGridData); final PageActionBuilder actionBuilder = this.pageService.pageActionBuilder(pageContext); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamClientGroupList.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamClientGroupList.java index 7cb6ed25..b9e5553d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamClientGroupList.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamClientGroupList.java @@ -112,7 +112,7 @@ public class ExamClientGroupList implements TemplateComposer { .withColumn(new ColumnDefinition( Domain.CLIENT_GROUP.ATTR_COLOR, CLIENT_GROUP_COLOR_COLUMN_KEY, - cgt -> this.widgetFactory.getColorValueHTML(cgt)) + cgt -> WidgetFactory.getColorValueHTML(cgt)) .asMarkup() .widthProportion(1)) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamTemplateForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamTemplateForm.java index 37ad1143..23972795 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamTemplateForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamTemplateForm.java @@ -358,7 +358,7 @@ public class ExamTemplateForm implements TemplateComposer { .withColumn(new ColumnDefinition( Domain.CLIENT_GROUP.ATTR_COLOR, CLIENT_GROUP_COLOR_COLUMN_KEY, - cgt -> this.widgetFactory.getColorValueHTML(cgt)) + cgt -> WidgetFactory.getColorValueHTML(cgt)) .asMarkup() .widthProportion(1)) .withColumn(new ColumnDefinition( diff --git a/src/main/resources/static/css/sebserver.css b/src/main/resources/static/css/sebserver.css index c41a0838..0e49f26a 100644 --- a/src/main/resources/static/css/sebserver.css +++ b/src/main/resources/static/css/sebserver.css @@ -141,6 +141,26 @@ Label.colorlight { padding: 2px 5px 2px 5px; } +Label.close { + font: bold 14px Arial, Helvetica, sans-serif; + height: 20px; + padding: 0; + color: #1f407a; + background-image: url( static/images/close.png ); + background-position: left; + background-repeat: no-repeat; +} + +Label.open { + font: bold 14px Arial, Helvetica, sans-serif; + height: 20px; + padding: 0; + color: #1f407a; + background-image: url( static/images/open.png ); + background-position: left; + background-repeat: no-repeat; +} + Composite { background-color: transparent; border: none; diff --git a/src/main/resources/static/images/close.png b/src/main/resources/static/images/close.png new file mode 100644 index 00000000..8c85eb7c Binary files /dev/null and b/src/main/resources/static/images/close.png differ diff --git a/src/main/resources/static/images/open.png b/src/main/resources/static/images/open.png new file mode 100644 index 00000000..55114c3d Binary files /dev/null and b/src/main/resources/static/images/open.png differ