Skip to content

Commit

Permalink
Add desktop settings button in settings menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed May 25, 2024
1 parent 3a57c98 commit aa40746
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const GUIComponent = props => {
onClickAccountNav,
onCloseAccountNav,
onClickAddonSettings,
onClickDesktopSettings,
onClickNewWindow,
onClickPackager,
onLogOut,
Expand Down Expand Up @@ -304,6 +305,7 @@ const GUIComponent = props => {
onClickAbout={onClickAbout}
onClickAccountNav={onClickAccountNav}
onClickAddonSettings={onClickAddonSettings}
onClickDesktopSettings={onClickDesktopSettings}
onClickNewWindow={onClickNewWindow}
onClickPackager={onClickPackager}
onClickLogo={onClickLogo}
Expand Down Expand Up @@ -493,6 +495,7 @@ GUIComponent.propTypes = {
onActivateTab: PropTypes.func,
onClickAccountNav: PropTypes.func,
onClickAddonSettings: PropTypes.func,
onClickDesktopSettings: PropTypes.func,
onClickNewWindow: PropTypes.func,
onClickPackager: PropTypes.func,
onClickLogo: PropTypes.func,
Expand Down
2 changes: 2 additions & 0 deletions src/components/menu-bar/menu-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ class MenuBar extends React.Component {
canChangeLanguage={this.props.canChangeLanguage}
canChangeTheme={this.props.canChangeTheme}
isRtl={this.props.isRtl}
onClickDesktopSettings={this.props.onClickDesktopSettings}
// eslint-disable-next-line react/jsx-no-bind
onOpenCustomSettings={this.props.onClickAddonSettings.bind(null, 'editor-theme3')}
onRequestClose={this.props.onRequestCloseSettings}
Expand Down Expand Up @@ -1079,6 +1080,7 @@ MenuBar.propTypes = {
]),
onClickAccount: PropTypes.func,
onClickAddonSettings: PropTypes.func,
onClickDesktopSettings: PropTypes.func,
onClickPackager: PropTypes.func,
onClickRestorePoints: PropTypes.func,
onClickEdit: PropTypes.func,
Expand Down
4 changes: 4 additions & 0 deletions src/components/menu-bar/settings-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import MenuLabel from './tw-menu-label.jsx';
import TWAccentThemeMenu from './tw-theme-accent.jsx';
import TWGuiThemeMenu from './tw-theme-gui.jsx';
import TWBlocksThemeMenu from './tw-theme-blocks.jsx';
import TWDesktopSettings from './tw-desktop-settings.jsx';

import menuBarStyles from './menu-bar.css';
import styles from './settings-menu.css';
Expand All @@ -20,6 +21,7 @@ const SettingsMenu = ({
canChangeLanguage,
canChangeTheme,
isRtl,
onClickDesktopSettings,
onOpenCustomSettings,
onRequestClose,
onRequestOpen,
Expand Down Expand Up @@ -65,6 +67,7 @@ const SettingsMenu = ({
<TWAccentThemeMenu />
</React.Fragment>
)}
{onClickDesktopSettings && <TWDesktopSettings onClick={onClickDesktopSettings} />}
</MenuSection>
</MenuBarMenu>
</MenuLabel>
Expand All @@ -74,6 +77,7 @@ SettingsMenu.propTypes = {
canChangeLanguage: PropTypes.bool,
canChangeTheme: PropTypes.bool,
isRtl: PropTypes.bool,
onClickDesktopSettings: PropTypes.func,
onOpenCustomSettings: PropTypes.func,
onRequestClose: PropTypes.func,
onRequestOpen: PropTypes.func,
Expand Down
43 changes: 43 additions & 0 deletions src/components/menu-bar/tw-desktop-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions src/components/menu-bar/tw-desktop-settings.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import PropTypes from 'prop-types';
import {FormattedMessage} from 'react-intl';
import {MenuItem} from '../menu/menu.jsx';
import icon from './tw-desktop-icon.svg';
import styles from './settings-menu.css';

const TWDesktopSettings = props => (
<MenuItem onClick={props.onClick}>
<div className={styles.option}>
<img
src={icon}
draggable={false}
width={24}
height={24}
alt=""
/>
<FormattedMessage
defaultMessage="Desktop Settings"
description="Button in menu bar under settings to open desktop app settings"
id="tw.menuBar.desktopSettings"
/>
</div>
</MenuItem>
);

TWDesktopSettings.propTypes = {
onClick: PropTypes.func
};

export default TWDesktopSettings;

0 comments on commit aa40746

Please sign in to comment.