Skip to content

Commit

Permalink
viewer experiments (#452)
Browse files Browse the repository at this point in the history
ui improvements
  • Loading branch information
aloneguid authored Jan 10, 2024
1 parent a1932a2 commit 5951314
Show file tree
Hide file tree
Showing 38 changed files with 415 additions and 279 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

on:
push:
branches: [ master, viewer-take-2 ]
branches: [ master ]

pull_request:
branches: [ master ]
Expand Down Expand Up @@ -113,8 +113,8 @@ jobs:
LATEST_NET_ONLY: true
run: |
envsubst < src/Parquet/Globals.cs > g.tmp && mv g.tmp src/Parquet/Globals.cs
dotnet restore src/Parquet.Floor.Desktop/Parquet.Floor.Desktop.csproj
dotnet publish src/Parquet.Floor.Desktop/Parquet.Floor.Desktop.csproj -c release -r ${{ matrix.rid }} -o floor-pub/${{ matrix.rid }} /p:Version=${{ env.VERSION }} /p:FileVersion=${{ env.VERSION }} /p:AssemblyVersion=${{ env.ASM_VERSION }}
dotnet restore src/Parquet.Floor/Parquet.Floor.csproj
dotnet publish src/Parquet.Floor/Parquet.Floor.csproj -c release -r ${{ matrix.rid }} -o floor-pub/${{ matrix.rid }} /p:Version=${{ env.VERSION }} /p:FileVersion=${{ env.VERSION }} /p:AssemblyVersion=${{ env.ASM_VERSION }}
mkdir -p floor-dist
zip -r -9 -j floor-dist/floor-${{ matrix.rid }}-${{ env.VERSION }}.zip floor-pub/${{ matrix.rid }}/* -x *.pdb *.xml
Expand Down
4 changes: 4 additions & 0 deletions docs/release-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

- `NetBox` was exposing some internal types (#451)

### Experimental

**Parquet Floor** (reference implementation of desktop viewer) user interface improvements.

## 4.20.0

### New features
Expand Down
22 changes: 0 additions & 22 deletions src/Parquet.Floor.Desktop/Parquet.Floor.Desktop.csproj

This file was deleted.

16 changes: 0 additions & 16 deletions src/Parquet.Floor.Desktop/Properties/launchSettings.json

This file was deleted.

Binary file removed src/Parquet.Floor.Desktop/icon.ico
Binary file not shown.
10 changes: 8 additions & 2 deletions src/Parquet.Floor/App.axaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Parquet.Floor.App"
RequestedThemeVariant="Dark">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui"
xmlns:generation="using:ActiproSoftware.UI.Avalonia.Themes.Generation">

<Application.Styles>
<FluentTheme DensityStyle="Compact" />
<StyleInclude Source="/Styles.axaml"/>
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
<StyleInclude
Source="avares://Avalonia.Controls.TreeDataGrid/Themes/Fluent.axaml"/>
<actipro:ModernTheme>
<actipro:ModernTheme.Definition>
<generation:ThemeDefinition UserInterfaceDensity="Normal" />
</actipro:ModernTheme.Definition>
</actipro:ModernTheme>
<actipro:ModernTheme Includes="NativeDataGrid"/>
</Application.Styles>
</Application>
10 changes: 4 additions & 6 deletions src/Parquet.Floor/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ public override void OnFrameworkInitializationCompleted() {
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);

var model = new MainViewModel();

if(ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) {
desktop.MainWindow = new MainWindow {
DataContext = new MainViewModel()
};
desktop.MainWindow = new MainWindow() { DataContext = model };
} else if(ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) {
singleViewPlatform.MainView = new MainView {
DataContext = new MainViewModel()
};
singleViewPlatform.MainView = new MainView() { DataContext = model };
}

base.OnFrameworkInitializationCompleted();
Expand Down
Binary file added src/Parquet.Floor/Assets/icons/col/bytearray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Parquet.Floor/Assets/icons/col/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Parquet.Floor/Assets/icons/col/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Parquet.Floor/Assets/icons/col/number.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Parquet.Floor/Assets/icons/col/string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Parquet.Floor/Assets/icons/col/struct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/Parquet.Floor/Assets/icons/diagram.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/glasses.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/information.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/map.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/open.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/raw-extension.png
Binary file not shown.
Binary file removed src/Parquet.Floor/Assets/icons/trophy.png
Binary file not shown.
74 changes: 74 additions & 0 deletions src/Parquet.Floor/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System.Diagnostics;
using Parquet.Meta;

namespace Parquet.Floor {
static class Extensions {
public static string ToSimpleString(this LogicalType? lt) {
if(lt == null)
return string.Empty;

if(lt.UUID != null)
return "UUID";

if(lt.STRING != null)
return "STRING";

if(lt.MAP != null)
return "MAP";

if(lt.LIST != null)
return "LIST";

if(lt.ENUM != null)
return "ENUM";

if(lt.DECIMAL != null)
return $"DECIMAL (precision: {lt.DECIMAL.Precision}, scale: {lt.DECIMAL.Scale})";

if(lt.DATE != null)
return $"DATE";

if(lt.TIME != null) {
string unit = lt.TIME.Unit.MICROS != null
? "MICROS"
: lt.TIME.Unit.MILLIS != null
? "MILLIS"
: "NANOS";
return $"TIME (unit: {unit}, isAdjustedToUTC: {lt.TIME.IsAdjustedToUTC})";
}

if(lt.TIMESTAMP != null) {
string unit = lt.TIMESTAMP.Unit.MICROS != null
? "MICROS"
: lt.TIMESTAMP.Unit.MILLIS != null
? "MILLIS"
: "NANOS";
return $"TIMESTAMP (unit: {unit}, isAdjustedToUTC: {lt.TIMESTAMP.IsAdjustedToUTC})";
}

if(lt.INTEGER != null)
return $"INTEGER (bitWidth: {lt.INTEGER.BitWidth}, isSigned: {lt.INTEGER.IsSigned})";

if(lt.UNKNOWN != null)
return "UNKNOWN";

if(lt.JSON != null)
return "JSON";

if(lt.BSON != null)
return "BSON";

if(lt.UUID != null)
return "UUID";

return "?";
}

public static void OpenInBrowser(this string url) {
var p = new Process();
p.StartInfo.UseShellExecute = true;
p.StartInfo.FileName = url;
p.Start();
}
}
}
30 changes: 20 additions & 10 deletions src/Parquet.Floor/Parquet.Floor.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyName>floor</AssemblyName>
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<ApplicationIcon>Assets/icon.ico</ApplicationIcon>
</PropertyGroup>


Expand All @@ -15,12 +23,6 @@
<ItemGroup>
<None Remove="Assets\icon.ico" />
<None Remove="Assets\icons\bat_dead.png" />
<None Remove="Assets\icons\diagram.png" />
<None Remove="Assets\icons\glasses.png" />
<None Remove="Assets\icons\information.png" />
<None Remove="Assets\icons\map.png" />
<None Remove="Assets\icons\raw-extension.png" />
<None Remove="Assets\icons\trophy.png" />
</ItemGroup>


Expand All @@ -29,15 +31,19 @@
</ItemGroup>

<ItemGroup>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />

<PackageReference Include="ActiproSoftware.Controls.Avalonia" Version="23.1.2" />
<PackageReference Include="ActiproSoftware.Controls.Avalonia.Themes.DataGrid" Version="23.1.2" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
<PackageReference Include="Avalonia" Version="11.0.6" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.6" />
<PackageReference Include="Avalonia.Controls.TreeDataGrid" Version="11.0.2" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.6" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.6" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />

<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
<PackageReference Include="Projektanker.Icons.Avalonia" Version="9.0.1" />
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.0.1" />

</ItemGroup>

Expand All @@ -50,4 +56,8 @@
<DependentUpon>DataView.axaml</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<Folder Include="Assets\icons\col\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>all_var</ActiveDebugProfile>
<ActiveDebugProfile>clean</ActiveDebugProfile>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using Avalonia;
using Projektanker.Icons.Avalonia.FontAwesome;
using Projektanker.Icons.Avalonia;

namespace Parquet.Floor.Desktop;
namespace Parquet.Floor;

class Program {
// Initialization code. Don't use any Avalonia, third-party APIs or any
Expand All @@ -25,9 +27,12 @@ public static AppBuilder BuildAvaloniaApp() {
Console.WriteLine(ex);
}

IconProvider.Current
.Register<FontAwesomeIconProvider>();

return AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
//.WithInterFont()
.LogToTrace();
}

Expand Down
Loading

0 comments on commit 5951314

Please sign in to comment.