-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from Natestah/master
Change Theme to a DropDown with flyout
- Loading branch information
Showing
13 changed files
with
229 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.ObjectModel; | ||
using ReactiveUI; | ||
using TextMateSharp.Grammars; | ||
|
||
namespace AvaloniaEdit.Demo.ViewModels; | ||
|
||
public class MainWindowViewModel(TextMate.TextMate.Installation _textMateInstallation, RegistryOptions _registryOptions) : ReactiveObject | ||
{ | ||
public ObservableCollection<ThemeViewModel> AllThemes { get; set; } = []; | ||
private ThemeViewModel _selectedTheme; | ||
|
||
public ThemeViewModel SelectedTheme | ||
{ | ||
get => _selectedTheme; | ||
set | ||
{ | ||
this.RaiseAndSetIfChanged(ref _selectedTheme, value); | ||
_textMateInstallation.SetTheme(_registryOptions.LoadTheme(value.ThemeName)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using TextMateSharp.Grammars; | ||
|
||
namespace AvaloniaEdit.Demo.ViewModels; | ||
|
||
public class ThemeViewModel | ||
{ | ||
private ThemeName _themeName; | ||
|
||
public ThemeName ThemeName => _themeName; | ||
|
||
public string DisplayName => _themeName.ToString(); | ||
public ThemeViewModel(ThemeName themeName) | ||
{ | ||
_themeName = themeName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.