!84 资源管理器对话框UI优化

Merge pull request !84 from 肖诗雅/SourceManageDialog
pull/84/MERGE
肖诗雅 6 years ago committed by ChenX
parent 5c5d2a2518
commit ace00b4b8a

@ -34,6 +34,8 @@ export class FileItem extends React.Component<FileItemProps, FileItemState>{
const inputStyle: React.CSSProperties = { const inputStyle: React.CSSProperties = {
outline: "none", outline: "none",
border: "none", border: "none",
backgroundColor: '#30404d',
color: '#ffffff',
fontSize: "17px", fontSize: "17px",
fontWeight: "bold" fontWeight: "bold"
} }
@ -46,7 +48,7 @@ export class FileItem extends React.Component<FileItemProps, FileItemState>{
className="bp3-card bp3-elevation-0" className="bp3-card bp3-elevation-0"
style={{ style={{
display: "flex", display: "flex",
width: "100%", // width: "100%",
padding: "10px" padding: "10px"
}} }}
> >

@ -12,7 +12,7 @@ import { FileItem } from './FileItem';
interface FileProps interface FileProps
{ {
isShow: boolean, // isShow: boolean,
callback?: Function callback?: Function
} }
@ -190,8 +190,10 @@ export class FilePanel extends React.Component<FileProps, FileState>
className="bp3-card bp3-elevation-0" className="bp3-card bp3-elevation-0"
style={ style={
{ {
display: this.props.isShow ? "block" : "none", display: "flex",
width: "80%", // width: "100%",
height: "100%",
flexDirection: "column",
} }
}> }>
<nav className="bp3-navbar bp3-card bp3-elevation-0 .modifier"> <nav className="bp3-navbar bp3-card bp3-elevation-0 .modifier">
@ -231,13 +233,18 @@ export class FilePanel extends React.Component<FileProps, FileState>
value={this.seachString} value={this.seachString}
/> />
</div> </div>
</nav> </nav>
<ul className="ul-unstyle" <ul className="ul-unstyle"
ref={this.filesRef} ref={this.filesRef}
style={ style={
{ {
overflow: "auto", overflow: "auto",
height: 580 height: 580,
border: "1px solid #0e2535",
borderRadius: "3px",
flexBasis: 0,
flexGrow: 1
} }
} }
> >

@ -2,7 +2,7 @@ import * as React from 'react';
interface MaterialProps interface MaterialProps
{ {
isShow: boolean; // isShow: boolean;
} }
/** /**
* *
@ -27,8 +27,8 @@ export class MaterialPanel extends React.Component<MaterialProps, {}>
className="bp3-card bp3-elevation-0" className="bp3-card bp3-elevation-0"
style={ style={
{ {
display: this.props.isShow ? "block" : "none", // display: this.props.isShow ? "block" : "none",
width: "80%", display: "block",
overflow: "auto" overflow: "auto"
} }
}> }>

@ -1,4 +1,4 @@
import { Button, Dialog } from '@blueprintjs/core'; import { Button, Dialog, Tab, Tabs, TabId } from '@blueprintjs/core';
import * as React from 'react'; import * as React from 'react';
import { FilePanel } from './FilePanel'; import { FilePanel } from './FilePanel';
@ -14,6 +14,19 @@ export interface SoucePanelState
{ {
showIndex: number; showIndex: number;
} }
const TexturePanel: React.SFC<{}> = () => (
//todo
<h5></h5>
);
const ModelPanel: React.SFC<{}> = () => (
//todo
<h5></h5>
);
/** /**
* *
* TODO: * TODO:
@ -22,13 +35,16 @@ export interface SoucePanelState
* @class SoucePanel * @class SoucePanel
* @extends {React.Component<SoucePanelProps, SoucePanelState>} * @extends {React.Component<SoucePanelProps, SoucePanelState>}
*/ */
export default class SoucePanel extends React.Component<SoucePanelProps, SoucePanelState> { export default class SoucePanel extends React.Component<SoucePanelProps, SoucePanelState> {
ref: React.RefObject<HTMLDivElement>;
constructor(props: SoucePanelProps) constructor(props: SoucePanelProps)
{ {
super(props); super(props);
this.state = { this.state = {
showIndex: 0 showIndex: 0
} }
this.ref = React.createRef();
} }
handleClick = (i: number) => handleClick = (i: number) =>
{ {
@ -36,14 +52,22 @@ export default class SoucePanel extends React.Component<SoucePanelProps, SoucePa
showIndex: i showIndex: i
}) })
} }
componentDidMount()
{
}
componentDidUpdate()
{
}
render() render()
{ {
const DialogStyle: React.CSSProperties = { const DialogStyle: React.CSSProperties = {
position: "absolute", position: "absolute",
top: 0, top: 0,
width: "80%", width: "48%",
height: window.innerHeight - 150, minWidth: 725
minWidth: 755
} }
return ( return (
<Dialog <Dialog
@ -52,47 +76,35 @@ export default class SoucePanel extends React.Component<SoucePanelProps, SoucePa
onClose={() => this.props.handleClose()} onClose={() => this.props.handleClose()}
title="资源管理器" title="资源管理器"
style={DialogStyle} style={DialogStyle}
onOpening={() =>
{
this.ref.current.parentElement.className = "bp3-dark bp3-dialog"
}}
> >
<div <div
className="bp3-dialog-body" ref={this.ref}
className="souce-panel bp3-dialog-body"
style={{ style={{
display: "flex", display: "flex",
justifyContent: "space-between" justifyContent: "space-between"
}}> }}>
<div style={
{ <Tabs
width: "20%" id="Tabs"
} vertical={true}
}>
<div
className="bp3-card bp3-elevation-0 bp3-interactive"
onClick={() => this.handleClick(0)}
>
<h5></h5>
</div>
<div
className="bp3-card bp3-elevation-0 bp3-interactive"
onClick={() => this.handleClick(1)}
>
<h5></h5>
</div>
<div
className="bp3-card bp3-elevation-0 bp3-interactive"
onClick={() => this.handleClick(2)}
>
<h5></h5>
</div>
<div
className="bp3-card bp3-elevation-0 bp3-interactive"
onClick={() => this.handleClick(3)}
> >
<h5></h5> <Tab id="fl" title="我的文件" panel={<FilePanel callback={this.props.handleClose} />} />
</div> <Tab id="mt" title="我的材质" panel={<MaterialPanel />} />
</div> <Tab id="tt" title="我的贴图" panel={<TexturePanel />} />
{/* TODO:相应数据传入 */} <Tab id="md" title="我的模型" panel={<ModelPanel />} />
</Tabs>
{/* TODO:
<FilePanel isShow={this.state.showIndex === 0} callback={this.props.handleClose} /> <FilePanel isShow={this.state.showIndex === 0} callback={this.props.handleClose} />
<MaterialPanel isShow={this.state.showIndex === 1} /> <MaterialPanel isShow={this.state.showIndex === 1} /> */}
</div> </div>
<div className="bp3-dialog-footer"> <div className="bp3-dialog-footer">
<div className="bp3-dialog-footer-actions"> <div className="bp3-dialog-footer-actions">
<Button <Button

@ -441,3 +441,16 @@ img {
.button-marign { .button-marign {
margin-right: 10px; margin-right: 10px;
} }
/****************修改蓝图源码*********************/
.souce-panel{
.bp3-tabs,.bp3-tab-panel{
width: 100%;
}
}
.bp3-dialog-container
{
align-content: stretch;
align-items: stretch;
}

Loading…
Cancel
Save