-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #590 from Sjoerd1993/Implement-smoothen-options
Implement smoothen options
- Loading branch information
Showing
11 changed files
with
189 additions
and
12 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
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
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
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,67 @@ | ||
using Gtk 4.0; | ||
using Adw 1; | ||
|
||
template $GraphsSmoothenWindow : Adw.Window { | ||
modal: true; | ||
default-height: 125; | ||
title: _("Smoothen settings"); | ||
focus-widget: reset_button; | ||
|
||
ShortcutController { | ||
Shortcut { | ||
trigger: "Escape"; | ||
action: "action(window.close)"; | ||
} | ||
} | ||
|
||
Adw.ToolbarView { | ||
[top] | ||
Adw.HeaderBar { | ||
[start] | ||
Button reset_button { | ||
icon-name: "history-undo-symbolic"; | ||
} | ||
} | ||
|
||
content: Adw.Clamp { | ||
margin-start: 12; | ||
margin-end: 12; | ||
margin-top: 12; | ||
margin-bottom: 12; | ||
|
||
Box { | ||
orientation: vertical; | ||
spacing: 10; | ||
Adw.PreferencesGroup { | ||
title: _("Savitzky–Golay filter"); | ||
Adw.SpinRow savgol_window { | ||
title: _("Span percentage"); | ||
subtitle: _("What percentage of the data span to use for the filter window"); | ||
adjustment: Adjustment { | ||
step-increment: 1; | ||
upper: 99; | ||
}; | ||
} | ||
Adw.SpinRow savgol_polynomial { | ||
title: _("Polynomial degree"); | ||
adjustment: Adjustment { | ||
step-increment: 1; | ||
upper: 20; | ||
}; | ||
} | ||
} | ||
Adw.PreferencesGroup { | ||
title: _("Moving Average"); | ||
Adw.SpinRow moving_average_box { | ||
title: _("Box points"); | ||
subtitle: _("Amount of points to use when calculating a moving average"); | ||
adjustment: Adjustment { | ||
step-increment: 1; | ||
upper: 9999; | ||
}; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
} |
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
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
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
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
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
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,31 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
using Adw; | ||
using Gtk; | ||
|
||
namespace Graphs { | ||
[GtkTemplate (ui = "/se/sjoerd/Graphs/ui/smoothen_settings.ui")] | ||
public class SmoothenWindow : Adw.Window { | ||
[GtkChild] | ||
public unowned Adw.SpinRow savgol_window { get; } | ||
|
||
[GtkChild] | ||
public unowned Adw.SpinRow savgol_polynomial { get; } | ||
|
||
[GtkChild] | ||
public unowned Adw.SpinRow moving_average_box { get; } | ||
|
||
[GtkChild] | ||
public unowned Button reset_button { get; } | ||
|
||
public SmoothenWindow (Application application) { | ||
Object ( | ||
application: application, | ||
transient_for: application.window | ||
); | ||
Tools.bind_settings_to_widgets ( | ||
application.settings.get_child ("actions").get_child ("smoothen"), this | ||
); | ||
present (); | ||
} | ||
} | ||
} |
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