Skip to content

Commit

Permalink
Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguanzhou committed Mar 8, 2016
1 parent cfef10b commit 77cf584
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 192 deletions.
58 changes: 56 additions & 2 deletions MarkDownEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions MarkDownEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<value>Select All</value>
</data>
<data name="SETTINGS" xml:space="preserve">
<value>SETTINGS</value>
<value>Settings</value>
</data>
<data name="ShowPreview" xml:space="preserve">
<value>Show Preview</value>
Expand Down Expand Up @@ -361,7 +361,7 @@
<value>Italic (Ctrl+I)</value>
</data>
<data name="LanguageSwitch" xml:space="preserve">
<value>Language will switched after restart</value>
<value>Language will be switched after restart</value>
</data>
<data name="Lines" xml:space="preserve">
<value>Lines</value>
Expand Down Expand Up @@ -549,4 +549,22 @@
<data name="UploadLocalImage2Qiniu" xml:space="preserve">
<value>Upload Local Image To Qiniu(Mainland China)</value>
</data>
<data name="Editor" xml:space="preserve">
<value>Editor</value>
</data>
<data name="Environment" xml:space="preserve">
<value>Environment</value>
</data>
<data name="Language" xml:space="preserve">
<value>Language</value>
</data>
<data name="InternationalSettings" xml:space="preserve">
<value>International Settings</value>
</data>
<data name="Theme" xml:space="preserve">
<value>Theme</value>
</data>
<data name="Warning" xml:space="preserve">
<value>Warning</value>
</data>
</root>
20 changes: 19 additions & 1 deletion MarkDownEditor/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
<value>斜体 (Ctrl+I)</value>
</data>
<data name="LanguageSwitch" xml:space="preserve">
<value>重启后将切换语言</value>
<value>语言设置重启后生效</value>
</data>
<data name="Lines" xml:space="preserve">
<value>行数</value>
Expand Down Expand Up @@ -549,4 +549,22 @@
<data name="UploadLocalImage2Qiniu" xml:space="preserve">
<value>上传本地图片至七牛(中国大陆地区)</value>
</data>
<data name="Editor" xml:space="preserve">
<value>编辑器</value>
</data>
<data name="Environment" xml:space="preserve">
<value>环境</value>
</data>
<data name="InternationalSettings" xml:space="preserve">
<value>国际化</value>
</data>
<data name="Language" xml:space="preserve">
<value>语言</value>
</data>
<data name="Theme" xml:space="preserve">
<value>主题</value>
</data>
<data name="Warning" xml:space="preserve">
<value>警告</value>
</data>
</root>
2 changes: 1 addition & 1 deletion MarkDownEditor/View/AboutControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</TextBlock>
</Hyperlink>
</TextBlock>
<Expander Margin="0,20,0,0" Header="{x:Static p:Resources.Donate}" FontSize="16">
<Expander Margin="0,20,0,0" IsExpanded="True" Header="{x:Static p:Resources.Donate}" FontSize="16">
<Image Source="/MarkDownEditor;component/alipay.jpg"></Image>
</Expander>
</StackPanel>
Expand Down
53 changes: 24 additions & 29 deletions MarkDownEditor/View/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Controls:WindowCommands>
<ToggleButton Content="{x:Static p:Resources.ShowPreview}" IsChecked="{Binding IsShowPreview}" IsEnabled="{Binding IsReadingMode,Converter={StaticResource OppositeConverter}}"></ToggleButton>
<ToggleButton Content="{x:Static p:Resources.FullScreen}" IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}, Path=ToggleFullScreen}"></ToggleButton>
<Button Content="{x:Static p:Resources.SETTINGS}" Command="{Binding SettingsViewModel.ShowSettingCommand}"></Button>
<Button Content="{x:Static p:Resources.About}" Command="{Binding AboutViewModel.ShowAboutCommand}"></Button>
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
Expand Down Expand Up @@ -61,6 +62,9 @@
<Controls:Flyout Position="Right" IsModal="True" Theme="Accent" Width="300" IsOpen="{Binding AboutViewModel.ShowAboutControl}">
<view:AboutControl DataContext="{Binding AboutViewModel}"></view:AboutControl>
</Controls:Flyout>
<Controls:Flyout Position="Right" IsModal="True" Theme="Adapt" Width="500" IsOpen="{Binding SettingsViewModel.ShowSettingsControl}">
<view:SettingsControl DataContext="{Binding SettingsViewModel}"></view:SettingsControl>
</Controls:Flyout>
</Controls:FlyoutsControl>
</Controls:MetroWindow.Flyouts>

Expand All @@ -74,16 +78,16 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding SourceCodeWidth}"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="{Binding PreviewWidth}"></ColumnDefinition>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Margin="0,5,5,5" Header="MarkDown">
<Border Grid.Column="0" Margin="0,5,5,5" >

<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
</Grid.RowDefinitions>
<Controls:MetroContentControl BorderBrush="Red" BorderThickness="2">
<view:EditorToolBarControl></view:EditorToolBarControl>
Expand Down Expand Up @@ -134,39 +138,30 @@
<Separator></Separator>
<MenuItem Header="{x:Static p:Resources.Format}" Command="{Binding FormatCodeCommand}"></MenuItem>
</ContextMenu>
</view:MvvmTextEditor.ContextMenu>
</view:MvvmTextEditor.ContextMenu>
</view:MvvmTextEditor>
<Border HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,15,0">
<view:FindReplaceControl DataContext="{Binding FindReplaceViewModel}"></view:FindReplaceControl>
</Border>
</Grid>


<Expander Grid.Row="3" ExpandDirection="Up">
<Expander.Header>
<TextBlock Margin="5" Text="{x:Static p:Resources.SETTINGS}" Foreground="{StaticResource WhiteBrush}"></TextBlock>
</Expander.Header>
<view:SettingsControl DataContext="{Binding SettingsViewModel}" Height="250"></view:SettingsControl>
</Expander>
</Grid>
</GroupBox>
<Grid Grid.Column="1">
<GroupBox Margin="5,5,0,5" Header="{x:Static p:Resources.Preview}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<view:PreviewToolBarControl Margin="5" HorizontalAlignment="Right">
</view:PreviewToolBarControl>
<view:MvvmChromiumWebBrowser
Grid.Row="1" Margin="10"
ShouldReload="{Binding ShouldReload,Mode=TwoWay}"
ScrollOffsetRatio="{Binding ScrollOffsetRatio,Mode=TwoWay}"
Address="{Binding PreviewSource}" IsBrowserInitialized="{Binding IsBrowserInitialized,Mode=OneWayToSource}"></view:MvvmChromiumWebBrowser>
</Grid>
</GroupBox>
</Grid>
</Border>
<GridSplitter IsEnabled="False" Width="10"></GridSplitter>
<Border Grid.Column="2" Margin="5,5,0,5" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<view:PreviewToolBarControl>
</view:PreviewToolBarControl>
<view:MvvmChromiumWebBrowser
Grid.Row="1" Margin="10"
ShouldReload="{Binding ShouldReload,Mode=TwoWay}"
ScrollOffsetRatio="{Binding ScrollOffsetRatio,Mode=TwoWay}"
Address="{Binding PreviewSource}" IsBrowserInitialized="{Binding IsBrowserInitialized,Mode=OneWayToSource}"></view:MvvmChromiumWebBrowser>
</Grid>
</Border>
</Grid>
<Border Margin="35">
<Grid>
Expand Down
1 change: 1 addition & 0 deletions MarkDownEditor/View/PreviewToolBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:p="clr-namespace:MarkDownEditor.Properties"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Margin="5" HorizontalAlignment="Right"
d:DesignHeight="300" d:DesignWidth="300">
<WrapPanel Orientation="Horizontal">
<WrapPanel.Resources>
Expand Down
Loading

0 comments on commit 77cf584

Please sign in to comment.