From fdb9d2530042c68fa659c8f69f6bf8e42e7cc7a3 Mon Sep 17 00:00:00 2001 From: hexxa Date: Sat, 27 Nov 2021 17:59:53 +0800 Subject: [PATCH] fix(root_frame): fix tabs issues in the root_frame --- public/static/css/white.css | 12 +++- .../web/src/components/control/tabs.tsx | 15 +++-- src/client/web/src/components/core_state.ts | 13 +++- src/client/web/src/components/pane_admin.tsx | 2 +- src/client/web/src/components/root_frame.tsx | 62 ++++++++++--------- .../web/src/components/state_updater.ts | 6 +- src/client/web/src/i18n/en_US.ts | 3 + src/client/web/src/i18n/zh_CN.ts | 3 + 8 files changed, 77 insertions(+), 39 deletions(-) diff --git a/public/static/css/white.css b/public/static/css/white.css index 92e3404..dde605e 100644 --- a/public/static/css/white.css +++ b/public/static/css/white.css @@ -78,7 +78,7 @@ /* padding: 1rem; */ } -#browser .container { +.container { width: 100%; color: #34495e; background-color: white; @@ -175,6 +175,16 @@ margin: auto 1rem auto auto; } +.theme-default .float-l { + display: inline-block; + margin: auto 1rem auto auto; +} + +.theme-default .float-r { + display: inline-block; + margin: auto auto 1rem 1rem; +} + .theme-default .float-input { display: inline-block; margin: auto 1rem 1rem auto; diff --git a/src/client/web/src/components/control/tabs.tsx b/src/client/web/src/components/control/tabs.tsx index 87b8be8..e8005cf 100644 --- a/src/client/web/src/components/control/tabs.tsx +++ b/src/client/web/src/components/control/tabs.tsx @@ -37,34 +37,37 @@ export class Tabs extends React.Component { if (!updater().setControlOption(targetControl, targetOption)) { alertMsg(this.props.msg.pkg.get("op.fail")); } + this.props.update(updater().updateUI); }; render() { const displaying = this.props.ui.control.controls.get( this.props.targetControl ); + const options = this.props.ui.control.options.get(this.props.targetControl); - const tabs = options.map((option: string, targetControl: string) => { + const tabs = options.map((option: string) => { const iconProps = this.props.tabIcons.has(option) ? this.props.tabIcons.get(option) : defaultIconProps; - // , const icon = getIcon(iconProps.name, iconProps.size, iconProps.color); return (