diff options
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r-- | src/client/views/DocumentButtonBar.tsx | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index f14fd033b..ea859a1e5 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -265,24 +265,64 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => ( @computed get keywordButton() { + const targetDoc = this.view0?.Document; + + const metaBtn = (name: string, icon: IconProp) => { + const tooltip = `Toggle ${name}`; + return ( + <Tooltip title={<div className="dash-tooltip">{tooltip}</div>}> + <div className="documentButtonBar-pinIcon"> + <FontAwesomeIcon + className="documentdecorations-icon" + style={{ width: 20 }} + key={icon.toString()} + size="sm" + icon={icon} + onClick={e => { + // console.log('wtfff') + // name === 'tags' ?? + if (name === 'tags'){ + undoable(e => (targetDoc && (targetDoc[DocData].showIconTags = !targetDoc[DocData].showIconTags)), 'show icon tags') + } else { + undoable(e => { + const showing = DocumentView.Selected().some(dv => dv.layoutDoc._layout_showTags); + DocumentView.Selected().forEach(dv => { + dv.layoutDoc._layout_showTags = !showing; + if (e.shiftKey) + DocListCast(dv.Document[Doc.LayoutFieldKey(dv.Document) + '_annotations']).forEach(doc => { + if (doc.face) doc.hidden = showing; + }); + }); + }, 'show Doc tags') + } + + + + + }} + /> + </div> + </Tooltip> + ); + }; + + + + return !DocumentView.Selected().length ? null : ( - <Tooltip title={<div className="dash-keyword-button">Open keyword menu</div>}> - <div - className="documentButtonBar-icon" - style={{ color: 'white' }} - onClick={undoable(e => { - const showing = DocumentView.Selected().some(dv => dv.layoutDoc._layout_showTags); - DocumentView.Selected().forEach(dv => { - dv.layoutDoc._layout_showTags = !showing; - if (e.shiftKey) - DocListCast(dv.Document[Doc.LayoutFieldKey(dv.Document) + '_annotations']).forEach(doc => { - if (doc.face) doc.hidden = showing; - }); - }); - }, 'show Doc tags')}> + <div className='documentButtonBar-icon'> + <div className="documentButtonBar-pinTypes" style = {{width: '40px'}}> + {metaBtn('tags', 'star')} + {metaBtn("keywords", 'id-card')} + </div> + + <Tooltip title={<div className="dash-keyword-button">Open keyword / icon tag menu</div>}> + <div className="documentButtonBar-icon" style={{ color: 'white' }}> <FontAwesomeIcon className="documentdecorations-icon" icon="tag" /> </div> </Tooltip> + </div> + ); } |