-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
738 additions
and
938 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish-Release-To-Artifacts | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
strategy: | ||
matrix: | ||
kind: ['linux', 'windows', 'macOS'] | ||
include: | ||
- kind: linux | ||
os: ubuntu-latest | ||
target: linux-x64 | ||
- kind: windows | ||
os: windows-latest | ||
target: win-x64 | ||
- kind: macOS | ||
os: macos-latest | ||
target: osx-x64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Setup dotnet | ||
uses: actions/[email protected] | ||
|
||
- name: Build | ||
shell: bash | ||
run: | | ||
tag=$(git describe --tags --abbrev=0) | ||
release_name="SharpFM.App-$tag-${{ matrix.target }}" | ||
# Build everything | ||
dotnet publish SharpFM.App/SharpFM.App.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name" | ||
# Pack files | ||
if [ "${{ matrix.target }}" == "win-x64" ]; then | ||
# Pack to zip for Windows | ||
7z a -tzip "${release_name}.zip" "./${release_name}/*" | ||
else | ||
tar czvf "${release_name}.tar.gz" "$release_name" | ||
fi | ||
# Delete output directory | ||
rm -r "$release_name" | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "SharpFM.App*" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,11 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "C#: SharpFM.App", | ||
"type": "dotnet", | ||
"request": "launch", | ||
"projectPath": "${workspaceFolder}\\SharpFM.App\\SharpFM.App.csproj", | ||
"launchConfigurationId": "TargetFramework=;SharpFM.App" | ||
} | ||
] | ||
} |
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,33 @@ | ||
{ | ||
"workbench.colorCustomizations": { | ||
"activityBar.activeBackground": "#fa1b49", | ||
"activityBar.background": "#fa1b49", | ||
"activityBar.foreground": "#e7e7e7", | ||
"activityBar.inactiveForeground": "#e7e7e799", | ||
"activityBarBadge.background": "#155e02", | ||
"activityBarBadge.foreground": "#e7e7e7", | ||
"commandCenter.border": "#e7e7e799", | ||
"sash.hoverBorder": "#fa1b49", | ||
"statusBar.background": "#dd0531", | ||
"statusBar.foreground": "#e7e7e7", | ||
"statusBarItem.hoverBackground": "#fa1b49", | ||
"statusBarItem.remoteBackground": "#dd0531", | ||
"statusBarItem.remoteForeground": "#e7e7e7", | ||
"titleBar.activeBackground": "#dd0531", | ||
"titleBar.activeForeground": "#e7e7e7", | ||
"titleBar.inactiveBackground": "#dd053199", | ||
"titleBar.inactiveForeground": "#e7e7e799" | ||
}, | ||
"peacock.color": "#dd0531", | ||
"cSpell.words": [ | ||
"Avalonia", | ||
"filemaker", | ||
"fmxmlsnippet", | ||
"Mvvm", | ||
"xdoc", | ||
"XMFD", | ||
"XMSC", | ||
"XMSS", | ||
"XMTB" | ||
] | ||
} |
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,41 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/SharpFM.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/SharpFM.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"--project", | ||
"${workspaceFolder}/SharpFM.sln" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
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,11 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="SharpFM.App.App" | ||
RequestedThemeVariant="Default"> | ||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | ||
|
||
<Application.Styles> | ||
<FluentTheme /> | ||
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" /> | ||
</Application.Styles> | ||
</Application> |
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,27 @@ | ||
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
using SharpFM.App.ViewModels; | ||
|
||
namespace SharpFM.App; | ||
|
||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow | ||
{ | ||
DataContext = new MainWindowViewModel() | ||
}; | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.23 KB
SharpFM.App/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,64 @@ | ||
using System; | ||
using Avalonia; | ||
using Avalonia.Xaml.Interactivity; | ||
using AvaloniaEdit; | ||
using AvaloniaEdit.Utils; | ||
|
||
namespace SharpFM.App.Behaviors; | ||
|
||
public class DocumentTextBindingBehavior : Behavior<TextEditor> | ||
{ | ||
private TextEditor _textEditor = null!; | ||
|
||
public static readonly StyledProperty<string> TextProperty = | ||
AvaloniaProperty.Register<DocumentTextBindingBehavior, string>(nameof(Text)); | ||
|
||
public string Text | ||
{ | ||
get => GetValue(TextProperty); | ||
set => SetValue(TextProperty, value); | ||
} | ||
|
||
protected override void OnAttached() | ||
{ | ||
base.OnAttached(); | ||
|
||
if (AssociatedObject is TextEditor textEditor) | ||
{ | ||
_textEditor = textEditor; | ||
_textEditor.TextChanged += TextChanged; | ||
this.GetObservable(TextProperty).Subscribe(TextPropertyChanged); | ||
} | ||
} | ||
|
||
protected override void OnDetaching() | ||
{ | ||
base.OnDetaching(); | ||
|
||
if (_textEditor != null) | ||
{ | ||
_textEditor.TextChanged -= TextChanged; | ||
} | ||
} | ||
|
||
private void TextChanged(object? sender, EventArgs eventArgs) | ||
{ | ||
if (_textEditor != null && _textEditor.Document != null) | ||
{ | ||
Text = _textEditor.Document.Text; | ||
} | ||
} | ||
|
||
private void TextPropertyChanged(string text) | ||
{ | ||
if (_textEditor != null && _textEditor.Document != null && text != null) | ||
{ | ||
var caretOffset = _textEditor.CaretOffset; | ||
_textEditor.Document.Text = text; | ||
if (caretOffset <= text.Length) | ||
{ | ||
_textEditor.CaretOffset = caretOffset; | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.