Use theme-capable icons in the user menu

They're still inconsistent weights, but at least they are the right color on non-light-theme clients.
pull/21833/head
Travis Ralston 2020-06-23 21:17:39 -06:00
parent 74e4ea7d48
commit 5c7e59b132
2 changed files with 73 additions and 9 deletions

View File

@ -15,7 +15,26 @@ limitations under the License.
*/ */
.mx_UserMenuButton { .mx_UserMenuButton {
// No special styles on the button itself > span {
width: 16px;
height: 16px;
position: relative;
display: block;
&::before {
content: '';
width: 16px;
height: 16px;
position: absolute;
top: 0;
left: 0;
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $primary-fg-color;
mask-image: url('$(res)/img/feather-customised/more-horizontal.svg');
}
}
} }
.mx_UserMenuButton_contextMenu { .mx_UserMenuButton_contextMenu {
@ -79,4 +98,49 @@ limitations under the License.
justify-content: center; justify-content: center;
} }
} }
.mx_IconizedContextMenu_icon {
position: relative;
width: 16px;
height: 16px;
&::before {
content: '';
width: 16px;
height: 16px;
position: absolute;
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $primary-fg-color;
}
}
.mx_UserMenuButton_iconHome::before {
mask-image: url('$(res)/img/feather-customised/home.svg');
}
.mx_UserMenuButton_iconBell::before {
mask-image: url('$(res)/img/feather-customised/notifications.svg');
}
.mx_UserMenuButton_iconLock::before {
mask-image: url('$(res)/img/feather-customised/lock.svg');
}
.mx_UserMenuButton_iconSettings::before {
mask-image: url('$(res)/img/feather-customised/settings.svg');
}
.mx_UserMenuButton_iconArchive::before {
mask-image: url('$(res)/img/feather-customised/archive.svg');
}
.mx_UserMenuButton_iconMessage::before {
mask-image: url('$(res)/img/feather-customised/message-circle.svg');
}
.mx_UserMenuButton_iconSignOut::before {
mask-image: url('$(res)/img/feather-customised/sign-out.svg');
}
} }

View File

@ -190,7 +190,7 @@ export default class UserMenuButton extends React.Component<IProps, IState> {
homeButton = ( homeButton = (
<li> <li>
<AccessibleButton onClick={this.onHomeClick}> <AccessibleButton onClick={this.onHomeClick}>
<img src={require("../../../res/img/feather-customised/home.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconHome" />
<span>{_t("Home")}</span> <span>{_t("Home")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
@ -233,31 +233,31 @@ export default class UserMenuButton extends React.Component<IProps, IState> {
{homeButton} {homeButton}
<li> <li>
<AccessibleButton onClick={(e) => this.onSettingsOpen(e, USER_NOTIFICATIONS_TAB)}> <AccessibleButton onClick={(e) => this.onSettingsOpen(e, USER_NOTIFICATIONS_TAB)}>
<img src={require("../../../res/img/feather-customised/notifications.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconBell" />
<span>{_t("Notification settings")}</span> <span>{_t("Notification settings")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
<li> <li>
<AccessibleButton onClick={(e) => this.onSettingsOpen(e, USER_SECURITY_TAB)}> <AccessibleButton onClick={(e) => this.onSettingsOpen(e, USER_SECURITY_TAB)}>
<img src={require("../../../res/img/feather-customised/lock.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconLock" />
<span>{_t("Security & privacy")}</span> <span>{_t("Security & privacy")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
<li> <li>
<AccessibleButton onClick={(e) => this.onSettingsOpen(e, null)}> <AccessibleButton onClick={(e) => this.onSettingsOpen(e, null)}>
<img src={require("../../../res/img/feather-customised/settings.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconSettings" />
<span>{_t("All settings")}</span> <span>{_t("All settings")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
<li> <li>
<AccessibleButton onClick={this.onShowArchived}> <AccessibleButton onClick={this.onShowArchived}>
<img src={require("../../../res/img/feather-customised/archive.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconArchive" />
<span>{_t("Archived rooms")}</span> <span>{_t("Archived rooms")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
<li> <li>
<AccessibleButton onClick={this.onProvideFeedback}> <AccessibleButton onClick={this.onProvideFeedback}>
<img src={require("../../../res/img/feather-customised/message-circle.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconMessage" />
<span>{_t("Feedback")}</span> <span>{_t("Feedback")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
@ -267,7 +267,7 @@ export default class UserMenuButton extends React.Component<IProps, IState> {
<ul> <ul>
<li> <li>
<AccessibleButton onClick={this.onSignOutClick}> <AccessibleButton onClick={this.onSignOutClick}>
<img src={require("../../../res/img/feather-customised/sign-out.svg")} width={16} /> <span className="mx_IconizedContextMenu_icon mx_UserMenuButton_iconSignOut" />
<span>{_t("Sign out")}</span> <span>{_t("Sign out")}</span>
</AccessibleButton> </AccessibleButton>
</li> </li>
@ -287,7 +287,7 @@ export default class UserMenuButton extends React.Component<IProps, IState> {
label={_t("Account settings")} label={_t("Account settings")}
isExpanded={this.state.menuDisplayed} isExpanded={this.state.menuDisplayed}
> >
<img src={require("../../../res/img/feather-customised/more-horizontal.svg")} alt="..." width={14} /> <span>{/* masked image in CSS */}</span>
</ContextMenuButton> </ContextMenuButton>
{contextMenu} {contextMenu}
</React.Fragment> </React.Fragment>