Compare commits

..

No commits in common. "master" and "v0.1.6" have entirely different histories.

9 changed files with 10 additions and 94 deletions

View File

@ -15,9 +15,6 @@ jobs:
run: echo "${LOCIP} gitea.comnenos" >> /etc/hosts
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install Build Dependencies
run: |
@ -95,21 +92,6 @@ jobs:
run: |
VERSION=${GITHUB_REF#refs/tags/}
# Explicitly fetch the tag with annotation
echo "Fetching tag ${VERSION} with annotation..."
git fetch origin tag ${VERSION} --force
# Get the tag annotation message (not the commit message)
echo "Extracting tag annotation..."
TAG_MESSAGE=$(git cat-file tag ${VERSION} | sed '1,/^$/d')
echo "Tag annotation: ${TAG_MESSAGE}"
# Create release body
RELEASE_BODY=$(printf "%s\n\n## Downloads\n\n### Linux\n- **AppImage**: Portable, single-file executable (no installation needed)\n- **Tarball**: Extract and run \`sudo ./install.sh\` to install\n\n### Windows\n- **Zip**: Extract and run \`NotePad.exe\`" "$TAG_MESSAGE")
# Escape the full body for JSON
RELEASE_BODY_JSON=$(printf '%s' "$RELEASE_BODY" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
# Create release
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
@ -117,7 +99,7 @@ jobs:
-d "{
\"tag_name\": \"${VERSION}\",
\"name\": \"NotePad ${VERSION}\",
\"body\": \"${RELEASE_BODY_JSON}\"
\"body\": \"Release ${VERSION}\n\n## Downloads\n\n### Linux\n- **AppImage**: Portable, single-file executable (no installation needed)\n- **Tarball**: Extract and run \`sudo ./install.sh\` to install\n\n### Windows\n- **Zip**: Extract and run \`NotePad.exe\`\"
}" > release_response.json
RELEASE_ID=$(cat release_response.json | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)

View File

@ -15,12 +15,7 @@ public partial class App : Application
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
string? fileToOpen = null;
if (desktop.Args?.Length > 0)
{
fileToOpen = desktop.Args[0];
}
desktop.MainWindow = new MainWindow(fileToOpen);
desktop.MainWindow = new MainWindow();
}
base.OnFrameworkInitializationCompleted();

View File

@ -4,27 +4,6 @@
Title="Untitled - Notepad"
Width="600" Height="400">
<Window.Styles>
<Style Selector="Menu">
<Setter Property="Background" Value="#D3D3D3"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Background" Value="#D3D3D3"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
<Style Selector="MenuItem:pointerover /template/ Border#PART_LayoutRoot">
<Setter Property="Background" Value="#A9A9A9"/>
</Style>
<Style Selector="MenuItem:open /template/ Popup#PART_Popup > Border">
<Setter Property="Background" Value="#D3D3D3"/>
<Setter Property="BorderBrush" Value="#A9A9A9"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Separator">
<Setter Property="Background" Value="#A9A9A9"/>
</Style>
</Window.Styles>
<DockPanel>
<!-- Menu Bar -->
<Menu DockPanel.Dock="Top">
@ -50,7 +29,7 @@
<MenuItem Header="F_ormat">
<MenuItem Header="_Word Wrap" x:Name="WordWrapMenuItem" Click="OnWordWrapToggle">
<MenuItem.Icon>
<CheckBox x:Name="WordWrapCheckBox" IsChecked="False" IsHitTestVisible="False"/>
<CheckBox x:Name="WordWrapCheckBox" IsChecked="True" IsHitTestVisible="False"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
@ -64,7 +43,7 @@
<TextBox x:Name="EditorTextBox"
AcceptsReturn="True"
AcceptsTab="True"
TextWrapping="NoWrap"
TextWrapping="Wrap"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ScrollViewer.VerticalScrollBarVisibility="Auto"
@ -73,8 +52,8 @@
Background="White"
Foreground="Black"
CaretBrush="Black"
FontFamily="Courier New,Liberation Mono,Courier,monospace"
FontSize="13"
FontFamily="Consolas,Courier New,monospace"
FontSize="12"
ClearSelectionOnLostFocus="False">
<TextBox.Styles>
<Style Selector="TextBox">

View File

@ -17,11 +17,7 @@ namespace NotePad
private bool _isModified;
private string? _originalText;
public MainWindow() : this(null)
{
}
public MainWindow(string? fileToOpen)
public MainWindow()
{
InitializeComponent();
UpdateTitle();
@ -30,30 +26,6 @@ namespace NotePad
textBox.TextChanged += OnTextChanged;
Closing += OnWindowClosing;
if (!string.IsNullOrEmpty(fileToOpen) && File.Exists(fileToOpen))
{
_ = LoadFileAsync(fileToOpen);
}
}
private async Task LoadFileAsync(string filePath)
{
try
{
var text = await File.ReadAllTextAsync(filePath);
_currentFilePath = filePath;
_currentFileName = Path.GetFileName(filePath);
this.FindControl<TextBox>("EditorTextBox")!.Text = text;
_originalText = text;
_isModified = false;
UpdateTitle();
}
catch (Exception)
{
// Silently ignore file loading errors on startup
}
}
private void UpdateTitle()
@ -294,17 +266,7 @@ namespace NotePad
var textBox = this.FindControl<TextBox>("EditorTextBox")!;
checkBox.IsChecked = !checkBox.IsChecked;
if (checkBox.IsChecked == true)
{
textBox.TextWrapping = TextWrapping.Wrap;
ScrollViewer.SetHorizontalScrollBarVisibility(textBox, Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled);
}
else
{
textBox.TextWrapping = TextWrapping.NoWrap;
ScrollViewer.SetHorizontalScrollBarVisibility(textBox, Avalonia.Controls.Primitives.ScrollBarVisibility.Auto);
}
textBox.TextWrapping = checkBox.IsChecked == true ? TextWrapping.Wrap : TextWrapping.NoWrap;
}
// Edit Menu

View File

@ -7,7 +7,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>img\notepad-icon.ico</ApplicationIcon>
<Version>0.1.17</Version>
<Version>0.1.6</Version>
</PropertyGroup>
<ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -2,9 +2,7 @@
A simple cross-platform text editor built with Avalonia UI and .NET 8.
| Windows | Linux |
|-----------------------------------------------------------------| ----- |
| ![Windows Screenshot](NotePad/img/notepad-screenshot-win11.png) | ![Linux Screenshot](NotePad/img/notepad-screenshot-linux.png) |
![Screenshot](NotePad/img/notepad-screenshot.png)
## Installation