Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023.8.1-rc1 #92

Merged
merged 18 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions NickvisionCavalier.GNOME/Blueprints/drawing_view.blp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ Gtk.Stack _root {
};
}

Gtk.StackPage _welcomePage {
name: "welcome";
child: Adw.Bin {
Adw.StatusPage {
nlogozzo marked this conversation as resolved.
Show resolved Hide resolved
icon-name: "man-dancing";
title: _("Let's dance!");
description: _("Cavalier listens to your system sound. Play some music or watch a video and see your sound come to life!");
}

styles ["load-bin"]
};
}

Gtk.StackPage _glPage {
name: "gl";
child: Gtk.GLArea _glArea {
Expand Down
59 changes: 52 additions & 7 deletions NickvisionCavalier.GNOME/Blueprints/preferences_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ Adw.PreferencesWindow _root {
}

Adw.PreferencesGroup {
visible: bind _boxButton.active inverted;

Adw.ActionRow {
title: _("Radius");
visible: bind _boxButton.active inverted;

[suffix]
Gtk.Scale _radiusScale {
Expand All @@ -108,6 +109,21 @@ Adw.PreferencesWindow _root {
};
}
}

Adw.ActionRow {
title: _("Rotation");

[suffix]
Gtk.Scale _rotationScale {
width-request: 150;
draw-value: false;
adjustment: Gtk.Adjustment {
lower: 0;
upper: 6.284;
step-increment: 0.01;
};
}
}
}

Adw.PreferencesGroup {
Expand All @@ -132,7 +148,6 @@ Adw.PreferencesWindow _root {
model: Gtk.StringList {
strings [_("Top to bottom"), _("Bottom to top"), _("Left to right"), _("Right to left") ]
};
sensitive: bind _boxButton.active;
}

Adw.ActionRow {
Expand All @@ -153,6 +168,36 @@ Adw.PreferencesWindow _root {
}
}

Adw.ActionRow {
title: _("Drawing area X offset");

[suffix]
Gtk.Scale _areaOffsetXScale {
width-request: 150;
draw-value: false;
adjustment: Gtk.Adjustment {
lower: -0.5;
upper: 0.5;
step-increment: 0.01;
};
}
}

Adw.ActionRow {
title: _("Drawing area Y offset");

[suffix]
Gtk.Scale _areaOffsetYScale {
width-request: 150;
draw-value: false;
adjustment: Gtk.Adjustment {
lower: -0.5;
upper: 0.5;
step-increment: 0.01;
};
}
}

Adw.ActionRow _offsetRow {
title: _("Offset between items");
subtitle: _("The size of spaces between elements (in percent).");
Expand Down Expand Up @@ -367,14 +412,14 @@ Adw.PreferencesWindow _root {

[suffix]
Gtk.Scale _noiseReductionScale {
width-request: 190;
width-request: 180;
draw-value: true;
value-pos: left;
digits: 2;
digits: 0;
adjustment: Gtk.Adjustment {
lower: 0.15;
upper: 0.95;
step-increment: 0.01;
lower: 15;
upper: 95;
step-increment: 1;
};
}
}
Expand Down
17 changes: 16 additions & 1 deletion NickvisionCavalier.GNOME/Blueprints/shortcuts_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ Gtk.ShortcutsWindow _shortcuts {
accelerator: "U <Shift>U";
}

Gtk.ShortcutsShortcut {
title: _("Change rotation in Circle modes");
accelerator: "O <Shift>O";
}

Gtk.ShortcutsShortcut {
title: _("Change Mirror Mode");
accelerator: "M <Shift>M";
Expand All @@ -37,9 +42,19 @@ Gtk.ShortcutsWindow _shortcuts {
accelerator: "N <Shift>N";
}

Gtk.ShortcutsShortcut {
title: _("Change Drawing Area X Offset");
accelerator: "X <Shift>X";
}

Gtk.ShortcutsShortcut {
title: _("Change Drawing Area Y Offset");
accelerator: "Y <Shift>Y";
}

Gtk.ShortcutsShortcut {
title: _("Change Drawing Direction");
accelerator: "O <Shift>O";
accelerator: "G <Shift>G";
}

Gtk.ShortcutsShortcut {
Expand Down
20 changes: 17 additions & 3 deletions NickvisionCavalier.GNOME/Blueprints/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@ Adw.ApplicationWindow _root {
[overlay]
Adw.Bin _resizeBin {
visible: false;
child: Gtk.Image {
icon-name: "org.nickvision.cavalier";
pixel-size: 128;
child: Gtk.Box {
orientation: vertical;
spacing: 12;
valign: center;

Gtk.Image {
icon-name: "org.nickvision.cavalier";
pixel-size: 128;
}

Adw.ButtonContent {
halign: center;
icon-name: "view-fullscreen-symbolic";
label: _("Resizing...");

styles ["dim-label", "title-3"]
}
};

styles [ "background" ]
Expand Down
3 changes: 3 additions & 0 deletions NickvisionCavalier.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public Program(string[] args)
@"* Added Cairo backend that can be used in case of problems with OpenGL. To activate, run the program with environment variable CAVALIER_RENDERER=cairo
* All drawing modes except Splitter now have Circle variants
* Added an easter egg (run the program with --help to find how to activate it)
* Added welcome screen that is shown on start until any sound gets detected
* Fixed an issue where the app wasn't drawing correctly with >100% display scaling
* CAVA updated to 0.9.0
* Pipewire is now used as default input method, you can still change back to Pulse Audio using environment variable CAVALIER_INPUT_METHOD=pulse
* Updated translations (Thanks everyone on Weblate!)";
_application.OnActivate += OnActivate;
if (File.Exists(Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) + "/org.nickvision.cavalier.gresource"))
Expand Down
47 changes: 47 additions & 0 deletions NickvisionCavalier.GNOME/Resources/man-dancing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</gresource>
<gresource prefix="/org/nickvision/cavalier/icons/scalable/status/">
<file preprocess="xml-stripblanks">cross-symbolic.svg</file>
<file preprocess="xml-stripblanks">man-dancing.svg</file>
<file preprocess="xml-stripblanks">x-circular-symbolic.svg</file>
</gresource>
</gresources>
13 changes: 12 additions & 1 deletion NickvisionCavalier.GNOME/Views/DrawingView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using NickvisionCavalier.Shared.Controllers;
using SkiaSharp;
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Timers;

Expand All @@ -28,6 +29,7 @@ public partial class DrawingView : Gtk.Stack, IDisposable
private readonly GSourceFunc _showGl;
private readonly GSourceFunc _queueRender;
private readonly Timer _renderTimer;
private bool _showWelcome;
private GRContext? _ctx;
private SKImageInfo? _imgInfo;
private SKSurface? _glSurface;
Expand All @@ -39,6 +41,7 @@ private DrawingView(Gtk.Builder builder, DrawingViewController controller) : bas
{
_disposed = false;
_controller = controller;
_showWelcome = true;
//Build UI
builder.Connect(this);
if (Environment.GetEnvironmentVariable("CAVALIER_RENDERER")?.ToLower() == "cairo")
Expand All @@ -62,9 +65,17 @@ private DrawingView(Gtk.Builder builder, DrawingViewController controller) : bas
_controller.CAVA.OutputReceived += (sender, sample) =>
{
_sample = sample;
if (_showWelcome && sample.Any(s => s != 0))
{
_showWelcome = false;
}
GLib.Functions.IdleAdd(0, () =>
{
if (GetVisibleChildName() != (_useCairo ? "cairo" : "gl"))
if (_showWelcome && GetVisibleChildName() != "welcome")
{
SetVisibleChildName("welcome");
}
if (!_showWelcome && GetVisibleChildName() != (_useCairo ? "cairo" : "gl"))
{
SetVisibleChildName(_useCairo ? "cairo" : "gl");
}
Expand Down
Loading