X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fwidgets%2Fauth%2FCmsLogin.java;h=46b3d4f8ba22164e06377148a91a5e46e23e757a;hb=c718f8be43b6ee3b1ba111c2a22c9037e35b872f;hp=db0ae6296c5bbf9e68655721f26e416108ee183c;hpb=49fc76ba74a908417cb954274593cce384babeaa;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/widgets/auth/CmsLogin.java b/org.argeo.cms.ui/src/org/argeo/cms/widgets/auth/CmsLogin.java index db0ae6296..46b3d4f8b 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/widgets/auth/CmsLogin.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/widgets/auth/CmsLogin.java @@ -20,8 +20,8 @@ import javax.security.auth.login.LoginException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.cms.CmsMsg; +import org.argeo.cms.LocaleUtils; import org.argeo.cms.auth.HttpRequestCallback; -import org.argeo.cms.i18n.LocaleUtils; import org.argeo.cms.ui.CmsStyles; import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.internal.Activator; @@ -118,7 +118,7 @@ public class CmsLogin implements CmsStyles, CallbackHandler { Locale locale = localeChoice == null ? this.defaultLocale : localeChoice.getSelectedLocale(); credentialsBlock = new Composite(parent, SWT.NONE); credentialsBlock.setLayout(new GridLayout()); - credentialsBlock.setLayoutData(CmsUtils.fillAll()); + // credentialsBlock.setLayoutData(CmsUtils.fillAll()); specificUserUi(credentialsBlock); @@ -149,10 +149,12 @@ public class CmsLogin implements CmsStyles, CallbackHandler { // We need a composite for the traversal credentialsBlock = new Composite(parent, SWT.NONE); credentialsBlock.setLayout(new GridLayout()); - credentialsBlock.setLayoutData(CmsUtils.fillAll()); + // credentialsBlock.setLayoutData(CmsUtils.fillAll()); + CmsUtils.style(credentialsBlock, CMS_LOGIN_DIALOG); Integer textWidth = 120; - CmsUtils.style(parent, CMS_USER_MENU); + if (parent instanceof Shell) + CmsUtils.style(parent, CMS_USER_MENU); // new Label(this, SWT.NONE).setText(CmsMsg.username.lead()); usernameT = new Text(credentialsBlock, SWT.BORDER); usernameT.setMessage(username.lead(locale)); @@ -182,7 +184,12 @@ public class CmsLogin implements CmsStyles, CallbackHandler { passwordT.addTraverseListener(tl); parent.setTabList(new Control[] { credentialsBlock }); credentialsBlock.setTabList(new Control[] { usernameT, passwordT }); - // credentialsBlock.setFocus(); + + // Button + Button loginButton = new Button(credentialsBlock, SWT.PUSH); + loginButton.setText(CmsMsg.login.lead(locale)); + loginButton.setLayoutData(CmsUtils.fillWidth()); + loginButton.addSelectionListener(loginSelectionListener); extendsCredentialsBlock(credentialsBlock, locale, loginSelectionListener); if (localeChoice != null) @@ -216,6 +223,7 @@ public class CmsLogin implements CmsStyles, CallbackHandler { protected Composite createLocalesBlock(final Composite parent) { Composite c = new Composite(parent, SWT.NONE); + CmsUtils.style(c, CMS_USER_MENU_ITEM); c.setLayout(CmsUtils.noSpaceGridLayout()); c.setLayoutData(CmsUtils.fillAll()); @@ -235,6 +243,7 @@ public class CmsLogin implements CmsStyles, CallbackHandler { for (Integer i = 0; i < locales.size(); i++) { Locale locale = locales.get(i); Button button = new Button(c, SWT.RADIO); + CmsUtils.style(button, CMS_USER_MENU_ITEM); button.setData(i); button.setText(LocaleUtils.lead(locale.getDisplayName(locale), locale) + " (" + locale + ")"); // button.addListener(SWT.Selection, listener);