# HG changeset patch # User Björn Ricks # Date 1354634203 -3600 # Node ID f3325079dacc8e38172cabf51b155a470ac3213e # Parent e3f28be45103cafb63f4f84a0e7b5923130764c8 Improve the up and down arrows in the theme navigation panel Don't stretch the arrow icons and fit to their actual size. Also put the up buttons on the left and the down buttons on the right. diff -r e3f28be45103 -r f3325079dacc flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemeNavigationPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemeNavigationPanel.java Tue Dec 04 16:08:04 2012 +0100 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemeNavigationPanel.java Tue Dec 04 16:16:43 2012 +0100 @@ -5,6 +5,8 @@ import com.google.gwt.core.client.GWT; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.types.VerticalAlignment; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.ImgButton; import com.smartgwt.client.widgets.events.ClickEvent; @@ -22,8 +24,9 @@ public class ThemeNavigationPanel extends Canvas { public static final int PANEL_MARGIN = 5; - public static final int BUTTON_HEIGHT = 25; + public static final int BUTTON_HEIGHT = 20; public static final int BUTTON_MARGIN = 5; + private static final int BOTTON_WIDTH = 20; protected FLYSConstants MSG = GWT.create(FLYSConstants.class); @@ -43,16 +46,32 @@ layout.setWidth100(); layout.setHeight(BUTTON_HEIGHT); layout.setMembersMargin(BUTTON_MARGIN); + layout.setDefaultLayoutAlign(VerticalAlignment.CENTER); + layout.setDefaultLayoutAlign(Alignment.CENTER); Canvas cu = createButton(MSG.theme_top(), OnMoveEvent.TOP); Canvas u = createButton(MSG.theme_up(), OnMoveEvent.UP); Canvas d = createButton(MSG.theme_down(), OnMoveEvent.DOWN); Canvas cd = createButton(MSG.theme_bottom(), OnMoveEvent.BOTTOM); - layout.addMember(cu); - layout.addMember(u); - layout.addMember(d); - layout.addMember(cd); + HLayout left = new HLayout(); + left.setMembersMargin(BUTTON_MARGIN); + left.setLayoutAlign(Alignment.LEFT); + left.setDefaultLayoutAlign(Alignment.LEFT); + left.setAlign(Alignment.LEFT); + left.addMember(cu); + left.addMember(u); + + HLayout right = new HLayout(); + right.setMembersMargin(BUTTON_MARGIN); + right.setLayoutAlign(Alignment.RIGHT); + right.setDefaultLayoutAlign(Alignment.RIGHT); + right.setAlign(Alignment.RIGHT); + right.addMember(d); + right.addMember(cd); + + layout.addMember(left); + layout.addMember(right); addChild(layout); } @@ -63,17 +82,17 @@ ImgButton b = new ImgButton(); b.setSrc(url); + b.setWidth(BOTTON_WIDTH); b.setHeight(BUTTON_HEIGHT); - b.setWidth(40); - b.setIconHeight(BUTTON_HEIGHT-10); + b.setIconHeight(BUTTON_HEIGHT); + b.setIconWidth(BOTTON_WIDTH); b.setShowDown(false); b.setShowRollOver(false); b.setShowDisabled(false); b.setShowDisabledIcon(true); b.setShowDownIcon(false); b.setShowFocusedIcon(false); - b.setBackgroundColor("f2f2f2"); - b.setBorder("1px solid #A6ABB4"); + b.setValign(VerticalAlignment.CENTER); b.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) {