프로젝트

일반

사용자정보

개정판 4fcb686a

ID4fcb686a2d4740f5eee8d44f69429ab17bd7489f
상위 a7bee7cf
하위 5ba8f2d5

김태성이(가) 2년 이상 전에 추가함

issue #000 font가 적용 되지 않아 box size가 작게 출력되는 문제

Change-Id: Ie07531db96d56e8d5c2bbdbf0786d053ad39747c

차이점 보기:

KCOM/Resources/WindowStyle.xaml
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3
                    x:Class="KCOM.Controls.CustomizedWindow.VS2012WindowStyle"
4
                    xmlns:cWin="clr-namespace:KCOM.Controls.CustomizedWindow"
5
                    xmlns:local="clr-namespace:KCOM.Controls">
1
<ResourceDictionary
2
    x:Class="KCOM.Controls.CustomizedWindow.VS2012WindowStyle"
3
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
    xmlns:cWin="clr-namespace:KCOM.Controls.CustomizedWindow"
6
    xmlns:local="clr-namespace:KCOM.Controls">
6 7

  
7 8
    <SolidColorBrush x:Key="TitleBarBackgroundBrush" Color="#FF2A579A" />
8 9
    <SolidColorBrush x:Key="VS2012WindowBorderBrush" Color="#007ACC" />
......
12 13
    <Visibility x:Key="GripVisible">Visible</Visibility>
13 14
    <Style x:Key="VS2012WindowStyleTitleBarButton" TargetType="{x:Type Button}">
14 15
        <Setter Property="Focusable" Value="false" />
15
        <Setter Property="Foreground" Value="White"/>
16
        <Setter Property="Foreground" Value="White" />
16 17
        <Setter Property="Template">
17 18
            <Setter.Value>
18 19
                <ControlTemplate TargetType="{x:Type Button}">
19 20
                    <Grid>
20
                        <Border
21
                            x:Name="PART_border"
22
                            Background="Transparent"
23
                            />
21
                        <Border x:Name="PART_border" Background="Transparent" />
24 22
                        <ContentPresenter />
25 23
                    </Grid>
26 24
                    <ControlTemplate.Triggers>
......
29 27
                            <Setter TargetName="PART_border" Property="Opacity" Value="0.7" />
30 28
                        </Trigger>
31 29
                        <Trigger Property="IsPressed" Value="True">
32
                            <Setter TargetName="PART_border" Property="Background" Value="{StaticResource VS2012WindowBorderBrush}"/>
30
                            <Setter TargetName="PART_border" Property="Background" Value="{StaticResource VS2012WindowBorderBrush}" />
33 31
                            <Setter TargetName="PART_border" Property="Opacity" Value="1" />
34
                            <Setter Property="Foreground" Value="#FFF"/>
32
                            <Setter Property="Foreground" Value="#FFF" />
35 33
                        </Trigger>
36 34
                    </ControlTemplate.Triggers>
37 35
                </ControlTemplate>
......
44 42
        <Setter Property="WindowStyle" Value="None" />
45 43
        <Setter Property="Background" Value="Transparent" />
46 44
        <Setter Property="ResizeMode" Value="CanResizeWithGrip" />
47
        <Setter Property="Foreground" Value="White"/>
45
        <Setter Property="Foreground" Value="White" />
48 46
        <Setter Property="Template">
49 47
            <Setter.Value>
50 48
                <ControlTemplate TargetType="{x:Type cWin:CustomWindow}">
51 49
                    <!--
52
                    7 is a magic number. By default Windows fits a maximized window with Margin
53
                    7 7 7 7 to fill entire screen (WPF .Net 4.5). Larger numbers produce a gap
54
                    between maximized window and screen edges; smaller numbers show parts of
55
                    the window outside of the current monitor on multi-display computers.
50
                        7 is a magic number. By default Windows fits a maximized window with Margin
51
                        7 7 7 7 to fill entire screen (WPF .Net 4.5). Larger numbers produce a gap
52
                        between maximized window and screen edges; smaller numbers show parts of
53
                        the window outside of the current monitor on multi-display computers.
56 54
                    -->
57
                    <Grid
58
                        TextOptions.TextRenderingMode="Auto" TextOptions.TextFormattingMode="Ideal">
55
                    <Grid TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto">
59 56
                        <Border
60 57
                            x:Name="PART_Border"
61 58
                            Width="Auto"
62 59
                            Height="Auto"
60
                            Padding="0"
63 61
                            Background="#1B1811"
64 62
                            BorderBrush="#FF1D2D44"
65
                            BorderThickness="1"
66
                            Padding="0">
67
                            <Border BorderThickness="2" BorderBrush="#FF293C57">
68
                                <DockPanel   
69
                                HorizontalAlignment="Stretch"
70
                                Background="Transparent"
71
                                VerticalAlignment="Stretch"
72
                                >
73
                                <Border
74
                                    x:Name="TitleBar"
75
                                    DockPanel.Dock="Top"
76
                                    Background="{StaticResource TitleBarBackgroundBrush}"
77
                                    BorderThickness="0"
78
                                    MouseLeftButtonDown="TitleBarMouseLeftButtonDown"
79
                                    MouseMove="TitleBarMouseMove"
80
                                    >
81
                                    <Grid Height="32">
82
                                        <Grid.ColumnDefinitions>
83
                                            <ColumnDefinition Width="36"/>
84
                                            <ColumnDefinition />
85
                                            <ColumnDefinition Width="34"/>
86
                                            <ColumnDefinition Width="34"/>
87
                                            <ColumnDefinition Width="34"/>
88
                                        </Grid.ColumnDefinitions>
89
                                        <Image
90
                                            x:Name="Icon"
91
                                            Grid.Column="0"
92
                                            Source="{Binding Path=Icon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" 
93
                                            HorizontalAlignment="Right"
94
                                            Margin="4,-7,0,7"
95
                                            Width="32"
96
                                            Height="32"
97
                                            MouseLeftButtonDown="IconMouseLeftButtonDown"
98
                                            />
99
                                        <TextBlock
100
                                            x:Name="Caption"
101
                                            Grid.Column="1"
102
                                            HorizontalAlignment="Center"
103
                                            VerticalAlignment="Center"
104
                                            Margin="4,0,0,0"
105
                                            FontFamily="Segoe UI"
106
                                            FontSize="12"
107
                                            FontWeight="Bold"
108
                                            Foreground="White"
109
                                            Opacity="0.66"
110
                                            Text="{Binding Path=Title, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
111
                                            />
112
                                        <Button
113
                                            x:Name="MinButton" 
114
                                            Grid.Column="2"
115
                                            VerticalAlignment="Top"
116
                                            Width="34"
117
                                            Height="26"
118
                                            Style="{StaticResource VS2012WindowStyleTitleBarButton}"
119
                                            Click="MinButtonClick"
120
                                            >
121
                                            <Grid MaxHeight="9" MaxWidth="9">
122
                                                <Path
123
                                                    Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
124
                                                    StrokeThickness="1"
125
                                                    Stretch="None"
126
                                                    RenderOptions.EdgeMode="Aliased"
127
                                                    Data="M0,8 H8 M0,7 H8 M0,6 H8"
128
                                                    />
129
                                            </Grid>
130
                                        </Button>
131
                                        <Button
132
                                            Grid.Column="3"
133
                                            x:Name="MaxButton" 
134
                                            VerticalAlignment="Top"
135
                                            Width="34"
136
                                            Height="26"
137
                                            Style="{StaticResource VS2012WindowStyleTitleBarButton}"
138
                                            Click="MaxButtonClick"
139
                                            >
140
                                            <Grid MaxHeight="9" MaxWidth="9">
141
                                                <Path
142
                                                    x:Name="PART_MaxButton_Path"
143
                                                    Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
144
                                                    StrokeThickness="1"
145
                                                    Stretch="None"
146
                                                    RenderOptions.EdgeMode="Aliased"
147
                                                    Data="M0,0 H8 V8 H0 V0 M0,1 H8 M0,2 H8"
148
                                                    />
149
                                            </Grid>
150
                                        </Button>
151
                                        <Button
152
                                            Grid.Column="4"
153
                                            x:Name="CloseButton" 
154
                                            VerticalAlignment="Top"
155
                                            Width="34"
156
                                            Height="26"
157
                                            Style="{StaticResource VS2012WindowStyleTitleBarButton}"
158
                                            Click="CloseButtonClick"
159
                                            >
160
                                            <Grid MaxHeight="9" MaxWidth="9">
161
                                                <Path
162
                                                    Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
163
                                                    StrokeThickness="1.5"
164
                                                    Stretch="None"
165
                                                    Data="M0,0 L8,8 M0,8 L8,0"
166
                                                    />
167
                                            </Grid>
168
                                        </Button>
169
                                    </Grid>
170
                                </Border>
171
                                <ContentPresenter />
172
                            </DockPanel>
63
                            BorderThickness="1">
64
                            <Border BorderBrush="#FF293C57" BorderThickness="2">
65
                                <DockPanel
66
                                    HorizontalAlignment="Stretch"
67
                                    VerticalAlignment="Stretch"
68
                                    Background="Transparent">
69
                                    <Border
70
                                        x:Name="TitleBar"
71
                                        Background="{StaticResource TitleBarBackgroundBrush}"
72
                                        BorderThickness="0"
73
                                        DockPanel.Dock="Top"
74
                                        MouseLeftButtonDown="TitleBarMouseLeftButtonDown"
75
                                        MouseMove="TitleBarMouseMove">
76
                                        <Grid Height="32">
77
                                            <Grid.ColumnDefinitions>
78
                                                <ColumnDefinition Width="36" />
79
                                                <ColumnDefinition />
80
                                                <ColumnDefinition Width="34" />
81
                                                <ColumnDefinition Width="34" />
82
                                                <ColumnDefinition Width="34" />
83
                                            </Grid.ColumnDefinitions>
84
                                            <Image
85
                                                x:Name="Icon"
86
                                                Grid.Column="0"
87
                                                Width="32"
88
                                                Height="32"
89
                                                Margin="4,-7,0,7"
90
                                                HorizontalAlignment="Right"
91
                                                MouseLeftButtonDown="IconMouseLeftButtonDown"
92
                                                Source="{Binding Path=Icon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
93
                                            <TextBlock
94
                                                x:Name="Caption"
95
                                                Grid.Column="1"
96
                                                Margin="4,0,0,0"
97
                                                HorizontalAlignment="Center"
98
                                                VerticalAlignment="Center"
99
                                                FontFamily="Segoe UI"
100
                                                FontSize="12"
101
                                                FontWeight="Bold"
102
                                                Foreground="White"
103
                                                Opacity="0.66"
104
                                                Text="{Binding Path=Title, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
105
                                            <Button
106
                                                x:Name="MinButton"
107
                                                Grid.Column="2"
108
                                                Width="34"
109
                                                Height="26"
110
                                                VerticalAlignment="Top"
111
                                                Click="MinButtonClick"
112
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
113
                                                <Grid MaxWidth="9" MaxHeight="9">
114
                                                    <Path
115
                                                        Data="M0,8 H8 M0,7 H8 M0,6 H8"
116
                                                        RenderOptions.EdgeMode="Aliased"
117
                                                        Stretch="None"
118
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
119
                                                        StrokeThickness="1" />
120
                                                </Grid>
121
                                            </Button>
122
                                            <Button
123
                                                x:Name="MaxButton"
124
                                                Grid.Column="3"
125
                                                Width="34"
126
                                                Height="26"
127
                                                VerticalAlignment="Top"
128
                                                Click="MaxButtonClick"
129
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
130
                                                <Grid MaxWidth="9" MaxHeight="9">
131
                                                    <Path
132
                                                        x:Name="PART_MaxButton_Path"
133
                                                        Data="M0,0 H8 V8 H0 V0 M0,1 H8 M0,2 H8"
134
                                                        RenderOptions.EdgeMode="Aliased"
135
                                                        Stretch="None"
136
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
137
                                                        StrokeThickness="1" />
138
                                                </Grid>
139
                                            </Button>
140
                                            <Button
141
                                                x:Name="CloseButton"
142
                                                Grid.Column="4"
143
                                                Width="34"
144
                                                Height="26"
145
                                                VerticalAlignment="Top"
146
                                                Click="CloseButtonClick"
147
                                                Style="{StaticResource VS2012WindowStyleTitleBarButton}">
148
                                                <Grid MaxWidth="9" MaxHeight="9">
149
                                                    <Path
150
                                                        Data="M0,0 L8,8 M0,8 L8,0"
151
                                                        Stretch="None"
152
                                                        Stroke="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"
153
                                                        StrokeThickness="1.5" />
154
                                                </Grid>
155
                                            </Button>
156
                                        </Grid>
157
                                    </Border>
158
                                    <ContentPresenter />
159
                                </DockPanel>
173 160
                            </Border>
174 161
                        </Border>
175 162
                        <Line
176
                            MouseDown="OnSizeNorth"
177 163
                            x:Name="lnSizeNorth"
178
                            Stroke="Transparent"   
179 164
                            Cursor="SizeNS"
180
                            X1="1" X2="{TemplateBinding ActualWidth}" Y1="1" Y2="1"
165
                            MouseDown="OnSizeNorth"
166
                            Stroke="Transparent"
181 167
                            StrokeThickness="4"
182
                            />
168
                            X1="1"
169
                            X2="{TemplateBinding ActualWidth}"
170
                            Y1="1"
171
                            Y2="1" />
183 172
                        <Line
184
                            MouseDown="OnSizeSouth"
185 173
                            x:Name="lnSizeSouth"
186
                            Stroke="Transparent"
187
                            VerticalAlignment="Bottom" 
174
                            VerticalAlignment="Bottom"
188 175
                            Cursor="SizeNS"
189
                            X1="1" X2="{TemplateBinding ActualWidth}" Y1="{TemplateBinding ActualHeight}" Y2="{TemplateBinding ActualHeight}"
176
                            MouseDown="OnSizeSouth"
177
                            Stroke="Transparent"
190 178
                            StrokeThickness="4"
191
                            />
179
                            X1="1"
180
                            X2="{TemplateBinding ActualWidth}"
181
                            Y1="{TemplateBinding ActualHeight}"
182
                            Y2="{TemplateBinding ActualHeight}" />
192 183
                        <Line
193
                            MouseDown="OnSizeWest"
194 184
                            x:Name="lnSizeWest"
195
                            Stroke="Transparent"
196 185
                            Cursor="SizeWE"
197
                            X1="1" X2="1" Y1="1" Y2="{TemplateBinding ActualHeight}"
186
                            MouseDown="OnSizeWest"
187
                            Stroke="Transparent"
198 188
                            StrokeThickness="4"
199
                            />
189
                            X1="1"
190
                            X2="1"
191
                            Y1="1"
192
                            Y2="{TemplateBinding ActualHeight}" />
200 193
                        <Line
201
                            MouseDown="OnSizeEast"
202 194
                            x:Name="lnSizeEast"
195
                            HorizontalAlignment="Right"
196
                            Cursor="SizeWE"
197
                            MouseDown="OnSizeEast"
203 198
                            Stroke="Transparent"
204
                            HorizontalAlignment="Right" 
205
                            Cursor="SizeWE" 
206
                            X1="{TemplateBinding ActualWidth}" X2="{TemplateBinding ActualWidth}" Y1="1" Y2="{TemplateBinding ActualHeight}"
207 199
                            StrokeThickness="4"
208
                            />
209
                        <Rectangle MouseDown="OnSizeNorthWest" x:Name="rectSizeNorthWest" Cursor="SizeNWSE" Fill="Transparent" Width="5" Height="5" VerticalAlignment="Top" HorizontalAlignment="Left" />
210
                        <Rectangle MouseDown="OnSizeNorthEast" x:Name="rectSizeNorthEast" Cursor="SizeNESW" Fill="Transparent" Width="5" Height="5" VerticalAlignment="Top" HorizontalAlignment="Right" />
211
                        <Rectangle MouseDown="OnSizeSouthWest" x:Name="rectSizeSouthWest" Cursor="SizeNESW" Fill="Transparent" Width="5" Height="5" VerticalAlignment="Bottom" HorizontalAlignment="Left" />
212
                        <Rectangle MouseDown="OnSizeSouthEast" x:Name="rectSizeSouthEast" Cursor="SizeNWSE" Fill="Transparent" Width="5" Height="5" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
200
                            X1="{TemplateBinding ActualWidth}"
201
                            X2="{TemplateBinding ActualWidth}"
202
                            Y1="1"
203
                            Y2="{TemplateBinding ActualHeight}" />
204
                        <Rectangle
205
                            x:Name="rectSizeNorthWest"
206
                            Width="5"
207
                            Height="5"
208
                            HorizontalAlignment="Left"
209
                            VerticalAlignment="Top"
210
                            Cursor="SizeNWSE"
211
                            Fill="Transparent"
212
                            MouseDown="OnSizeNorthWest" />
213
                        <Rectangle
214
                            x:Name="rectSizeNorthEast"
215
                            Width="5"
216
                            Height="5"
217
                            HorizontalAlignment="Right"
218
                            VerticalAlignment="Top"
219
                            Cursor="SizeNESW"
220
                            Fill="Transparent"
221
                            MouseDown="OnSizeNorthEast" />
222
                        <Rectangle
223
                            x:Name="rectSizeSouthWest"
224
                            Width="5"
225
                            Height="5"
226
                            HorizontalAlignment="Left"
227
                            VerticalAlignment="Bottom"
228
                            Cursor="SizeNESW"
229
                            Fill="Transparent"
230
                            MouseDown="OnSizeSouthWest" />
231
                        <Rectangle
232
                            x:Name="rectSizeSouthEast"
233
                            Width="5"
234
                            Height="5"
235
                            HorizontalAlignment="Right"
236
                            VerticalAlignment="Bottom"
237
                            Cursor="SizeNWSE"
238
                            Fill="Transparent"
239
                            MouseDown="OnSizeSouthEast" />
213 240
                    </Grid>
214 241
                    <ControlTemplate.Triggers>
215
                        <Trigger Property="CustomState"  Value="Maximized">
216
                            <Setter TargetName="PART_MaxButton_Path" Property="Data" Value="M0,3 H5 V8 H0 V3 M0,4 H5 M3,0 H8 V5 H7 M3,1 H8"/>
217
                            <Setter TargetName="lnSizeNorth" Property="Visibility" Value="Hidden"/>
218
                            <Setter TargetName="lnSizeSouth" Property="Visibility" Value="Hidden"/>
219
                            <Setter TargetName="lnSizeWest" Property="Visibility" Value="Hidden"/>
220
                            <Setter TargetName="lnSizeEast" Property="Visibility" Value="Hidden"/>
221
                            <Setter TargetName="rectSizeNorthWest" Property="Visibility" Value="Hidden"/>
222
                            <Setter TargetName="rectSizeNorthEast" Property="Visibility" Value="Hidden"/>
223
                            <Setter TargetName="rectSizeSouthWest" Property="Visibility" Value="Hidden"/>
224
                            <Setter TargetName="rectSizeSouthEast" Property="Visibility" Value="Hidden"/>
242
                        <Trigger Property="CustomState" Value="Maximized">
243
                            <Setter TargetName="PART_MaxButton_Path" Property="Data" Value="M0,3 H5 V8 H0 V3 M0,4 H5 M3,0 H8 V5 H7 M3,1 H8" />
244
                            <Setter TargetName="lnSizeNorth" Property="Visibility" Value="Hidden" />
245
                            <Setter TargetName="lnSizeSouth" Property="Visibility" Value="Hidden" />
246
                            <Setter TargetName="lnSizeWest" Property="Visibility" Value="Hidden" />
247
                            <Setter TargetName="lnSizeEast" Property="Visibility" Value="Hidden" />
248
                            <Setter TargetName="rectSizeNorthWest" Property="Visibility" Value="Hidden" />
249
                            <Setter TargetName="rectSizeNorthEast" Property="Visibility" Value="Hidden" />
250
                            <Setter TargetName="rectSizeSouthWest" Property="Visibility" Value="Hidden" />
251
                            <Setter TargetName="rectSizeSouthEast" Property="Visibility" Value="Hidden" />
225 252
                        </Trigger>
226 253
                        <Trigger Property="IsActive" Value="False">
227
                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="#54626F"/>
254
                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="#54626F" />
228 255
                        </Trigger>
229 256
                    </ControlTemplate.Triggers>
230 257
                </ControlTemplate>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)