Commit c926b8af authored by 秦文海's avatar 秦文海

chore: 返回窗口样式

parent db729342
...@@ -20,13 +20,13 @@ const Header = (props) => { ...@@ -20,13 +20,13 @@ const Header = (props) => {
let name; let name;
setShowIcon(!icon); setShowIcon(!icon);
showIcon ? (name = 'large') : (name = 'middle'); showIcon ? (name = 'large') : (name = 'middle');
changeStyle({ name }); let windowStyle = changeStyle({ name });
windowChange({ name }); windowChange({ name, ...windowStyle });
}; };
const getWindowStatus = (flag) => { const getWindowStatus = (flag) => {
setWindowStatus(flag); setWindowStatus(flag);
changeScale(flag); let scaleStyle = changeScale(flag);
smallChange({ flag }); smallChange({ flag, ...scaleStyle });
}; };
const iconStyle = () => { const iconStyle = () => {
if (windowStatus) { if (windowStatus) {
......
...@@ -34,7 +34,7 @@ const TipTool = (props) => { ...@@ -34,7 +34,7 @@ const TipTool = (props) => {
}; };
const [styleState, setStyleState] = useState(data); const [styleState, setStyleState] = useState(data);
const [styleScale, setScaleState] = useState(scale); const [styleScale, setScaleState] = useState(scale);
const changeStyle = ({ name, flag }) => { const changeStyle = ({ name }) => {
let data = styleState.slice(); let data = styleState.slice();
data.map((item) => { data.map((item) => {
if (name == item.name) { if (name == item.name) {
...@@ -44,12 +44,18 @@ const TipTool = (props) => { ...@@ -44,12 +44,18 @@ const TipTool = (props) => {
} }
}); });
setStyleState(data); setStyleState(data);
return data
.filter((item) => item.active)
.map(({ width, height }) => {
return { width, height };
})[0];
}; };
const changeScale = (flag) => { const changeScale = (flag) => {
let obj = { ...styleScale }; let obj = { ...styleScale };
obj.active = flag; obj.active = flag;
setScaleState(obj); setScaleState(obj);
return { height: obj.height, width: obj.width };
}; };
const computedStyle = () => { const computedStyle = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment