Skip to content

Commit

Permalink
Tweak curve fitting window
Browse files Browse the repository at this point in the history
  • Loading branch information
sstendahl committed Nov 15, 2023
1 parent 2d1b0cb commit e218074
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
18 changes: 9 additions & 9 deletions data/ui/curve_fitting.blp
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ template $GraphsCurveFittingTool : Adw.Window {
Box{
orientation: vertical;
vexpand: true;
width-request: 275;
width-request: 285;
Adw.EntryRow equation {
margin-top: 12;
margin-bottom: 6;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
margin-end: 3;
title: _("Equation");
styles ["card"]
}
ScrolledWindow {
vexpand: true;
height-request: 125;
height-request: 100;
hscrollbar-policy: never;
Box {
vexpand: true;
orientation: vertical;
margin-start: 12;
margin-end: 12;
margin-end: 3;
Box fitting_params {
margin-top: 6;
margin-top: 12;
spacing: 12;
orientation: vertical;
}
Expand All @@ -64,9 +64,9 @@ template $GraphsCurveFittingTool : Adw.Window {
ScrolledWindow {
margin-top: 6;
height-request: 150;
margin-bottom: 6;
margin-bottom: 12;
margin-start: 12;
margin-end: 12;
margin-end: 3;
TextView text_view {
vexpand: false;
top-margin: 12;
Expand All @@ -87,6 +87,6 @@ template $GraphsCurveFittingTool : Adw.Window {
title: _("Canvas Failed to Load");
};
}
}
};
}
}
6 changes: 3 additions & 3 deletions data/ui/fitting_parameters.blp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ template $GraphsFittingParameterEntry : Box {
}
}
Adw.EntryRow initial {
title: "Initial guess";
title: _("Initial guess");
text: "1";
layout {
column: 0;
Expand All @@ -32,7 +32,7 @@ template $GraphsFittingParameterEntry : Box {
styles ["card"]
}
Adw.EntryRow lower_bound {
title: "Minimum";
title: _("Minimum");
text: "-inf";
layout {
column: 0;
Expand All @@ -41,7 +41,7 @@ template $GraphsFittingParameterEntry : Box {
styles ["card"]
}
Adw.EntryRow upper_bound {
title: "Maximum";
title: _("Maximum");
text: "inf";
layout {
column: 1;
Expand Down
8 changes: 7 additions & 1 deletion src/curve_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def __init__(self, application, item):
application.get_settings("curve-fitting"), self)
self.get_confirm_button().connect("clicked", self.add_fit)
style = application.get_figure_style_manager(
).get_system_style_params()
).get_system_style_params()

Check failure on line 35 in src/curve_fitting.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/curve_fitting.py#L35 <123>

closing bracket does not match indentation of opening bracket's line
Raw output
./src/curve_fitting.py:35:13: E123 closing bracket does not match indentation of opening bracket's line
canvas = Canvas(application, style)

figure_settings_main = application.get_data().get_figure_settings()
canvas.left_label = figure_settings_main.get_property("left_label")
canvas.bottom_label = figure_settings_main.get_property("bottom_label")
self.param = []
self.sigma = []
self.r2 = 0
Expand Down Expand Up @@ -71,6 +75,8 @@ def __init__(self, application, item):
axis.yscale = "linear"
axis.xscale = "linear"
canvas.highlight_enabled = False
canvas.toolbar = None
canvas._on_pick = None
self.canvas = canvas
self.fit_curve()
self.set_entry_rows()
Expand Down

0 comments on commit e218074

Please sign in to comment.