mirror of
https://github.com/Stone-Red-Code/Markdowser.git
synced 2026-09-04 00:56:13 +02:00
Add F11 fullscreen functionality
This commit is contained in:
@@ -29,6 +29,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
private ContentViewModelBase content;
|
private ContentViewModelBase content;
|
||||||
private TabItem currentTab = null!;
|
private TabItem currentTab = null!;
|
||||||
|
private WindowState windowState;
|
||||||
private bool showSidePanel;
|
private bool showSidePanel;
|
||||||
private bool isBusy;
|
private bool isBusy;
|
||||||
private int progress;
|
private int progress;
|
||||||
@@ -52,6 +53,12 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WindowState WindowState
|
||||||
|
{
|
||||||
|
get => windowState;
|
||||||
|
set => this.RaiseAndSetIfChanged(ref windowState, value);
|
||||||
|
}
|
||||||
|
|
||||||
public ContentViewModelBase Content
|
public ContentViewModelBase Content
|
||||||
{
|
{
|
||||||
get => content;
|
get => content;
|
||||||
@@ -143,6 +150,8 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
this.RaisePropertyChanged(nameof(CloseTabEnabled));
|
this.RaisePropertyChanged(nameof(CloseTabEnabled));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public ICommand ToggleFullScreen => ReactiveCommand.Create(() => WindowState = WindowState == WindowState.FullScreen ? WindowState.Normal : WindowState.FullScreen);
|
||||||
|
|
||||||
private MarkdownContentViewModel DefaultContent => new("New Tab", new StringBuilder()
|
private MarkdownContentViewModel DefaultContent => new("New Tab", new StringBuilder()
|
||||||
.AppendLine($"}-Transparent.png)")
|
.AppendLine($"}-Transparent.png)")
|
||||||
.AppendLine()
|
.AppendLine()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
x:DataType="vm:MainWindowViewModel"
|
x:DataType="vm:MainWindowViewModel"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded" WindowState="{Binding WindowState}">
|
||||||
|
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
<!-- This only sets the DataContext for the previewer in an IDE,
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
<Window.KeyBindings>
|
<Window.KeyBindings>
|
||||||
<KeyBinding Gesture="Ctrl+R" Command="{Binding Browse}" />
|
<KeyBinding Gesture="Ctrl+R" Command="{Binding Browse}" />
|
||||||
|
<KeyBinding Gesture="F5" Command="{Binding Browse}" />
|
||||||
<KeyBinding Gesture="Alt+Home" Command="{StaticResource HomeCommand}" />
|
<KeyBinding Gesture="Alt+Home" Command="{StaticResource HomeCommand}" />
|
||||||
<KeyBinding Gesture="Alt+H" Command="{StaticResource HomeCommand}" />
|
<KeyBinding Gesture="Alt+H" Command="{StaticResource HomeCommand}" />
|
||||||
<KeyBinding Gesture="Alt+Left" Command="{Binding Back}" />
|
<KeyBinding Gesture="Alt+Left" Command="{Binding Back}" />
|
||||||
@@ -39,6 +40,7 @@
|
|||||||
<KeyBinding Gesture="Ctrl+T" Command="{Binding NewTab}" />
|
<KeyBinding Gesture="Ctrl+T" Command="{Binding NewTab}" />
|
||||||
<KeyBinding Gesture="Ctrl+W" Command="{Binding CloseTab}" />
|
<KeyBinding Gesture="Ctrl+W" Command="{Binding CloseTab}" />
|
||||||
<KeyBinding Gesture="Alt+S" Command="{Binding ToggleSidePanel}" />
|
<KeyBinding Gesture="Alt+S" Command="{Binding ToggleSidePanel}" />
|
||||||
|
<KeyBinding Gesture="F11" Command="{Binding ToggleFullScreen}" />
|
||||||
</Window.KeyBindings>
|
</Window.KeyBindings>
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto, *, Auto">
|
<Grid RowDefinitions="Auto, *, Auto">
|
||||||
|
|||||||
Reference in New Issue
Block a user