Skip to content

TagSpaces is an offline, open source, document manager with tagging support

added transparent background to various components

Ilian Sapundshiev0de872468c42
diff --git a/app/components/TransparentBackground.js b/app/components/TransparentBackground.js
index bf6397fea..b9176f9ec 100644
--- a/app/components/TransparentBackground.js
+++ b/app/components/TransparentBackground.js
@@ -23,12 +23,12 @@ type Props = {
};
const TransparentBackground = (props: Props) => (
- <div style={{
+ <span style={{
background: 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==")'
}}
>
{props.children}
- </div>
+ </span>
);
export default TransparentBackground;
diff --git a/app/components/dialogs/CreateTagGroupDialog.js b/app/components/dialogs/CreateTagGroupDialog.js
index 7cf9c7c78..7ccc9d5b9 100644
--- a/app/components/dialogs/CreateTagGroupDialog.js
+++ b/app/components/dialogs/CreateTagGroupDialog.js
@@ -29,6 +29,7 @@ import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import ColorPickerDialog from './ColorPickerDialog';
import { type TagGroup } from '../../reducers/taglibrary';
import i18n from '../../services/i18n';
+import TransparentBackground from '../TransparentBackground';
type Props = {
open?: boolean,
@@ -125,7 +126,7 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
renderContent = () => {
const styles = {
color: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -134,7 +135,7 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
background: this.state.color
},
textcolor: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -177,13 +178,15 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagBackgroundColorPicker}
- data-tid="createTagGroupBackgroundColor"
- style={styles.color}
- role="presentation"
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagBackgroundColorPicker}
+ data-tid="createTagGroupBackgroundColor"
+ style={styles.color}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayColorPicker}
setColor={this.handleChangeColor}
@@ -195,13 +198,15 @@ class CreateTagGroupDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagTextColorPicker}
- data-tid="createTagGroupForegroundColor"
- style={styles.textcolor}
- role="presentation"
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagTextColorPicker}
+ data-tid="createTagGroupForegroundColor"
+ style={styles.textcolor}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayTextColorPicker}
setColor={this.handleChangeTextColor}
diff --git a/app/components/dialogs/EditTagDialog.js b/app/components/dialogs/EditTagDialog.js
index b5af97fc9..2996e3d4c 100644
--- a/app/components/dialogs/EditTagDialog.js
+++ b/app/components/dialogs/EditTagDialog.js
@@ -28,6 +28,7 @@ import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import ColorPickerDialog from './ColorPickerDialog';
+import TransparentBackground from '../TransparentBackground';
import i18n from '../../services/i18n';
import { type Tag, type TagGroup } from '../../reducers/taglibrary';
@@ -139,7 +140,7 @@ class EditTagDialog extends React.Component<Props, State> {
const styles = {
color: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -149,7 +150,7 @@ class EditTagDialog extends React.Component<Props, State> {
background: color,
},
textcolor: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -193,13 +194,15 @@ class EditTagDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagBackgroundColorPicker}
- data-tid="tagBackgroundColorEditTagDialog"
- style={styles.color}
- role="presentation"
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagBackgroundColorPicker}
+ data-tid="tagBackgroundColorEditTagDialog"
+ style={styles.color}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayColorPicker}
setColor={this.handleChangeColor}
@@ -211,13 +214,15 @@ class EditTagDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagTextColorPicker}
- data-tid="tagForegroundColorEditTagDialog"
- style={styles.textcolor}
- role="presentation"
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagTextColorPicker}
+ data-tid="tagForegroundColorEditTagDialog"
+ style={styles.textcolor}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayTextColorPicker}
setColor={this.handleChangeTextColor}
diff --git a/app/components/dialogs/EditTagGroupDialog.js b/app/components/dialogs/EditTagGroupDialog.js
index 11e4f6f7a..d5d2a67ce 100644
--- a/app/components/dialogs/EditTagGroupDialog.js
+++ b/app/components/dialogs/EditTagGroupDialog.js
@@ -31,6 +31,7 @@ import GenericDialog, { onEnterKeyHandler } from './GenericDialog';
import ColorPickerDialog from './ColorPickerDialog';
import { type TagGroup } from '../../reducers/taglibrary';
import i18n from '../../services/i18n';
+import TransparentBackground from '../TransparentBackground';
type Props = {
open?: boolean,
@@ -148,7 +149,7 @@ class EditTagGroupDialog extends React.Component<Props, State> {
const { color, textcolor, modifiedDate } = this.state;
const styles = {
color: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -158,7 +159,7 @@ class EditTagGroupDialog extends React.Component<Props, State> {
background: color
},
textcolor: {
- width: 100,
+ width: '100%',
height: 30,
borderRadius: 2,
borderWidth: 1,
@@ -202,12 +203,14 @@ class EditTagGroupDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagBackgroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagBackgroundColorPicker}
- data-tid="editTagGroupBackgroundColor"
- style={styles.color}
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagBackgroundColorPicker}
+ data-tid="editTagGroupBackgroundColor"
+ style={styles.color}
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayColorPicker}
setColor={this.handleChangeColor}
@@ -219,13 +222,15 @@ class EditTagGroupDialog extends React.Component<Props, State> {
fullWidth={true}
>
<FormHelperText style={styles.helpText}>{i18n.t('core:tagForegroundColor')}</FormHelperText>
- <Button
- onClick={this.toggleDefaultTagTextColorPicker}
- data-tid="editTagGroupForegroundColor"
- style={styles.textcolor}
- role="presentation"
- >&nbsp;
- </Button>
+ <TransparentBackground>
+ <Button
+ onClick={this.toggleDefaultTagTextColorPicker}
+ data-tid="editTagGroupForegroundColor"
+ style={styles.textcolor}
+ role="presentation"
+ >&nbsp;
+ </Button>
+ </TransparentBackground>
<ColorPickerDialog
open={this.state.displayTextColorPicker}
setColor={this.handleChangeTextColor}
diff --git a/app/components/settings/SettingsFileTypes.js b/app/components/settings/SettingsFileTypes.js
index 9643bc460..bcd36aebd 100644
--- a/app/components/settings/SettingsFileTypes.js
+++ b/app/components/settings/SettingsFileTypes.js
@@ -33,6 +33,7 @@ import { findAvailableExtensions } from '../../reducers/app';
import { sortBy } from '../../utils/misc';
import i18n from '../../services/i18n';
import AppConfig from '../../config';
+import TransparentBackground from '../TransparentBackground';
const styles = theme => ({
root: {
@@ -206,20 +207,22 @@ class SettingsFileTypes extends Component<Props, State> {
</FormControl>
<FormControl className={classes.fileTypeColorDialogButton}>
- <Button
- data-tid={'settingsFileTypes_openColorPicker_'}
- className={classes.colorChooserButton}
- style={{
- backgroundColor: `${item.color}`,
- minWidth: '100px',
- cursor: 'pointer',
- }}
- onClick={() => {
- this.openColorPicker(item);
- }}
- >&nbsp;
- <div style={styles.color} />
- </Button>
+ <TransparentBackground>
+ <Button
+ data-tid={'settingsFileTypes_openColorPicker_'}
+ className={classes.colorChooserButton}
+ style={{
+ backgroundColor: `${item.color}`,
+ minWidth: '100px',
+ cursor: 'pointer',
+ }}
+ onClick={() => {
+ this.openColorPicker(item);
+ }}
+ >&nbsp;
+ <div style={styles.color} />
+ </Button>
+ </TransparentBackground>
</FormControl>
<IconButton