Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
uecker committed Sep 29, 2024
1 parent 12f97e0 commit f29a0c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/gtk_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,12 @@ void ui_window_new(struct view_s* v, int N, const long dims[N], const struct vie

char pname[10];
snprintf(pname, 10, "pos%02d", j);

v->ui->gtk_posall[j] = GTK_ADJUSTMENT(gtk_builder_get_object(builder, pname));
gtk_adjustment_set_upper(v->ui->gtk_posall[j], dims[j] - 1);

snprintf(pname, 10, "check%02d", j);

v->ui->gtk_checkall[j] = GTK_CHECK_BUTTON(gtk_builder_get_object(builder, pname));
}

Expand Down Expand Up @@ -533,6 +535,7 @@ void ui_set_params(struct view_s* v, struct view_ui_params_s params, struct view
gtk_adjustment_get_page_increment(v->ui->gtk_winhigh), gtk_adjustment_get_page_size(v->ui->gtk_winhigh));
gtk_adjustment_configure(v->ui->gtk_winlow, img_params.winlow, 0, params.windowing_max, params.windowing_inc,
gtk_adjustment_get_page_increment(v->ui->gtk_winlow), gtk_adjustment_get_page_size(v->ui->gtk_winlow));

gtk_spin_button_set_digits(v->ui->gtk_button_winhigh, params.windowing_digits);
gtk_spin_button_set_digits(v->ui->gtk_button_winlow, params.windowing_digits);

Expand Down
12 changes: 7 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
* a BSD-style license which can be found in the LICENSE file.
*/

#include "num/multind.h"
#include <complex.h>
#include <string.h>

#include "num/multind.h"

#include "misc/misc.h"
#include "misc/mmio.h"
#include "misc/opts.h"

#if defined __has_include
#if __has_include ("misc/stream.h")
#define HAS_BART_STREAM
#endif
#endif

#include "misc/misc.h"
#include "misc/mmio.h"
#include "misc/opts.h"

#if 0
#include "misc/io.h"
#else
Expand All @@ -35,6 +36,7 @@ static const char help_str[] = "View images.";

int main(int argc, char* argv[argc])
{
// unused was remove in newer versionf of bart, use it detect new version
#ifdef UNUSED
long count;
#else
Expand Down
4 changes: 2 additions & 2 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct view_control_s {
int lastx;
int lasty;

//misc
// misc
bool status_bar;
double max;

Expand Down Expand Up @@ -646,7 +646,7 @@ static void view_set_windowing(struct view_s* v)

v->ui_params.windowing_max = max;
v->ui_params.windowing_inc = exp(log(10) * round(log(max) / log(10.))) * 0.001;
v->ui_params.windowing_digits = MAX(3, 3 - (int)round(log(max) / log(10.)));
v->ui_params.windowing_digits = MAX(3, 3 - (int)round(log(max) / log(10.)));
}

void view_toggle_absolute_windowing(struct view_s* v, bool state)
Expand Down

0 comments on commit f29a0c1

Please sign in to comment.