Sitelet https://github.com/KrailOrg/krail/commit/a560ed25f116bc200fee07fe6be8282d8d8af8f3
Skip to content

Commit a560ed2

Browse files
author
David Sowerby
committed
Icons added to buttons of DefaultUserStatusPanel, username label made public for styling
1 parent d719127 commit a560ed2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/main/kotlin/uk/q3c/krail/core/view/component/DefaultUserStatusPanel.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package uk.q3c.krail.core.view.component
1414

1515
import com.google.inject.Inject
16+
import com.vaadin.server.FontAwesome
1617
import com.vaadin.ui.Button
1718
import com.vaadin.ui.Button.ClickEvent
1819
import com.vaadin.ui.Button.ClickListener
@@ -51,7 +52,7 @@ import uk.q3c.krail.i18n.Translate
5152
class DefaultUserStatusPanel @Inject
5253
constructor(private val navigator: Navigator, private val subjectProvider: SubjectProvider, private val translate: Translate, private val subjectIdentifier: SubjectIdentifier, private val currentLocale: CurrentLocale) : Panel(), UserStatusPanel, ClickListener, UserStatusChangeSource {
5354
private val log = LoggerFactory.getLogger(this.javaClass.name)
54-
private val usernameLabel: Label
55+
val usernameLabel: Label
5556
val login_logout_Button: Button
5657
private var loggedIn = false
5758
private var username: String = translate.from(LabelKey.Guest)
@@ -74,9 +75,11 @@ constructor(private val navigator: Navigator, private val subjectProvider: Subje
7475
fun configureDisplay() {
7576
log.debug("configuring display with Locale=${currentLocale.locale}")
7677
if (loggedIn) {
78+
login_logout_Button.icon = FontAwesome.SIGN_OUT
7779
login_logout_Button.caption = translate.from(LoginLabelKey.Log_Out).toLowerCase()
7880
usernameLabel.value = username
7981
} else {
82+
login_logout_Button.icon = FontAwesome.SIGN_IN
8083
login_logout_Button.caption = translate.from(LoginLabelKey.Log_In).toLowerCase()
8184
usernameLabel.value = translate.from(LabelKey.Guest)
8285
}

0 commit comments

Comments
 (0)