!650 使colorList变得好选

pull/650/MERGE
肖诗雅 5 years ago committed by ChenX
parent bbda2d0a14
commit b5f211b37c

@ -10,7 +10,7 @@ import { EntityStore } from '../../Store/EntityStore';
export const ColorItem = (props: { className: string, text: string, style?: React.CSSProperties, value?: number; }) => export const ColorItem = (props: { className: string, text: string, style?: React.CSSProperties, value?: number; }) =>
<li value={props.value}> <li value={props.value}>
<i style={props.style} className={props.className}></i> <i style={props.style} className={props.className}></i>
<span>{props.text}</span> <span style={{ pointerEvents: "none" }}>{props.text}</span>
</li>; </li>;
export const ColorStyle: [string, number][] = [ export const ColorStyle: [string, number][] = [
@ -98,7 +98,7 @@ export class ColorModal extends React.Component<{ store?: EntityStore; }, {}>
> >
<ColorItem <ColorItem
style={ style={
store.colorSet.size > 1 ? null : { background: ColorMaterial.GetColor(store.colorIndex).getStyle() } store.colorSet.size > 1 ? null : { background: ColorMaterial.GetColor(store.colorIndex).getStyle(), pointerEvents: "none" }
} }
className="i-color" className="i-color"
text={store.colorIndex <= 7 ? ColorStyle[store.colorIndex][0] : store.colorIndex.toString()} text={store.colorIndex <= 7 ? ColorStyle[store.colorIndex][0] : store.colorIndex.toString()}
@ -125,7 +125,7 @@ export class ColorModal extends React.Component<{ store?: EntityStore; }, {}>
<ColorItem <ColorItem
key={color} key={color}
style={ style={
{ background: ColorMaterial.GetColor(color).getStyle() } { background: ColorMaterial.GetColor(color).getStyle(), pointerEvents: "none" }
} }
value={color} value={color}
className="i-color" className="i-color"

@ -61,7 +61,12 @@
justify-content: space-between; justify-content: space-between;
border: 1px ridge transparent; border: 1px ridge transparent;
&:hover{ &:hover{
border: 1px ridge #394b59; border: 1px ridge #8A9BA8;
background: #BFCCD6;
cursor: pointer;
}
>li{
pointer-events: none;
} }
} }
>li{ >li{
@ -69,8 +74,13 @@
width: 100%; width: 100%;
} }
>ul{//.props-color-list >ul{//.props-color-list
outline: none;
background: none !important;
>li{ >li{
padding: 5px 0 0 0 !important; padding: 5px 0 0 0 !important;
&:hover{
background: #BFCCD6 !important;
}
} }
} }
} }

@ -57,6 +57,7 @@ export class Properties_DimPanel extends React.Component<Properties_DimPanelProp
} }
private Dim_UseDefault(als: AlignedDimension[]) private Dim_UseDefault(als: AlignedDimension[])
{ {
let propsStore = PropertiesStore.GetInstance() as PropertiesStore;
CommandWrap(() => CommandWrap(() =>
{ {
this.dim_TextSize = 60; this.dim_TextSize = 60;
@ -67,6 +68,8 @@ export class Properties_DimPanel extends React.Component<Properties_DimPanelProp
al.LeadOutOffsetX = 30; al.LeadOutOffsetX = 30;
al.LeadOutVisible = true; al.LeadOutVisible = true;
al.LeadOutFlipped = false; al.LeadOutFlipped = false;
al.ColorIndex = 7;
propsStore.colorIndex = 7;//todo 撤销的时候UI颜色没有同步更改
this.numericInputVal = "60"; this.numericInputVal = "60";
// this.dim_InputEl.setState({ value: "60" }); // this.dim_InputEl.setState({ value: "60" });
} }
@ -234,7 +237,7 @@ export class Properties_DimPanel extends React.Component<Properties_DimPanelProp
</div> </div>
</li> </li>
<li> <li>
<Button className={Classes.INTENT_WARNING} text="重置为默认" minimal small onClick={() => this.Dim_UseDefault(ents)} /> <Button className={Classes.INTENT_WARNING} text="重置标注为默认" minimal small onClick={() => this.Dim_UseDefault(ents)} />
</li> </li>
</ul> </ul>
</Card> </Card>

Loading…
Cancel
Save