좌측 패널 — 페이지와 레이어를 두 구획으로 가른다
레이어 탭 하나에 페이지 마디와 컨트롤이 한 시퀀스로 섞여 있었다. 페이지를 추가·복제·삭제하는 조작이 컨트롤을 눈으로 찾는 일과 같은 목록에서 경쟁했다. 위는 페이지, 아래는 레이어로 나눈다. 페이지 행을 누르면 그 페이지를 활성화한다 — 캔버스가 거기로 스크롤하고 인스펙터가 용지 속성을 연다. 경로는 이미 있던 ActivatePage 그대로다. 강조는 ListBox 의 IsSelected 가 아니라 IsCurrent 가 그린다 (레이어 행이 Highlight 3상태로 그리는 것과 같은 규율 — 두 강조가 겹치면 어느 쪽이 진짜인지 모른다). 트리는 그 페이지로 좁히지 않는다. 세 가지가 거기 걸려 있다: 레이어 검색이 문서 전체를 훑는 성질, 그룹 강조가 페이지를 넘나드는 멤버까지 집계해야 폴더가 파래지는 것, 그리고 캔버스가 전 페이지를 세로로 이어 그리므로 트리만 한 장으로 좁으면 두 뷰의 1:1 대응이 깨진다는 것. 좁히고 싶으면 페이지 접기가 이미 있고 그건 명시적이다. 트리의 페이지 마디는 장수로 갈린다. · 한 장이면 아예 없앤다 — 모든 컨트롤이 그 페이지 소속이라 정보가 0 이고, 최상위가 들여쓰기 없이 바로 보인다. 실사용 문서 대부분이 여기다. · 두 장 이상이면 남기되 경계 구분자로 줄인다(높이 20, 회색, 개수·복제·삭제 없음). 통째로 빼면 안 되는 이유가 있다 — 페이지 행이 항상 무강조라서 연속 선택 블록이 페이지 경계에서 저절로 끊기는데, 빼면 앞 페이지 마지막 컨트롤과 뒷 페이지 첫 컨트롤이 하나의 파란 띠로 붙는다. 들여쓰기 상수를 계산값으로 바꿨다. 페이지 마디가 없으면 들여쓸 이유도 없다 — 페이지 직속 12→0, 그룹 멤버 32→20. 트리 맨 아래 '페이지 추가' 행은 없앴다. 페이지 구획 머리의 + 가 그 자리다. 목록 안에 조작 행이 섞여 있으면 스크롤 끝까지 가야 눌 수 있다. 페이지 목록은 5행까지 보이고 그 뒤로는 목록 안에서만 스크롤한다 — 7장짜리 문서에서도 레이어 트리가 밀려나지 않는다. 트리는 남은 영역을 그대로 차지해 가상화를 유지한다. 이름 변경과 순서 변경은 넣지 않았다. FormPage 에 이름 필드가 없고 유일한 식별자인 Root.Id 는 E_SctMst 사전 매핑에 물려 있어 개명이 위험하다. 페이지 이동 API 도 없다(Pages 조작은 통째 재생성뿐). 표시 전용 이름을 새로 만들면 레거시 XML 에 담을 곳이 없어 왕복 diff 0 불변식과 충돌한다. 새 스타일 3종(SectionHead / SectionHeadText / PageRowItem). 구획 머리의 아래 1px 선은 필수다 — 라이트에서 B.PanelHeader(#FAFAFA)와 B.Panel(#FFFFFF)이 1.02:1 이라 배경만으로는 경계가 안 보인다. 게이트: 테스트 267/267, --edit-smoke 236건 0실패(레이어 단언 5건 갱신), --query-popup 17/17, --maxrect 10/10, --db-smoke 3000 diff 0·예외 0, --db-render P062 md5 8d683835f5d81e7bb41c79071d6bf954 동일, --dialog-shots 57파일. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e82d520de6
commit
6ee4435575
@@ -23,7 +23,68 @@
|
||||
<ctl:IconSpecConverter x:Key="IconSpec"/>
|
||||
<BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
|
||||
</UserControl.Resources>
|
||||
<DockPanel>
|
||||
<!--
|
||||
두 구획으로 나눈다 — 위는 페이지, 아래는 레이어.
|
||||
페이지 조작(추가·복제·삭제·활성화)이 트리 안에 섞여 있으면 컨트롤을 찾는 눈과 경쟁한다.
|
||||
페이지 행을 누르면 캔버스가 그 페이지로 스크롤한다(ActivatePage).
|
||||
트리는 좁히지 않는다 — 검색이 문서 전체를 훑는 성질과 그룹의 페이지 횡단 집계가 거기 걸려 있다.
|
||||
-->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ══ 페이지 ══ -->
|
||||
<DockPanel Grid.Row="0">
|
||||
<Border DockPanel.Dock="Top" Style="{StaticResource SectionHead}">
|
||||
<DockPanel>
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Subtle}" Width="24" Height="22" Padding="0"
|
||||
Click="OnPageAddClick" ToolTip="페이지 추가" AutomationProperties.Name="페이지 추가"
|
||||
Content="{Binding Source=plus, Converter={StaticResource IconName}, ConverterParameter=14|B.Muted}"/>
|
||||
<TextBlock Style="{StaticResource SectionHeadText}" Text="페이지"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<!-- 5행까지 보이고 그 뒤로는 이 목록 안에서만 스크롤한다 — 레이어 트리를 밀어내면 안 된다 -->
|
||||
<ListBox x:Name="PageListBox" ItemsSource="{Binding CurrentDesigner.PageRows}"
|
||||
MaxHeight="134" Padding="2,3" BorderThickness="0" Background="Transparent"
|
||||
ItemContainerStyle="{StaticResource PageRowItem}"
|
||||
PreviewMouseLeftButtonDown="OnPageRowPressed"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Height="22">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"
|
||||
Style="{StaticResource LayerRowActions}">
|
||||
<Button Style="{StaticResource Subtle}" Width="24" Height="20" Padding="0"
|
||||
Margin="1,0,0,0" Click="OnPageDuplicateClick" ToolTip="페이지 복제"
|
||||
Content="{Binding Source=copy, Converter={StaticResource IconName}, ConverterParameter=13|B.Muted}"/>
|
||||
<Button Style="{StaticResource Subtle}" Width="24" Height="20" Padding="0"
|
||||
Margin="1,0,0,0" Click="OnPageDeleteClick" ToolTip="페이지 삭제"
|
||||
Visibility="{Binding CanDelete, Converter={StaticResource BoolToVisibility}}"
|
||||
Content="{Binding Source=trash-2, Converter={StaticResource IconName}, ConverterParameter=13|B.Muted}"/>
|
||||
</StackPanel>
|
||||
<ContentControl DockPanel.Dock="Left" Margin="2,0,6,0" VerticalAlignment="Center"
|
||||
IsTabStop="False" Focusable="False"
|
||||
Content="{Binding PageIconSpec, Converter={StaticResource IconSpec}}"/>
|
||||
<TextBlock DockPanel.Dock="Right" Text="{Binding CountText}" FontSize="11" Margin="6,0,4,0"
|
||||
VerticalAlignment="Center" Foreground="{DynamicResource B.Muted}"/>
|
||||
<TextBlock Text="{Binding Title}" VerticalAlignment="Center" FontSize="12"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DockPanel>
|
||||
|
||||
<Border Grid.Row="1" Height="1" Background="{DynamicResource B.Line}"/>
|
||||
|
||||
<!-- ══ 레이어 ══ -->
|
||||
<DockPanel Grid.Row="2">
|
||||
<Border DockPanel.Dock="Top" Style="{StaticResource SectionHead}">
|
||||
<TextBlock Style="{StaticResource SectionHeadText}" Text="레이어"/>
|
||||
</Border>
|
||||
<!-- 검색줄 — 검색칩(가변폭) + 우측 타입 필터 버튼 2개 -->
|
||||
<DockPanel DockPanel.Dock="Top">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"
|
||||
@@ -131,30 +192,19 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DockPanel.Style>
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"
|
||||
Style="{StaticResource LayerRowActions}">
|
||||
<Button Style="{StaticResource Subtle}" Width="24" Height="22" Padding="0"
|
||||
Margin="1,0,0,0" Click="OnPageDuplicateClick" ToolTip="페이지 복제"
|
||||
Content="{Binding Source=copy, Converter={StaticResource IconName}, ConverterParameter=13|B.Muted}"/>
|
||||
<Button Style="{StaticResource Subtle}" Width="24" Height="22" Padding="0"
|
||||
Margin="1,0,0,0" Click="OnPageDeleteClick" ToolTip="페이지 삭제"
|
||||
Visibility="{Binding CanDelete, Converter={StaticResource BoolToVisibility}}"
|
||||
Content="{Binding Source=trash-2, Converter={StaticResource IconName}, ConverterParameter=13|B.Muted}"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ToggleButton Style="{StaticResource MiniChevron}" Width="18" Height="20"
|
||||
IsChecked="{Binding IsExpanded}" ToolTip="페이지 접기/펼치기"
|
||||
Content="{Binding ChevronSpec, Converter={StaticResource IconSpec}}"/>
|
||||
<ContentControl Margin="0,0,6,0" VerticalAlignment="Center" IsTabStop="False"
|
||||
Content="{Binding PageIconSpec, Converter={StaticResource IconSpec}}"/>
|
||||
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding CountText}" FontSize="11" Margin="6,0,0,0"
|
||||
VerticalAlignment="Center" Foreground="{DynamicResource B.Muted}"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="(비어 있음)" FontSize="11" Margin="20,1,0,0"
|
||||
Foreground="{DynamicResource B.Muted}"
|
||||
Visibility="{Binding IsEmpty, Converter={StaticResource BoolToVisibility}}"/>
|
||||
<!--
|
||||
페이지 조작은 전부 위쪽 페이지 구획으로 갔다. 여기 남은 것은
|
||||
경계 구분자다 — 연속 선택 블록이 페이지 경계에서 끊기게 하는 역할과
|
||||
페이지 접기(트리를 좁히는 유일한 수단)만 남긴다.
|
||||
-->
|
||||
<StackPanel Orientation="Horizontal" Height="20">
|
||||
<ToggleButton Style="{StaticResource MiniChevron}" Width="18" Height="18"
|
||||
IsChecked="{Binding IsExpanded}" ToolTip="페이지 접기/펼치기"
|
||||
Content="{Binding ChevronSpec, Converter={StaticResource IconSpec}}"/>
|
||||
<ContentControl Margin="0,0,5,0" VerticalAlignment="Center" IsTabStop="False"
|
||||
Content="{Binding Source=file-text, Converter={StaticResource IconName}, ConverterParameter=11|B.Muted}"/>
|
||||
<TextBlock Text="{Binding Title}" FontSize="11" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource B.Muted}"/>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
@@ -310,5 +360,6 @@
|
||||
IsHitTestVisible="False"
|
||||
Visibility="{Binding CurrentDesigner.IsLayerListEmpty, Converter={StaticResource BoolToVisibility}}"/>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -69,9 +69,6 @@ public partial class LayerPanelView : System.Windows.Controls.UserControl
|
||||
case LayerPageViewModel page:
|
||||
designer.ActivatePage(page.Page);
|
||||
break;
|
||||
case LayerAddPageViewModel:
|
||||
designer.AddPage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +113,28 @@ public partial class LayerPanelView : System.Windows.Controls.UserControl
|
||||
e.Handled = handled;
|
||||
}
|
||||
|
||||
/// <summary>페이지 구획의 + — 트리 안에 있던 '페이지 추가' 행을 대신한다</summary>
|
||||
private void OnPageAddClick(object sender, RoutedEventArgs e) => Designer?.AddPage();
|
||||
|
||||
/// <summary>
|
||||
/// 페이지 행 누름 — 그 페이지를 활성화한다(캔버스가 거기로 스크롤하고 인스펙터가 용지 속성을 연다).
|
||||
///
|
||||
/// ListBox 의 선택으로 처리하지 않는 이유: 복제·삭제 버튼을 눌러도 행 선택이 먼저 일어나
|
||||
/// 엉뚱한 페이지가 활성화된다. 눌린 지점이 버튼 위면 넘긴다.
|
||||
/// </summary>
|
||||
private void OnPageRowPressed(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is DependencyObject source
|
||||
&& FindAncestor<System.Windows.Controls.Primitives.ButtonBase>(source) is not null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (RowDataOf(e.OriginalSource) is LayerPageViewModel row)
|
||||
{
|
||||
Designer?.ActivatePage(row.Page);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>페이지 헤더의 복제 버튼</summary>
|
||||
private void OnPageDuplicateClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user