Compare commits

..
2 Commits
Author SHA1 Message Date
Dario P. 73b7a48589 Normalize source whitespace 2026-10-15 22:46:29 +02:00
Dario P. 93ab510b9f Initial release of Orbit 1.1.2 2026-10-15 22:46:21 +02:00
21 changed files with 47 additions and 188 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
<Application x:Class="Orbit.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application x:Class="ShortcutsPanel.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
+1 -1
View File
@@ -1,5 +1,5 @@
using System.Windows;
namespace Orbit;
namespace ShortcutsPanel;
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
+1 -1
View File
@@ -1,7 +1,7 @@
using System.IO;
using System.Windows.Media.Imaging;
namespace Orbit;
namespace ShortcutsPanel;
public static class CustomIcons
{
+1 -1
View File
@@ -2,7 +2,7 @@ using System.IO;
using System.Text.Json;
using System.Text.RegularExpressions;
namespace Orbit;
namespace ShortcutsPanel;
public sealed record LibraryExport(int Version, List<Shortcut> Links, List<string> Collections);
+6 -11
View File
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text.Json;
@@ -7,7 +7,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace Orbit;
namespace ShortcutsPanel;
public partial class MainWindow
{
@@ -72,7 +72,7 @@ public partial class MainWindow
if (choice == MessageBoxResult.Cancel) return;
var next = choice == MessageBoxResult.Yes ? LibraryOperations.Merge(entries, incoming.Links) : incoming.Links;
var order = choice == MessageBoxResult.Yes ? collectionOrder.Concat(incoming.Collections).Distinct().ToList() : incoming.Collections;
if (Save(next, order)) { deleted.Clear(); UpdateUndoNotice(); dialog.Close(); }
if (Save(next, order)) { deleted.Clear(); if (undoButton != null) undoButton.IsEnabled = false; dialog.Close(); }
}
catch (Exception ex) { MessageBox.Show(dialog, ex.Message, "Import failed — library unchanged"); }
}); import.Margin = new Thickness(0,12,0,18); panel.Children.Add(import);
@@ -83,19 +83,14 @@ public partial class MainWindow
var index = entries.FindIndex(x => x.Id == item.Id); if (index < 0) return false;
var next = entries.ToList(); next.RemoveAt(index);
if (!Save(next)) return false;
deleted.Push((item, index)); UpdateUndoNotice(); return true;
}
void UpdateUndoNotice()
{
undoNotice.Visibility = deleted.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
status.Text = deleted.TryPeek(out var latest) ? $"Removed {latest.Item.Name}" : "";
if (undoButton != null) undoButton.IsEnabled = deleted.Count > 0;
deleted.Push((item, index)); if (undoButton != null) undoButton.IsEnabled = true;
status.Text = $"Deleted {item.Name} · Undo is available"; return true;
}
void UndoDelete()
{
if (!deleted.TryPeek(out var restore)) return;
var next = entries.ToList(); next.Insert(Math.Min(restore.Index, next.Count), restore.Item);
if (Save(next)) { deleted.Pop(); UpdateUndoNotice(); }
if (Save(next)) { deleted.Pop(); if (undoButton != null) undoButton.IsEnabled = deleted.Count > 0; }
}
void ManageCollections()
{
+14 -22
View File
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Windows;
@@ -7,7 +7,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Net.Http;
namespace Orbit;
namespace ShortcutsPanel;
public record Shortcut(string Name, string Url, string Group, string Color, string? Icon = null, string Id = "");
public partial class MainWindow : Window
{
@@ -17,9 +17,7 @@ public partial class MainWindow : Window
readonly TextBlock heading = new() { FontSize = 30, FontWeight = FontWeights.SemiBold };
static readonly Dictionary<string, Task<BitmapSource?>> logos = new();
readonly TextBox search = new() { Width = 280, ToolTip = "Search by name, website, or collection" };
readonly TextBlock websiteCount = new() { FontSize = 12, Foreground = Brush("#7B8377"), VerticalAlignment = VerticalAlignment.Center };
readonly TextBlock status = new() { FontSize = 12, VerticalAlignment = VerticalAlignment.Center, TextTrimming = TextTrimming.CharacterEllipsis };
Border undoNotice = null!;
readonly TextBlock status = new() { Foreground = Brush("#939DB8"), FontSize = 12 };
List<Shortcut> entries = [];
string selectedGroup = "All";
List<string> collectionOrder = [];
@@ -33,7 +31,7 @@ public partial class MainWindow : Window
try { Theme.Apply(settings.LoadDarkTheme()); }
catch { Theme.Apply(false); }
Background = Brush("#FAF9F6"); Foreground = Brush("#252924"); FontFamily = new FontFamily("Segoe UI");
Title = "Orbit"; Width = 1100; Height = 720; MinWidth = 800; MinHeight = 520;
Title = "Orbit • Shortcuts Panel"; Width = 1100; Height = 720; MinWidth = 800; MinHeight = 520;
WindowStartupLocation = WindowStartupLocation.CenterScreen; WindowState = WindowState.Maximized;
var root = new Grid(); Content = root;
root.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(210) });
@@ -41,7 +39,7 @@ public partial class MainWindow : Window
var sidebar = new DockPanel { Margin = new Thickness(20, 32, 20, 24) };
var sideSurface = new Border { Background = Brush("#F1F2ED"), BorderBrush = Brush("#E2E5DD"), BorderThickness = new Thickness(0,0,1,0), Child = sidebar }; root.Children.Add(sideSurface);
var brand = new StackPanel { Margin = new Thickness(12, 0, 0, 36) };
brand.Children.Add(new TextBlock { Text = "◉ Orbit", FontSize = 27, FontWeight = FontWeights.SemiBold, Foreground = Brush("#294B3C") });
brand.Children.Add(new TextBlock { Text = "◉ orbit", FontSize = 27, FontWeight = FontWeights.SemiBold, Foreground = Brush("#294B3C") });
brand.Children.Add(new TextBlock { Text = "A little more organized.", FontSize = 11, Foreground = Brush("#80877D"), Margin = new Thickness(1, 6, 0, 0) });
DockPanel.SetDock(brand, Dock.Top); sidebar.Children.Add(brand);
var bottom = new StackPanel();
@@ -70,23 +68,17 @@ public partial class MainWindow : Window
var top = new StackPanel(); DockPanel.SetDock(top, Dock.Top); main.Children.Add(top);
var header = new DockPanel(); top.Children.Add(header);
var add = Button("+ Add website", () => Edit(null), "#294B3D"); add.Foreground = Brushes.White; add.VerticalAlignment = VerticalAlignment.Center; DockPanel.SetDock(add, Dock.Right); header.Children.Add(add);
var titleRow = new DockPanel();
var countBadge = new Border { Background = Brush("#DFE6DA"), CornerRadius = new CornerRadius(10), Padding = new Thickness(10,5,10,5), Margin = new Thickness(14,0,18,0), VerticalAlignment = VerticalAlignment.Center, Child = websiteCount };
DockPanel.SetDock(heading, Dock.Left); titleRow.Children.Add(heading); titleRow.Children.Add(countBadge);
countBadge.HorizontalAlignment = HorizontalAlignment.Left;
header.Children.Add(titleRow);
header.Children.Add(heading);
top.Children.Add(new TextBlock { Text = "Your favorite places, thoughtfully collected.", FontSize = 13, Foreground = Brush("#7B8377"), Margin = new Thickness(0, 9, 0, 26) });
search.Width = double.NaN; search.HorizontalAlignment = HorizontalAlignment.Stretch;
search.ToolTip = "Search websites and collections";
System.Windows.Automation.AutomationProperties.SetName(search, "Search websites");
var searchRow = new DockPanel { Margin = new Thickness(0, 0, 8, 28) };
var searchLabel = new TextBlock { Text = "Search", VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(0,0,12,0), Foreground = Brush("#7B8377"), FontSize = 12 }; searchRow.Children.Add(searchLabel); searchRow.Children.Add(search); top.Children.Add(searchRow);
var noticeRow = new DockPanel();
undoButton = Button("Undo", UndoDelete); undoButton.Margin = new Thickness(16,0,0,0);
DockPanel.SetDock(undoButton, Dock.Right); noticeRow.Children.Add(undoButton);
status.Foreground = Brush("#374632"); noticeRow.Children.Add(status);
undoNotice = new Border { Background = Brush("#DFE6DA"), BorderBrush = Brush("#E2E5DD"), BorderThickness = new Thickness(1), CornerRadius = new CornerRadius(10), Padding = new Thickness(14,8,8,8), Margin = new Thickness(0,12,8,0), MaxWidth = 460, HorizontalAlignment = HorizontalAlignment.Left, Visibility = Visibility.Collapsed, Child = noticeRow };
DockPanel.SetDock(undoNotice, Dock.Bottom); main.Children.Add(undoNotice);
var footer = new DockPanel { Margin = new Thickness(0, 16, 8, 0) }; DockPanel.SetDock(footer, Dock.Bottom); main.Children.Add(footer);
undoButton = Button("Undo deletion", UndoDelete); undoButton.IsEnabled = false;
DockPanel.SetDock(undoButton, Dock.Right); footer.Children.Add(undoButton);
status.Foreground = Brush("#868D80"); footer.Children.Add(status);
main.Children.Add(new ScrollViewer { Content = cards, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled });
search.TextChanged += (_, _) => RenderCards();
Load(); Render();
@@ -134,9 +126,9 @@ public partial class MainWindow : Window
b.HorizontalContentAlignment = HorizontalAlignment.Stretch;
var row = new DockPanel { Width = 138 };
var number = new TextBlock { Text = count.ToString(), Foreground = Brush("#7B8377"), FontSize = 11, VerticalAlignment = VerticalAlignment.Center }; DockPanel.SetDock(number, Dock.Right); row.Children.Add(number);
row.Children.Add(new TextBlock { Text = name == "All" ? "▦ All Websites" : "• " + name, FontSize = 12, TextTrimming = TextTrimming.CharacterEllipsis, Foreground = Brush("#374632") });
row.Children.Add(new TextBlock { Text = name == "All" ? "▦ All websites" : "• " + name, FontSize = 12, TextTrimming = TextTrimming.CharacterEllipsis, Foreground = Brush("#374632") });
b.Content = row; b.Margin = new Thickness(0,0,0,6); groups.Children.Add(b);
System.Windows.Automation.AutomationProperties.SetName(b, name == "All" ? "All Websites" : name);
System.Windows.Automation.AutomationProperties.SetName(b, name == "All" ? "All websites" : name);
if (name != "All") ConfigureCollection(b, name);
}
RenderCards();
@@ -168,8 +160,8 @@ public partial class MainWindow : Window
cards.Children.Add(card); ConfigureCard(card, item);
}
if (filtered.Count == 0) cards.Children.Add(new TextBlock { Text = entries.Count == 0 ? "A fresh start. Add your first website above." : "No websites match. Try another search or collection.", FontSize = 18, Margin = new Thickness(0, 35, 0, 35) });
heading.Text = selectedGroup == "All" ? "All Websites" : selectedGroup;
websiteCount.Text = $"{filtered.Count} {(filtered.Count == 1 ? "Website" : "Websites")}";
heading.Text = selectedGroup == "All" ? "All websites" : selectedGroup;
status.Text = $"{filtered.Count} websites · Opens in your default browser";
}
static async Task ApplyLogo(Border badge, string url)
{
+5 -36
View File
@@ -1,18 +1,6 @@
# Orbit
A portable C# / WPF website launcher for Windows.
[**Download for Windows**](https://github.com/donishki/orbit/releases/latest) | [Features](#features) | [Build from source](#build)
## Screenshots
### Charcoal
![Orbit in charcoal mode, showing website cards and the collection sidebar](docs/screenshots/orbit-dark.png)
### Light
![Orbit in light mode, showing website cards and the collection sidebar](docs/screenshots/orbit-light.png)
A portable C# / WPF website launcher for Windows, created by **Dario P.**
## Features
@@ -25,13 +13,9 @@ A portable C# / WPF website launcher for Windows.
## Run
Choose a Windows x64 (64-bit) or x86 (32-bit) download from [Releases](https://github.com/donishki/orbit/releases/latest):
- **Orbit-Setup-win-x64.exe**: installs Orbit for your Windows account, adds a Start menu shortcut, and offers an optional desktop shortcut. Remove it through Windows Settings > Apps.
- **Orbit-Portable-win-x64.zip**: extract and run `Orbit.exe`, without installing.
- **Orbit-Setup-win-x86.exe** / **Orbit-Portable-win-x86.zip**: the equivalent 32-bit versions.
All packages include .NET. Use x64 for 64-bit Windows 10/11, or x86 for 32-bit Windows 10 (also runnable on 64-bit Windows). The installer defaults to `%LOCALAPPDATA%\Programs\Orbit`, requires no administrator password, and preserves links and settings during upgrades and uninstall. The x86 installer uses `%LOCALAPPDATA%\Programs\Orbit-x86` and labels shortcuts "Orbit (32-bit)" so both architectures can coexist. Installed and portable copies share the same settings for your account.
Download the portable Windows x64 package from this repository's Releases page,
extract it, and run `ShortcutsPanel.exe`. No installer or separate .NET runtime
is required. Windows 10 or Windows 11, 64-bit.
## Settings
@@ -48,24 +32,9 @@ the theme remains local. Undo history lasts for the current session.
Requires Windows and the .NET 8 SDK.
```powershell
dotnet publish Orbit.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -o release
dotnet publish ShortcutsPanel.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -o release
```
For the 32-bit portable build, replace `win-x64` with `win-x86` and use a separate output directory.
### Build the installer
Install Inno Setup 7, then run:
```powershell
./installer/Build-Installer.ps1
./installer/Build-Installer.ps1 -Architecture x86
```
Use `-IsccPath` for a compiler installed elsewhere. The output is
`release/Orbit-Setup-win-x64.exe` or `release/Orbit-Setup-win-x86.exe`. The installer bundles the runtime as normal
files so the installed app does not need to extract it on launch.
## Checks
```powershell
+5 -11
View File
@@ -1,12 +1,8 @@
ORBIT 1.1.3 - WEBSITE SHORTCUTS
ORBIT 1.1.2 - WEBSITE SHORTCUTS
Created by Dario P.
Run Orbit.exe. Choose x64 for 64-bit Windows 10/11, or x86 for 32-bit
Windows 10. The x86 version also runs on 64-bit Windows.
The portable version needs no installer or separate .NET installation.
Alternatively, run Orbit-Setup-win-x64.exe or Orbit-Setup-win-x86.exe to install Orbit for your Windows
account with a Start menu shortcut and optional desktop shortcut. Uninstall
through Windows Settings > Apps. Saved links and settings are preserved.
Run ShortcutsPanel.exe on 64-bit Windows 10 or Windows 11.
No installer or separate .NET installation is required.
NEW IN 1.1
- Import / Export: share a JSON library including custom icons and collection
@@ -24,7 +20,7 @@ NEW IN 1.1
Importing a library clears undo history. Undo history is not saved on exit.
- Open collection is available in Manage collections and the right-click menu.
Opening multiple sites asks for confirmation and opens each distinct URL once.
- About Orbit displays version 1.1.3 and author Dario P.
- About Orbit displays version 1.1.2 and author Dario P.
Add, edit, delete, search, and group website cards. Dark mode is optional.
Website icons are discovered from page metadata, then /favicon.ico.
@@ -48,7 +44,7 @@ The bundled .NET runtime extracts supporting files to temporary storage.
This executable is not digitally signed.
Build:
dotnet publish Orbit.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -o release
dotnet publish ShortcutsPanel.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=None -p:DebugSymbols=false -o release
Checks:
dotnet run --project tests/StorageChecks.csproj
@@ -58,5 +54,3 @@ dotnet run --project tests/ThemeChecks.csproj
1.1.1: aligned sidebar rows, whole-card dragging, and the Orbit icon in About.
1.1.2: starts maximized; green outer borders for drag/focus; Dark mode is at the sidebar bottom; About credits Dario P. and 2026.
1.1.3: Orbit naming throughout; website count beside the heading; contextual Undo notice; cleaner library layout.
+1 -1
View File
@@ -2,7 +2,7 @@ using System.IO;
using System.Text.Json;
using Microsoft.Win32;
namespace Orbit;
namespace ShortcutsPanel;
public sealed class SettingsStore
{
+2 -5
View File
@@ -6,11 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>app.ico</ApplicationIcon>
<AssemblyName>Orbit</AssemblyName>
<Version>1.1.3</Version>
<Product>Orbit</Product>
<Title>Orbit</Title>
<Description>Orbit website launcher</Description>
<AssemblyName>ShortcutsPanel</AssemblyName>
<Version>1.1.2</Version>
</PropertyGroup>
<ItemGroup><Compile Remove="tests/**/*.cs" /></ItemGroup>
<ItemGroup><EmbeddedResource Include="app.ico" LogicalName="OrbitIcon" /></ItemGroup>
+2 -2
View File
@@ -1,4 +1,4 @@
using System.Windows;
using System.Windows;
using System.Windows.Media;
@@ -8,7 +8,7 @@ using System.ComponentModel;
namespace Orbit;
namespace ShortcutsPanel;
+1 -1
View File
@@ -5,7 +5,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Media.Imaging;
namespace Orbit;
namespace ShortcutsPanel;
public static class WebsiteIcons
{
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

-12
View File
@@ -1,12 +0,0 @@
param([ValidateSet("x64", "x86")][string]$Architecture = "x64", [string]$IsccPath = "${env:ProgramFiles(x86)}\Inno Setup 7\ISCC.exe")
$ErrorActionPreference = 'Stop'
$projectRoot = Split-Path $PSScriptRoot -Parent
if (!(Test-Path -LiteralPath $IsccPath)) { throw "Inno Setup compiler not found. Supply -IsccPath with the path to ISCC.exe." }
Push-Location $projectRoot
try {
dotnet publish Orbit.csproj -c Release -r "win-$Architecture" --self-contained true -p:PublishSingleFile=false -p:DebugType=None -p:DebugSymbols=false -o "release/installer-payload-$Architecture"
if ($LASTEXITCODE -ne 0) { throw 'Publish failed.' }
Copy-Item README.txt "release/installer-payload-$Architecture/README.txt"
& $IsccPath "/DArch=$Architecture" installer/Orbit.iss
if ($LASTEXITCODE -ne 0) { throw 'Installer compilation failed.' }
} finally { Pop-Location }
-57
View File
@@ -1,57 +0,0 @@
#ifndef Arch
#define Arch "x64"
#endif
#define Payload "..\release\installer-payload-" + Arch
#define AppVersion GetVersionNumbersString(Payload + "\Orbit.exe")
[Setup]
#if Arch == "x86"
AppId={{A2A7C189-843C-4D5F-B2F3-05A80A936C95}
DefaultDirName={localappdata}\Programs\Orbit-x86
#define ShortcutName "Orbit (32-bit)"
#else
AppId={{60E686D4-296A-41D2-B445-5DDC79FD2A2C}
DefaultDirName={localappdata}\Programs\Orbit
#define ShortcutName "Orbit"
#endif
AppName=Orbit
AppVersion={#AppVersion}
AppPublisher=Dario P.
AppPublisherURL=https://github.com/donishki/orbit
AppSupportURL=https://github.com/donishki/orbit/issues
AppUpdatesURL=https://github.com/donishki/orbit/releases/latest
DefaultGroupName=Orbit
DisableProgramGroupPage=yes
PrivilegesRequired=lowest
SetupArchitecture=x86
#if Arch == "x64"
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
#else
ArchitecturesAllowed=x86compatible
#endif
MinVersion=10.0
OutputDir=..\release
OutputBaseFilename=Orbit-Setup-win-{#Arch}
SetupIconFile=..\app.ico
UninstallDisplayIcon={app}\Orbit.exe
UninstallDisplayName={#ShortcutName}
WizardStyle=modern
Compression=lzma2
SolidCompression=yes
CloseApplications=yes
RestartApplications=no
[Tasks]
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Shortcuts:"; Flags: unchecked
[Files]
Source: "{#Payload}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#ShortcutName}"; Filename: "{app}\Orbit.exe"; WorkingDir: "{app}"
Name: "{autodesktop}\{#ShortcutName}"; Filename: "{app}\Orbit.exe"; WorkingDir: "{app}"; Tasks: desktopicon
[Run]
Filename: "{app}\Orbit.exe"; Description: "Launch Orbit"; Flags: nowait postinstall skipifsilent
; Deliberately do not remove the user's %LOCALAPPDATA%\Orbit settings on uninstall.
+1 -5
View File
@@ -3,7 +3,7 @@ using System.Reflection;
using System.Text.Json;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Orbit;
using ShortcutsPanel;
internal static class FeatureChecks
{
@@ -17,8 +17,6 @@ internal static class FeatureChecks
var app = new App(); app.InitializeComponent();
Check(MainWindow.LoadAppIcon().PixelWidth > 0, "About icon loads from embedded resource");
var window = new MainWindow(store);
var notice = (System.Windows.Controls.Border)typeof(MainWindow).GetField("undoNotice", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(window)!;
Check(window.Title == "Orbit" && notice.Visibility == System.Windows.Visibility.Collapsed, "Orbit title and hidden initial Undo notice");
object? Call(string method, params object?[] args) => typeof(MainWindow).GetMethod(method, BindingFlags.NonPublic | BindingFlags.Instance)!.Invoke(window, args);
try
{
@@ -33,9 +31,7 @@ internal static class FeatureChecks
Check(JsonSerializer.Deserialize<List<Shortcut>>(store.Load()!)![0].Name == "C", "Card order persists");
Check((bool)Call("DeleteShortcut", original[0])!, "Delete shortcut");
Check(JsonSerializer.Deserialize<List<Shortcut>>(store.Load()!)!.Count == 2, "Deletion saved");
Check(notice.Visibility == System.Windows.Visibility.Visible, "Undo notice appears after deletion");
Call("UndoDelete");
Check(notice.Visibility == System.Windows.Visibility.Collapsed, "Undo notice hides after restoring last deletion");
Check(JsonSerializer.Deserialize<List<Shortcut>>(store.Load()!)!.Select(x => x.Name).SequenceEqual(new[] { "C", "A", "B" }), "Undo restores original position");
var pngPath = Path.Combine(directory, "icon.png");
var bitmap = BitmapSource.Create(2, 2, 96, 96, PixelFormats.Bgra32, null, new byte[] { 0,0,255,255, 0,255,0,255, 255,0,0,255, 255,255,255,255 }, 8);
+1 -1
View File
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net8.0-windows</TargetFramework><UseWPF>true</UseWPF><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><EnableDefaultCompileItems>false</EnableDefaultCompileItems></PropertyGroup>
<ItemGroup><Compile Include="FeatureChecks.cs"/><ProjectReference Include="../Orbit.csproj"/></ItemGroup>
<ItemGroup><Compile Include="FeatureChecks.cs"/><ProjectReference Include="../ShortcutsPanel.csproj"/></ItemGroup>
</Project>
+1 -1
View File
@@ -1,5 +1,5 @@
using Microsoft.Win32;
using Orbit;
using ShortcutsPanel;
var key = @"Software\OrbitStorageChecks\" + Guid.NewGuid().ToString("N");
var folder = Path.Combine(Path.GetTempPath(), "OrbitStorageChecks-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(folder);
+3 -18
View File
@@ -3,7 +3,7 @@ using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;
using Orbit;
using ShortcutsPanel;
internal static class ThemeChecks
{
@@ -16,26 +16,16 @@ internal static class ThemeChecks
foreach (var site in new[] { "https://github.com", "https://www.google.com" })
Console.WriteLine("Live icon " + site + ": " + (WebsiteIcons.Fetch(site).GetAwaiter().GetResult() != null ? "loaded" : "fallback"));
var app = new App(); app.InitializeComponent();
SynchronizationContext.SetSynchronizationContext(new System.Windows.Threading.DispatcherSynchronizationContext());
var isolated = Path.Combine(Path.GetTempPath(), "OrbitPreview-" + Guid.NewGuid().ToString("N"));
var window = new MainWindow(new SettingsStore(@"Software\OrbitPreview-" + Guid.NewGuid().ToString("N"), Path.Combine(isolated, "absent.json"), isolated));
var window = new MainWindow();
var content = (FrameworkElement)window.Content;
window.WindowState = WindowState.Normal;
content.Width = 1100; content.Height = 680;
// Let asynchronous website icons finish without reading or altering the user's library.
var wait = new System.Windows.Threading.DispatcherFrame();
var timer = new System.Windows.Threading.DispatcherTimer { Interval = TimeSpan.FromSeconds(8) };
timer.Tick += (_, _) => { timer.Stop(); wait.Continue = false; };
timer.Start(); System.Windows.Threading.Dispatcher.PushFrame(wait);
var output = Path.Combine(Path.GetTempPath(), "OrbitThemePreview"); Directory.CreateDirectory(output);
foreach (var dark in new[] { false, true, false })
{
Theme.Apply(dark);
SetSwitch(content, dark);
content.Measure(new Size(1100, 680)); content.Arrange(new Rect(0, 0, 1100, 680)); content.UpdateLayout();
if (((SolidColorBrush)window.Background).Color != (Color)ColorConverter.ConvertFromString(dark ? "#202020" : "#FAF9F6")) throw new Exception("Window theme did not update");
var bitmap = new RenderTargetBitmap(1100, 680, 96, 96, PixelFormats.Pbgra32);
var frame = new DrawingVisual(); using (var dc = frame.RenderOpen()) { dc.DrawRectangle(window.Background, null, new Rect(0,0,1100,680)); dc.DrawRectangle(new VisualBrush(content) { ViewboxUnits = BrushMappingMode.Absolute, Viewbox = new Rect(0,0,1100,680) }, null, new Rect(0,0,1100,680)); }
var frame = new DrawingVisual(); using (var dc = frame.RenderOpen()) { dc.DrawRectangle(window.Background, null, new Rect(0,0,1100,680)); dc.DrawRectangle(new VisualBrush(content), null, new Rect(0,0,1100,680)); }
bitmap.Render(frame); var encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(bitmap));
using var file = File.Create(Path.Combine(output, dark ? "dark.png" : "light.png")); encoder.Save(file);
Console.WriteLine("PASS rendered " + (dark ? "dark" : "light") + " theme");
@@ -43,9 +33,4 @@ internal static class ThemeChecks
Console.WriteLine(output);
window.Close(); app.Shutdown();
}
static void SetSwitch(DependencyObject parent, bool dark)
{
if (parent is CheckBox toggle && toggle.Content as string == "Dark mode") toggle.IsChecked = dark;
for (int index = 0; index < VisualTreeHelper.GetChildrenCount(parent); index++) SetSwitch(VisualTreeHelper.GetChild(parent, index), dark);
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net8.0-windows</TargetFramework><UseWPF>true</UseWPF><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><EnableDefaultCompileItems>false</EnableDefaultCompileItems></PropertyGroup>
<ItemGroup><Compile Include="ThemeChecks.cs"/><ProjectReference Include="../Orbit.csproj"/></ItemGroup>
<ItemGroup><Compile Include="ThemeChecks.cs"/><ProjectReference Include="../ShortcutsPanel.csproj"/></ItemGroup>
</Project>