From 8c965fbb38fce9e2bea5c5a9b097d8f71af77d94 Mon Sep 17 00:00:00 2001 From: Marc Englund Date: Mon, 15 Oct 2007 14:03:20 +0000 Subject: [PATCH] reservr usability svn changeset:2516/svn branch:trunk --- WebContent/ITMILL/themes/reservr/styles.css | 25 ++++++++++++++++++- WebContent/reservr.html | 7 +++--- .../reservation/ReservationApplication.java | 21 ++++++++++------ .../toolkit/demo/reservation/SampleDB.java | 16 ++++++------ .../reservation/gwt/public/reservr/styles.css | 1 - .../terminal/gwt/client/ui/ICalendar.java | 22 +++++++++++++--- 6 files changed, 68 insertions(+), 24 deletions(-) diff --git a/WebContent/ITMILL/themes/reservr/styles.css b/WebContent/ITMILL/themes/reservr/styles.css index 22a777dca3..00c6caca1e 100644 --- a/WebContent/ITMILL/themes/reservr/styles.css +++ b/WebContent/ITMILL/themes/reservr/styles.css @@ -14,12 +14,35 @@ html, body { } #slogan { color: #464F52; + font-style: italic; + font-size: 12px; } /* Default widgetset overrides */ +.i-label, +.i-caption { + min-height: 1em; +} +.i-datefield-entrycalendar-hours { + height: 250px; + overflow: auto; +} +.i-panel { + margin-bottom: 5px; +} +.i-caption { + color: #F14C1A; + font-size: 16px; +} +.i-label.arrow { + line-height: 160px; + font-family: Times New Roman; + color: #F14C1A; + font-size: 65px; +} textarea.i-textfield { font-size: 13px; - width: 326px; + width: 320px; height: 110px; } button.link { diff --git a/WebContent/reservr.html b/WebContent/reservr.html index a5acb63cf1..bcf5b4817d 100644 --- a/WebContent/reservr.html +++ b/WebContent/reservr.html @@ -14,9 +14,10 @@
diff --git a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java index 3c7ec1a031..112d47a46d 100644 --- a/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java +++ b/src/com/itmill/toolkit/demo/reservation/ReservationApplication.java @@ -78,18 +78,19 @@ public class ReservationApplication extends Application { resourceName.setCaption("Choose resource"); infoLayout.addComponent(resourceName); description = new TextField(); - description.setColumns(47); + description.setColumns(45); description.setRows(5); infoLayout.addComponent(description); reservationButton = new Button("Make reservation", this, "makeReservation"); infoLayout.addComponent(reservationButton); - statusLabel = new Label(); + statusLabel = new Label(""); + statusLabel.setCaption(""); infoLayout.addComponent(statusLabel); map = new GoogleMap(); - map.setWidth(330); - map.setHeight(270); + map.setWidth(325); + map.setHeight(210); map.setItemMarkerHtmlPropertyId(SampleDB.Resource.PROPERTY_ID_NAME); map.setItemMarkerXPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONX); map.setItemMarkerYPropertyId(SampleDB.Resource.PROPERTY_ID_LOCATIONY); @@ -101,17 +102,21 @@ public class ReservationApplication extends Application { from.set(Calendar.MINUTE, 0); from.set(Calendar.SECOND, 0); from.set(Calendar.MILLISECOND, 0); - reservedFrom = new CalendarField("From »"); + reservedFrom = new CalendarField("From"); reservedFrom.setMinimumDate(from.getTime()); reservedFrom.setValue(from.getTime()); reservedFrom.setImmediate(true); initCalendarFieldPropertyIds(reservedFrom); reservationPanel.addComponent(reservedFrom); + Label arrowLabel = new Label("»"); + arrowLabel.setStyle("arrow"); + reservationPanel.addComponent(arrowLabel); + Calendar to = Calendar.getInstance(); to.setTime(from.getTime()); to.add(Calendar.MILLISECOND, (int) DEFAULT_GAP_MILLIS); - reservedTo = new CalendarField("» To"); + reservedTo = new CalendarField("To"); reservedTo.setMinimumDate(to.getTime()); reservedTo.setValue(to.getTime()); reservedTo.setImmediate(true); @@ -294,8 +299,8 @@ public class ReservationApplication extends Application { } private void resetStatus() { - statusLabel.setCaption(null); - statusLabel.setValue(null); + statusLabel.setCaption(""); + statusLabel.setValue(""); } public void selectedResourcesChanged( diff --git a/src/com/itmill/toolkit/demo/reservation/SampleDB.java b/src/com/itmill/toolkit/demo/reservation/SampleDB.java index 3c617323dd..cffebc5d71 100644 --- a/src/com/itmill/toolkit/demo/reservation/SampleDB.java +++ b/src/com/itmill/toolkit/demo/reservation/SampleDB.java @@ -408,18 +408,18 @@ public class SampleDB { { "12", "12 Ford Fusion", "Keys from infodesk.", "Silicon Valley", new Double(37.365028), new Double(-121.922654) }, - { "13", "13 Ford Mustang", "GT Cal Special. Keys from guard.", - "Silicon Valley", new Double(37.403812), - new Double(-121.977425) }, - { "14", "14 Ford Focus", "Keys from guard.", - "Silicon Valley", new Double(37.403812), - new Double(-121.977425) }, - { "15", "15 Land Rover", "Keys from infodesk.", + { "13", "13 Land Rover", "Keys from infodesk.", "Silicon Valley", new Double(37.365028), new Double(-121.922654) }, - { "16", "16 Land Rover", "Keys from infodesk.", + { "14", "14 Land Rover", "Keys from infodesk.", "Silicon Valley", new Double(37.365028), new Double(-121.922654) }, + { "15", "15 Ford Mustang", "GT Cal Special. Keys from guard.", + "Silicon Valley", new Double(37.403812), + new Double(-121.977425) }, + { "16", "16 Ford Focus", "Keys from guard.", + "Silicon Valley", new Double(37.403812), + new Double(-121.977425) }, // Paris { "17", "17 Peugeot 308", "Keys from infodesk.", "Paris", new Double(48.844756), new Double(2.372784) }, diff --git a/src/com/itmill/toolkit/demo/reservation/gwt/public/reservr/styles.css b/src/com/itmill/toolkit/demo/reservation/gwt/public/reservr/styles.css index bde033b103..defaefb0ca 100644 --- a/src/com/itmill/toolkit/demo/reservation/gwt/public/reservr/styles.css +++ b/src/com/itmill/toolkit/demo/reservation/gwt/public/reservr/styles.css @@ -3,7 +3,6 @@ /* Entrycalendar styles */ .i-datefield-entrycalendar-hours { height: auto; - xoverflow: auto; } .i-datefield-entrycalendar-hours table { width: auto; diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICalendar.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICalendar.java index e6a8770d24..8ba19ab790 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/ICalendar.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/ICalendar.java @@ -78,12 +78,14 @@ public class ICalendar extends IDateField { } protected void buildDayView(Date date) { + boolean firstRender = true; if (this.hourPanel == null) { this.hourPanel = new SimplePanel(); this.hourPanel.setStyleName(CLASSNAME + "-hours"); this.calPanel.getFlexCellFormatter().setColSpan(8, 0, 7); this.calPanel.setWidget(8, 0, this.hourPanel); } else { + firstRender = false; this.hourPanel.clear(); } this.hourTable = new FlexTable(); @@ -142,14 +144,15 @@ public class ICalendar extends IDateField { } Element el = this.hourTable.getFlexCellFormatter().getElement( start, col); - + String tooltip; if (DateTimeService.isSameDay(entry.getStart(), entry.getEnd())) { tooltip = (start < 10 ? "0" : "") + start + ":00"; if (this.dts.isTwelveHourClock()) { String ampm = (start < 12 ? "am" : "pm"); - tooltip = (start <= 12 ? start : start - 12) + ":00 " + ampm; - + tooltip = (start <= 12 ? start : start - 12) + ":00 " + + ampm; + } tooltip += " (" + hours + "h) "; tooltip += entry.getTitle() + "\n "; @@ -162,8 +165,21 @@ public class ICalendar extends IDateField { currentCol++; } + // int hour = new Date().getHours()+1; // scroll to current hour + int hour = this.date.getHours() + 1; // scroll to selected hour + int h1 = (int) this.hourPanel.getOffsetHeight() / 2; + int oh = this.hourTable.getOffsetHeight(); + int h2 = (int) (hour / 24.0 * oh); + int scrollTop = (int) h2 - h1; + Element el = this.hourPanel.getElement(); + setScrollTop(el, scrollTop); + } + private native void setScrollTop(Element el, int scrollTop) /*-{ + el.scrollTop = scrollTop; + }-*/; + private class HourTableListener implements TableListener { public void onCellClicked(SourcesTableEvents sender, int row, int cell) { -- 2.39.5