[Phase L4] 파일탐색기·QuickLook·단위변환 단축 3종 완료
FileBrowserHandler (185줄) — L4-1 인라인 파일 탐색기:
- Handlers/FileBrowserHandler.cs: Prefix=null, 경로 패턴 감지(C:\, D:\, \, ~\)
- 폴더/파일 나열: 상위폴더(..) + 하위폴더 40개 + 파일 30개
- 확장자별 MDL2 아이콘, 파일 크기 포맷(B/KB/MB/GB), 필터링 지원
- FileBrowserEntry(Path, IsFolder) record 정의
- App.xaml.cs: Phase L4 섹션에 FileBrowserHandler 등록
CommandResolver (18줄 추가) — 경로 쿼리 우선 처리:
- 퍼지 검색 전 IsPathQuery() 감지 → 파일탐색기 단독 결과 반환(항목 수 제한 없음)
- FileBrowserEntry 실행 라우팅 → ExecuteNullPrefixAsync 위임
LauncherWindow.Keyboard.cs (41줄 추가) — 키보드 탐색:
- Key.Right: FileBrowserEntry {IsFolder:true} 선택 시 해당 경로로 InputText 업데이트
- Key.Left: 경로 쿼리 상태에서 상위 폴더로 이동(Path.GetDirectoryName)
- 기존 → 키 액션모드 진입 로직 유지
QuickLookWindow (L4-2 F3 미리보기 강화):
- XAML: 줄번호 열(LineNumBg+LineNumbers), PDF 패널(빨강 배지), Office 패널(파랑 배지) 추가
- Code-behind: PDF(PdfPig), Word(OpenXml), Excel(OpenXml) 미리보기 구현
- ApplyCodeStyle(): 언어별 배경 색조(C#=파랑, Python=녹색, JS=앰버 등)
- 빌드: 경고 0, 오류 0
This commit is contained in:
229
src/AxCopilot/Views/QuickLookWindow.xaml
Normal file
229
src/AxCopilot/Views/QuickLookWindow.xaml
Normal file
@@ -0,0 +1,229 @@
|
||||
<Window x:Class="AxCopilot.Views.QuickLookWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="AX Commander — 빠른 미리보기"
|
||||
Width="400" Height="500"
|
||||
MinWidth="260" MinHeight="200"
|
||||
WindowStyle="None" AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
WindowStartupLocation="Manual"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
Topmost="True">
|
||||
|
||||
<!-- F3 빠른 미리보기: 이미지/텍스트/폴더/파일 정보 -->
|
||||
|
||||
<Border Background="{DynamicResource LauncherBackground}" CornerRadius="12"
|
||||
BorderBrush="{DynamicResource BorderColor}" BorderThickness="1"
|
||||
Margin="6">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect BlurRadius="22" ShadowDepth="4" Opacity="0.32" Color="Black" Direction="270"/>
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="44"/> <!-- 타이틀바 -->
|
||||
<RowDefinition Height="*"/> <!-- 컨텐츠 -->
|
||||
<RowDefinition Height="Auto"/> <!-- 하단 메타 -->
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ─── 타이틀바 ─────────────────────────────────────────────── -->
|
||||
<Border Grid.Row="0" CornerRadius="12,12,0,0"
|
||||
Background="{DynamicResource ItemBackground}"
|
||||
MouseLeftButtonDown="TitleBar_MouseDown">
|
||||
<Grid Margin="14,0,8,0">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="FileTypeIcon"
|
||||
Text=""
|
||||
FontFamily="Segoe MDL2 Assets" FontSize="15"
|
||||
Foreground="{DynamicResource AccentColor}"
|
||||
VerticalAlignment="Center" Margin="0,1,10,0"/>
|
||||
<TextBlock x:Name="FileNameText" Text=""
|
||||
FontSize="13" FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource PrimaryText}"
|
||||
VerticalAlignment="Center"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
MaxWidth="270"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 닫기 버튼 -->
|
||||
<Border HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
CornerRadius="4" Padding="8,4" Cursor="Hand"
|
||||
MouseLeftButtonUp="BtnClose_Click">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#40C05050"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" FontSize="13"
|
||||
Foreground="{DynamicResource SecondaryText}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ─── 컨텐츠 영역 ───────────────────────────────────────────── -->
|
||||
<Grid Grid.Row="1">
|
||||
|
||||
<!-- 이미지 미리보기 -->
|
||||
<ScrollViewer x:Name="ImageScrollViewer"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Visibility="Collapsed"
|
||||
Background="{DynamicResource LauncherBackground}">
|
||||
<Image x:Name="PreviewImage"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
Stretch="Uniform"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Margin="8"/>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- 텍스트/코드 미리보기 -->
|
||||
<ScrollViewer x:Name="TextScrollViewer"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Visibility="Collapsed">
|
||||
<Grid>
|
||||
<!-- 코드 배경 (줄 번호 열) -->
|
||||
<Border x:Name="LineNumBg"
|
||||
HorizontalAlignment="Left"
|
||||
Width="40"
|
||||
Background="#0AFFFFFF"
|
||||
Visibility="Collapsed"/>
|
||||
<!-- 줄 번호 텍스트 -->
|
||||
<TextBlock x:Name="LineNumbers"
|
||||
FontFamily="Cascadia Code, Consolas, Courier New"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
TextWrapping="NoWrap"
|
||||
HorizontalAlignment="Left"
|
||||
Opacity="0.5"
|
||||
Margin="6,12,0,12"
|
||||
Visibility="Collapsed"/>
|
||||
<!-- 코드/텍스트 본문 -->
|
||||
<TextBlock x:Name="PreviewText"
|
||||
FontFamily="Cascadia Code, Consolas, Courier New"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource PrimaryText}"
|
||||
TextWrapping="NoWrap"
|
||||
Margin="14,12"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- PDF 미리보기 (텍스트 추출) -->
|
||||
<ScrollViewer x:Name="PdfScrollViewer"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Visibility="Collapsed">
|
||||
<StackPanel>
|
||||
<!-- PDF 헤더 배지 -->
|
||||
<Border Background="#15EA4335" CornerRadius="6"
|
||||
Padding="12,6" Margin="10,10,10,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text=""
|
||||
FontFamily="Segoe MDL2 Assets" FontSize="13"
|
||||
Foreground="#EA4335" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"/>
|
||||
<TextBlock x:Name="PdfMetaText"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock x:Name="PdfPreviewText"
|
||||
FontFamily="Segoe UI, Malgun Gothic"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource PrimaryText}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="14,12"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- Office 문서 미리보기 (텍스트 추출) -->
|
||||
<ScrollViewer x:Name="OfficeScrollViewer"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Visibility="Collapsed">
|
||||
<StackPanel>
|
||||
<!-- Office 헤더 배지 -->
|
||||
<Border Background="#152196F3" CornerRadius="6"
|
||||
Padding="12,6" Margin="10,10,10,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock x:Name="OfficeTypeIcon"
|
||||
FontFamily="Segoe MDL2 Assets" FontSize="13"
|
||||
Foreground="#2196F3" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"/>
|
||||
<TextBlock x:Name="OfficeMetaText"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock x:Name="OfficePreviewText"
|
||||
FontFamily="Segoe UI, Malgun Gothic"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource PrimaryText}"
|
||||
TextWrapping="Wrap"
|
||||
Margin="14,12"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- 정보 패널 (폴더/앱/기타 파일) -->
|
||||
<StackPanel x:Name="InfoPanel"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Visibility="Collapsed">
|
||||
<TextBlock x:Name="InfoTypeIcon"
|
||||
Text=""
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="52"
|
||||
Foreground="{DynamicResource AccentColor}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<TextBlock x:Name="InfoTypeName"
|
||||
Text=""
|
||||
FontSize="14"
|
||||
FontWeight="Medium"
|
||||
Foreground="{DynamicResource PrimaryText}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,10,0,0"
|
||||
TextWrapping="Wrap"
|
||||
TextAlignment="Center"
|
||||
MaxWidth="320"/>
|
||||
<TextBlock x:Name="InfoSubText"
|
||||
Text=""
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- ─── 하단 메타 정보 ─────────────────────────────────────────── -->
|
||||
<Border Grid.Row="2" CornerRadius="0,0,12,12"
|
||||
Background="{DynamicResource ItemBackground}"
|
||||
BorderBrush="{DynamicResource BorderColor}" BorderThickness="0,1,0,0"
|
||||
Padding="14,7">
|
||||
<Grid>
|
||||
<TextBlock x:Name="FooterPath"
|
||||
Text=""
|
||||
FontSize="10"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxWidth="240"/>
|
||||
<TextBlock x:Name="FooterMeta"
|
||||
Text=""
|
||||
FontSize="10"
|
||||
Foreground="{DynamicResource SecondaryText}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user