2018-05-16 21:49:03 +00:00
|
|
|
// @flow
|
2019-01-22 10:35:28 +00:00
|
|
|
|
|
|
|
import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
|
2019-07-16 13:13:41 +00:00
|
|
|
import { BoxModel, ColorPalette } from '../../../base/styles';
|
|
|
|
|
|
|
|
const BUTTON_SIZE = 50;
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2018-05-16 21:49:03 +00:00
|
|
|
// Toolbox, toolbar:
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The style of toolbar buttons.
|
2016-12-14 22:15:17 +00:00
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
const toolbarButton = {
|
2019-01-22 10:35:28 +00:00
|
|
|
backgroundColor: schemeColor('button'),
|
2019-07-16 13:13:41 +00:00
|
|
|
borderRadius: BUTTON_SIZE / 2,
|
2017-04-11 17:00:41 +00:00
|
|
|
borderWidth: 0,
|
2018-05-15 11:18:42 +00:00
|
|
|
flex: 0,
|
2017-04-11 17:00:41 +00:00
|
|
|
flexDirection: 'row',
|
2019-07-16 13:13:41 +00:00
|
|
|
height: BUTTON_SIZE,
|
2018-05-15 11:18:42 +00:00
|
|
|
justifyContent: 'center',
|
2018-05-18 19:35:58 +00:00
|
|
|
|
|
|
|
// XXX We probably tested BoxModel.margin and discovered it to be too small
|
|
|
|
// for our taste.
|
2018-05-18 11:50:34 +00:00
|
|
|
marginHorizontal: 7,
|
2019-07-16 13:13:41 +00:00
|
|
|
width: BUTTON_SIZE
|
2016-10-05 14:36:59 +00:00
|
|
|
};
|
|
|
|
|
2016-12-14 22:15:17 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The icon style of the toolbar buttons.
|
2016-12-14 22:15:17 +00:00
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
const toolbarButtonIcon = {
|
|
|
|
alignSelf: 'center',
|
2017-04-11 17:00:41 +00:00
|
|
|
color: ColorPalette.darkGrey,
|
2018-05-15 11:18:42 +00:00
|
|
|
fontSize: 22
|
2016-10-05 14:36:59 +00:00
|
|
|
};
|
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
/**
|
|
|
|
* The style of toolbar buttons which display white icons.
|
|
|
|
*/
|
|
|
|
const whiteToolbarButton = {
|
|
|
|
...toolbarButton,
|
|
|
|
backgroundColor: schemeColor('buttonToggled')
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The icon style of toolbar buttons which display white icons.
|
|
|
|
*/
|
|
|
|
const whiteToolbarButtonIcon = {
|
|
|
|
...toolbarButtonIcon,
|
|
|
|
color: ColorPalette.white
|
|
|
|
};
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The Toolbox and toolbar related styles.
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2019-07-16 13:13:41 +00:00
|
|
|
const styles = {
|
2018-04-18 14:34:40 +00:00
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The style of the toolbar.
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2018-05-15 11:18:42 +00:00
|
|
|
toolbar: {
|
|
|
|
alignItems: 'center',
|
2016-12-12 19:49:23 +00:00
|
|
|
flexDirection: 'row',
|
2018-08-29 19:04:05 +00:00
|
|
|
flexGrow: 0,
|
2016-12-12 19:49:23 +00:00
|
|
|
justifyContent: 'center',
|
2018-05-18 11:50:34 +00:00
|
|
|
marginBottom: BoxModel.margin / 2,
|
2018-08-29 19:04:05 +00:00
|
|
|
paddingHorizontal: BoxModel.margin
|
2016-10-05 14:36:59 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2018-05-15 11:18:42 +00:00
|
|
|
* The style of the root/top-level {@link Container} of {@link Toolbox}.
|
2017-10-13 16:13:46 +00:00
|
|
|
*/
|
2018-08-29 19:04:05 +00:00
|
|
|
toolbox: {
|
2017-10-13 16:13:46 +00:00
|
|
|
flexDirection: 'column',
|
2018-08-29 19:04:05 +00:00
|
|
|
flexGrow: 0
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
2019-07-16 13:13:41 +00:00
|
|
|
};
|
2018-05-15 11:18:42 +00:00
|
|
|
|
|
|
|
export default styles;
|
|
|
|
|
|
|
|
/**
|
2019-01-22 10:35:28 +00:00
|
|
|
* Color schemed styles for the @{Toolbox} component.
|
2018-05-15 11:18:42 +00:00
|
|
|
*/
|
2019-01-22 10:35:28 +00:00
|
|
|
ColorSchemeRegistry.register('Toolbox', {
|
|
|
|
/**
|
|
|
|
* Styles for buttons in the toolbar.
|
|
|
|
*/
|
|
|
|
buttonStyles: {
|
|
|
|
iconStyle: toolbarButtonIcon,
|
|
|
|
style: toolbarButton
|
|
|
|
},
|
2018-05-15 11:18:42 +00:00
|
|
|
|
2019-07-12 08:32:47 +00:00
|
|
|
buttonStylesBorderless: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
|
|
|
...toolbarButton,
|
|
|
|
backgroundColor: 'transparent'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
/**
|
|
|
|
* Overrides to the standard styles that we apply to the chat button, as
|
|
|
|
* that behaves slightly differently to other buttons.
|
|
|
|
*/
|
|
|
|
chatButtonOverride: {
|
|
|
|
toggled: {
|
|
|
|
backgroundColor: ColorPalette.blue
|
|
|
|
}
|
|
|
|
},
|
2018-05-15 11:18:42 +00:00
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
hangupButtonStyles: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
|
|
|
...toolbarButton,
|
2019-07-12 08:32:47 +00:00
|
|
|
backgroundColor: schemeColor('hangup')
|
2019-01-22 10:35:28 +00:00
|
|
|
},
|
|
|
|
underlayColor: ColorPalette.buttonUnderlay
|
|
|
|
},
|
2019-01-13 19:34:38 +00:00
|
|
|
|
2019-01-22 10:35:28 +00:00
|
|
|
/**
|
|
|
|
* Styles for toggled buttons in the toolbar.
|
|
|
|
*/
|
|
|
|
toggledButtonStyles: {
|
|
|
|
iconStyle: whiteToolbarButtonIcon,
|
|
|
|
style: {
|
|
|
|
...whiteToolbarButton,
|
|
|
|
borderColor: schemeColor('buttonToggledBorder'),
|
|
|
|
borderWidth: 1
|
|
|
|
}
|
2019-01-13 19:34:38 +00:00
|
|
|
}
|
|
|
|
});
|