Permalink
Browse files

Visual and usability changes for the font chooser.

  • Loading branch information...
1 parent e686719 commit aaad387d711d23b0d3f353dd6e5dd1e245e5972f @beaugunderson committed Jun 8, 2011
View
1 .gitignore
@@ -5,3 +5,4 @@
/*.sln.docstates
/Themes.unused/
/Textile.full/
+/NotationalFerocitySetup/
View
164 FontDialog/FontChooser.xaml
@@ -1,49 +1,54 @@
<Window x:Class="FontDialog.FontChooser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Font Chooser"
- Width="800" Height="800"
- Background="{x:Static SystemColors.ControlBrush}"
- >
+ Width="600" Height="650"
+ Background="{x:Static SystemColors.ControlBrush}" MinHeight="460" MinWidth="600">
<Grid Margin="12">
<Grid.RowDefinitions>
- <RowDefinition Height="4*"/>
- <RowDefinition Height="3*"/>
- <RowDefinition Height="2*"/>
- <RowDefinition Height="Auto"/>
+ <RowDefinition Height="250*" MinHeight="200" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="250*" MinHeight="200" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="80*" MinHeight="60" />
</Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition />
+ </Grid.ColumnDefinitions>
+
<!-- Row 0: Selection controls -->
- <Grid Grid.Column="0" Grid.Row="0">
+ <Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="12"/>
+ <ColumnDefinition Width="6"/>
<ColumnDefinition Width="2*"/>
- <ColumnDefinition Width="12"/>
+ <ColumnDefinition Width="6"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
+
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
+ <RowDefinition Height="26"/>
+ <RowDefinition Height="92"/>
</Grid.RowDefinitions>
<!-- Families -->
- <Label Grid.Column="0" Grid.Row="0" Content="_Font family"/>
- <DockPanel Grid.Column="0" Grid.Row="1" Grid.RowSpan="3">
+ <Label Grid.Column="0" Grid.Row="0" Content="_Font Family"/>
+ <DockPanel Grid.Column="0" Grid.Row="1" Grid.RowSpan="3" LastChildFill="False">
<TextBox DockPanel.Dock="Top" Name="fontFamilyTextBox"/>
- <ListBox Name="fontFamilyList"/>
+ <ListBox Name="fontFamilyList" DockPanel.Dock="Bottom" />
</DockPanel>
<!-- Family Typefaces (weight, style, stretch) -->
- <Label Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="3" Content="_Typeface:"/>
+ <Label Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="3" Content="_Typeface"/>
<ListBox Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="3" Name="typefaceList"/>
<!-- Font sizes -->
- <Label Grid.Column="2" Grid.Row="2" Margin="0,12,0,0" Content="_Size:"/>
- <DockPanel Grid.Column="2" Grid.Row="3">
+ <Label Grid.Column="2" Grid.Row="2" Content="_Size"/>
+ <DockPanel Grid.Column="2" Grid.Row="3" LastChildFill="False">
<TextBox DockPanel.Dock="Top" Name="sizeTextBox"/>
- <ListBox Height="60" Name="sizeList"/>
+ <ListBox Name="sizeList" DockPanel.Dock="Bottom" />
</DockPanel>
<!-- Text decorations -->
@@ -55,57 +60,73 @@
</DockPanel>
</Grid>
+ <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Center" Height="6" />
+
<!-- Row 1: Tab control with family typeface samples, etc. -->
- <TabControl Grid.Column="0" Grid.Row="1" Margin="0,12,0,0" Name="tabControl">
- <TabItem Header="Family and typeface samples" Name="samplesTab">
+ <TabControl Grid.Row="2" Name="tabControl">
+ <TabItem Header="Samples" Name="samplesTab">
<Grid>
<Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="12"/>
- <ColumnDefinition/>
+ <ColumnDefinition Width="300"/>
+ <ColumnDefinition Width="5"/>
+ <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
+
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
- <TextBlock Grid.Column="0" Grid.Row="0">
- <Run>FontFamily: </Run>
- <Run Name="fontFamilyNameRun"/>
+ <TextBlock Grid.Column="0" Grid.Row="0" Padding="5">
+ <Run>Font Family:</Run>
+ <Run Name="fontFamilyNameRun">Name</Run>
</TextBlock>
+
<RichTextBox
Grid.Column="0" Grid.Row="1"
IsReadOnly="True"
VerticalScrollBarVisibility="Auto"
- Name="fontFamilySamples"
- />
- <TextBlock Grid.Column="2" Grid.Row="0">
- <Run>Typeface: </Run>
- <Run Name="typefaceNameRun">Points</Run>
+ Name="fontFamilySamples" />
+
+ <GridSplitter Grid.Column="1" Grid.Row="1"
+ HorizontalAlignment="Left"
+ Margin="0"
+ Width="5"/>
+
+ <TextBlock Grid.Column="2" Grid.Row="0" Padding="5">
+ <Run>Typeface:</Run>
+ <Run Name="typefaceNameRun">Name</Run>
</TextBlock>
+
<RichTextBox
Grid.Column="2" Grid.Row="1"
IsReadOnly="True"
VerticalScrollBarVisibility="Auto"
- Name="typefaceSamples"
- />
+ Name="typefaceSamples" />
</Grid>
</TabItem>
- <TabItem Header="Typographic Features" Name="typographyTab">
+
+ <TabItem Header="Features" Name="typographyTab">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="8"/>
+ <ColumnDefinition Width="5"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
+
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!-- Feature list of left-hand side of typography tab -->
- <Label Grid.Column="0" Grid.Row="0" Content="Feature"/>
- <ListBox Grid.Column="0" Grid.Row="1" Name="featureList" MinWidth="192"/>
+ <ListBox Name="featureList" MinWidth="192" Grid.RowSpan="2" />
+
+ <GridSplitter
+ Grid.Column="1" Grid.RowSpan="2"
+ HorizontalAlignment="Left"
+ Margin="0"
+ Width="5" />
<!-- Column headers on right-hand side of typography tab -->
<Grid Grid.Column="2" Grid.Row="0">
@@ -114,7 +135,7 @@
<ColumnDefinition Width="96"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
- <Label Grid.Column="1" Content="Selection"/>
+ <Label Grid.Column="1" Content="Selection" HorizontalAlignment="Left" Width="96" />
<Label Grid.Column="2" Content="Sample"/>
</Grid>
@@ -132,57 +153,62 @@
</Border>
</Grid>
</TabItem>
- <TabItem Header="DescriptiveText" Name="descriptiveTextTab">
+
+ <TabItem Header="Description" Name="descriptiveTextTab">
<Grid>
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="8"/>
- <ColumnDefinition Width="2*"/>
+ <ColumnDefinition Width="300"/>
+ <ColumnDefinition Width="5"/>
+ <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
+
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
- <Label Grid.Column="0" Grid.Row="0" Content="Font description:"/>
+ <Label Grid.Column="0" Grid.Row="0" Content="Description"/>
+
<RichTextBox
Grid.Column="0" Grid.Row="1"
IsReadOnly="True"
VerticalScrollBarVisibility="Auto"
- Name="fontDescriptionBox"
- />
+ Name="fontDescriptionBox"/>
+
+ <GridSplitter Grid.Column="1" Grid.Row="1"
+ HorizontalAlignment="Left"
+ Margin="0"
+ Width="5" />
- <Label Grid.Column="2" Grid.Row="0" Content="License:"/>
- <TextBox
+ <Label Grid.Column="2" Grid.Row="0" Content="License"/>
+
+ <RichTextBox
Grid.Column="2" Grid.Row="1"
IsReadOnly="True"
- TextWrapping="WrapWithOverflow"
VerticalScrollBarVisibility="Auto"
- Name="fontLicenseBox"
- />
+ Name="fontLicenseBox" />
</Grid>
</TabItem>
</TabControl>
+ <GridSplitter Grid.Row="3" Height="6" VerticalAlignment="Center" Margin="0" HorizontalAlignment="Stretch" />
+
<!-- Row 2: Preview text -->
- <DockPanel Grid.Column="0" Grid.Row="2" Margin="0,12,0,0">
- <TextBlock DockPanel.Dock="Top">Preview:</TextBlock>
- <TextBox
- FontSize="16" AcceptsReturn="True"
- TextAlignment="Center"
- TextWrapping="Wrap"
+ <RichTextBox Name="previewTextBox"
+ Grid.Row="4"
+ FontSize="16"
+ AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
- Name="previewTextBox"
- >
- The quick brown fox jumps over the lazy dog
- </TextBox>
- </DockPanel>
-
+ Margin="0,0,0,29">
+ <FlowDocument>
+ <Paragraph>
+ The quick brown fox jumps over the lazy dog.
+ </Paragraph>
+ </FlowDocument>
+ </RichTextBox>
+
<!-- Row 3: OK and Cancel buttons -->
- <StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
- <Button Content="OK" Width="86" IsDefault="True" Click="OnOKButtonClicked"/>
- <Button Content="Cancel" Width="86" Click="OnCancelButtonClicked"/>
- </StackPanel>
-
+ <Button Content="Cancel" Width="75" Click="OnCancelButtonClicked" Margin="0,0,81,0" Grid.Row="4" Height="23" IsCancel="True" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
+ <Button Content="OK" Width="75" IsDefault="True" Click="OnOKButtonClicked" Height="23" Grid.Row="4" VerticalAlignment="Bottom" HorizontalAlignment="Right" />
</Grid>
-</Window>
+</Window>
View
9 FontDialog/FontChooser.xaml.cs
@@ -154,7 +154,7 @@ protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
- _previewSampleText = _defaultSampleText = previewTextBox.Text;
+ _previewSampleText = _defaultSampleText = new TextRange(previewTextBox.Document.ContentStart, previewTextBox.Document.ContentEnd).Text;
_pointsText = typefaceNameRun.Text;
// Hook up events for the font family list and associated text box.
@@ -468,7 +468,7 @@ public string PreviewSampleText
_previewSampleText = newValue;
// Update the preview text box.
- previewTextBox.Text = newValue;
+ previewTextBox.Document = new FlowDocument(new Paragraph(new Run(newValue)));
// The preview sample text is also used in the family and typeface samples tab.
InvalidateTab(samplesTab);
@@ -1695,12 +1695,13 @@ private void InitializeDescriptiveTextTab()
fontDescriptionBox.Document = new FlowDocument(table);
- fontLicenseBox.Text = NameDictionaryHelper.GetDisplayName(glyphTypeface.LicenseDescriptions);
+ fontLicenseBox.Document = new FlowDocument(new Paragraph(new Run(NameDictionaryHelper.GetDisplayName(glyphTypeface.LicenseDescriptions))));
}
else
{
fontDescriptionBox.Document = new FlowDocument();
- fontLicenseBox.Text = String.Empty;
+
+ fontLicenseBox.Document = new FlowDocument();
}
}
View
3 NotationalFerocity/NotationalFerocity.csproj
@@ -54,6 +54,9 @@
<PropertyGroup>
<StartupObject>NotationalFerocity.App</StartupObject>
</PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>Images\MainIcon.ico</ApplicationIcon>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
View
3 NotationalFerocity/Properties/AssemblyInfo.cs
@@ -12,7 +12,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Beau Gunderson")]
[assembly: AssemblyProduct("Notational Ferocity")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[assembly: AssemblyCopyright("Copyright © Beau Gunderson 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -53,3 +53,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: GuidAttribute("3cba2206-22b5-4dfa-9d60-91721a431080")]
View
2 NotationalFerocity/WPF/Styles/Style.xaml
@@ -294,7 +294,7 @@
<Grid>
<Border Name="Border" BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="{TemplateBinding Control.BorderThickness}"></Border>
<ScrollViewer Margin="1" Focusable="False" Background="{TemplateBinding Control.Background}">
- <StackPanel Margin="2" IsItemsHost="True"></StackPanel>
+ <StackPanel Margin="1" IsItemsHost="True"></StackPanel>
</ScrollViewer>
</Grid>
<ControlTemplate.Triggers>
View
44 NotationalFerocity/Windows/MainWindow.xaml
@@ -55,18 +55,36 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
- <ColumnDefinition Width="5" />
+ <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="350*" />
</Grid.ColumnDefinitions>
+ <TextBox Height="23" Margin="12,12,0,0" Name="searchTextBox" VerticalAlignment="Top" TextChanged="searchTextBox_TextChanged" KeyDown="searchTextBox_KeyDown" />
+
+ <ListView Margin="12,41,0,12" Name="notesListView" Background="WhiteSmoke" ItemsSource="{Binding Path=Notes}" SelectionChanged="notesListBox_SelectionChanged" SelectedItem="{Binding Path=CurrentNote, Mode=TwoWay}">
+ <ListView.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="_Rename" Click="Rename_Click" />
+ </ContextMenu>
+ </ListView.ContextMenu>
+
+ <ListView.ItemTemplate>
+ <DataTemplate>
+ <l:EditBox Height="20" Value="{Binding Path=FileNameWithoutExtension, Mode=TwoWay}" Focusable="False" />
+ </DataTemplate>
+ </ListView.ItemTemplate>
+ </ListView>
+
+ <GridSplitter Grid.Column="1" HorizontalAlignment="Center" Margin="0,12" Width="6" />
+
<l:NoteRichTextBox Grid.Column="2" Margin="0,12,12,12" x:Name="noteRichTextBox"
SpellCheck.IsEnabled="True"
ContextMenuOpening="noteRichTextBox_ContextMenuOpening"
TextChanged="noteRichTextBox_TextChanged" VerticalScrollBarVisibility="Auto">
<l:NoteRichTextBox.ContextMenu>
<ContextMenu Name="noteContextMenu" />
</l:NoteRichTextBox.ContextMenu>
-
+
<l:NoteRichTextBox.Style>
<Style TargetType="{x:Type l:NoteRichTextBox}">
<Setter Property="Foreground" Value="{Binding Source={x:Static s:Settings.Default}, Path=ColorForeground}" />
@@ -79,7 +97,7 @@
<Setter Property="FontStyle" Value="{Binding Source={x:Static s:Settings.Default}, Path=FontProportional.FontStyle}" />
<Setter Property="IsEnabled" Value="true" />
-
+
<Style.Triggers>
<Trigger Property="FontSelection" Value="Monospaced">
<Setter Property="FontFamily" Value="{Binding Source={x:Static s:Settings.Default}, Path=FontMonospaced.FontFamily}" />
@@ -88,31 +106,13 @@
<Setter Property="FontWeight" Value="{Binding Source={x:Static s:Settings.Default}, Path=FontMonospaced.FontWeight}" />
<Setter Property="FontStyle" Value="{Binding Source={x:Static s:Settings.Default}, Path=FontMonospaced.FontStyle}" />
</Trigger>
-
+
<DataTrigger Binding="{Binding Path=CurrentNote}" Value="{x:Null}">
<Setter Property="IsEnabled" Value="false" />
</DataTrigger>
</Style.Triggers>
</Style>
</l:NoteRichTextBox.Style>
</l:NoteRichTextBox>
-
- <TextBox Height="23" Margin="12,12,0,0" Name="searchTextBox" VerticalAlignment="Top" TextChanged="searchTextBox_TextChanged" KeyDown="searchTextBox_KeyDown" />
-
- <ListView Margin="12,41,0,12" Name="notesListView" Background="WhiteSmoke" ItemsSource="{Binding Path=Notes}" SelectionChanged="notesListBox_SelectionChanged" SelectedItem="{Binding Path=CurrentNote, Mode=TwoWay}">
- <ListView.ContextMenu>
- <ContextMenu>
- <MenuItem Header="_Rename" Click="Rename_Click" />
- </ContextMenu>
- </ListView.ContextMenu>
-
- <ListView.ItemTemplate>
- <DataTemplate>
- <l:EditBox Height="20" Value="{Binding Path=FileNameWithoutExtension, Mode=TwoWay}" Focusable="False" />
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
-
- <GridSplitter Grid.Column="1" HorizontalAlignment="Left" Margin="0,12" Name="notesGridSplitter" Width="5" />
</Grid>
</l:InteropWindow>

0 comments on commit aaad387

Please sign in to comment.