보조지표 전체보기 후 복귀버튼 추가
This commit is contained in:
@@ -6,6 +6,7 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import type { IndicatorConfig } from '../types';
|
||||
import { ChartManager } from '../utils/ChartManager';
|
||||
import { getPaneHostId } from '../utils/indicatorPaneMerge';
|
||||
import { isIndicatorPaneFocused, resolveFocusedPaneLayoutId } from '../utils/indicatorPaneFocus';
|
||||
import { buildPaneItems, resolvePaneItemLayout } from './paneLegendLayout';
|
||||
import { PAPER_OVERLAY_MENU_TITLE } from '../utils/paperChartOverlayVisibility';
|
||||
|
||||
@@ -154,8 +155,8 @@ function buildMenuItems(
|
||||
const itemHostId = getPaneHostId(item.id, indicators);
|
||||
const isMergedPane = samePaneItems.length > 1;
|
||||
const showSplit = isMergedPane && item.id === itemHostId && !!opts.onSplit;
|
||||
const isFocused = opts.focusedId === item.id;
|
||||
const showExpand = !!(opts.onExpand || (isFocused && opts.onRestore));
|
||||
const isFocused = isIndicatorPaneFocused(item.id, opts.focusedId, indicators);
|
||||
const showExpand = !!(opts.onExpand || (opts.focusedId && opts.onRestore));
|
||||
const done = opts.onDone ?? (() => {});
|
||||
const cfg = indicators.find(ind => ind.id === item.id);
|
||||
const isHidden = cfg?.hidden === true;
|
||||
@@ -302,6 +303,17 @@ const ChartRightToolbar: React.FC<ChartRightToolbarProps> = ({
|
||||
const showOverlayMenu = !!(candleOverlayToggles?.length && candlePane && onToggleCandleOverlay);
|
||||
const overlayMenuOpen = openMenuId === CANDLE_OVERLAY_MENU_ID;
|
||||
|
||||
const focusedLayoutId = focusedId
|
||||
? resolveFocusedPaneLayoutId(focusedId, indicators)
|
||||
: null;
|
||||
const focusedPaneLayout = focusedLayoutId
|
||||
? (() => {
|
||||
const item = paneItems.find(p => isIndicatorPaneFocused(p.id, focusedId, indicators));
|
||||
if (item) return resolvePaneItemLayout(manager, item);
|
||||
return manager.getIndicatorPaneScreenLayout(focusedLayoutId);
|
||||
})()
|
||||
: null;
|
||||
|
||||
const overlayMenuItems: MenuItemDef[] = showOverlayMenu
|
||||
? candleOverlayToggles!.map(item => ({
|
||||
key: item.key,
|
||||
@@ -320,6 +332,22 @@ const ChartRightToolbar: React.FC<ChartRightToolbarProps> = ({
|
||||
className="chart-right-toolbar-inner"
|
||||
style={{ height: Math.max(innerHeight, chartHeight) }}
|
||||
>
|
||||
{focusedId && onRestore && focusedPaneLayout && (
|
||||
<div
|
||||
className="chart-right-toolbar-cluster chart-right-toolbar-cluster--focus-restore"
|
||||
style={{ top: focusedPaneLayout.topY + 4 }}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className="tv-side-btn chart-right-toolbar-btn chart-right-toolbar-btn--restore active"
|
||||
title="기본 보기로 복원 (모든 보조지표 표시)"
|
||||
onClick={e => { e.stopPropagation(); onRestore(); }}
|
||||
>
|
||||
<IconRestore />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{showOverlayMenu && (
|
||||
<div
|
||||
className="chart-right-toolbar-cluster chart-right-toolbar-cluster--overlay"
|
||||
|
||||
Reference in New Issue
Block a user