diff --git a/resources/styles/Components/NavbarHorizontal.scss b/resources/styles/Components/NavbarHorizontal.scss index 0798b080..b94d3867 100644 --- a/resources/styles/Components/NavbarHorizontal.scss +++ b/resources/styles/Components/NavbarHorizontal.scss @@ -155,4 +155,18 @@ a.navbar-more-tools, a.navbar-usernotloggedin, a.navbar-userloggedin, a.navbar-tool-link, a:visited.navbar-tool-link { color: $navbar-light-color; } + + .navbar-tool.avatar { + background: white; + border-radius: 99px; + overflow: hidden; + } + + a.navbar-userloggedin-avatar { + width: 41px; + height: 41px; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + } } diff --git a/src/Components/NavbarHorizontal/PersonalTools.php b/src/Components/NavbarHorizontal/PersonalTools.php index 4fd0c991..c79208e3 100644 --- a/src/Components/NavbarHorizontal/PersonalTools.php +++ b/src/Components/NavbarHorizontal/PersonalTools.php @@ -36,6 +36,7 @@ * Provides a PersonalTools component to be included in a NavbarHorizontal component. * * @author Stephan Gambke + * @reviewer thomas-topway-it - user-avatar (for KM-A) * @since 1.6 * @ingroup Skins */ @@ -54,6 +55,9 @@ class PersonalTools extends Component { private const SHOW_USER_NAME_YES = 'yes'; private const ATTR_PROMOTE_LONE_ITEMS = 'promoteLoneItems'; + /** @var avatarUrl */ + protected $avatarUrl = null; + /** * @return String * @throws \FatalError @@ -61,6 +65,8 @@ class PersonalTools extends Component { */ public function getHtml() { $tools = $this->getSkinTemplate()->getPersonalTools(); + + $this->setUserAvatar(); // Flatten classes to avoid MW bug: https://phabricator.wikimedia.org/T262160 // NB: This bug is finally fixed in MW >=1.36. @@ -99,7 +105,8 @@ public function getHtml() { return $echoHtml . $this->indent() . '' . $this->indent() . '