diff --git a/src/mvc/FitSpectraWidget.cpp b/src/mvc/FitSpectraWidget.cpp index df6e78b..68b9912 100644 --- a/src/mvc/FitSpectraWidget.cpp +++ b/src/mvc/FitSpectraWidget.cpp @@ -253,7 +253,14 @@ void FitSpectraWidget::createLayout() tab_and_buttons_widget->setLayout(vlayout_tab); QSplitter* splitter = new QSplitter(); - splitter->setOrientation(Qt::Vertical); + if(Preferences::inst()->getValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION).toBool()) + { + splitter->setOrientation(Qt::Horizontal); + } + else + { + splitter->setOrientation(Qt::Vertical); + } splitter->addWidget(_spectra_dock); splitter->setStretchFactor(0, 1); splitter->addWidget(tab_and_buttons_widget); diff --git a/src/preferences/Preferences.cpp b/src/preferences/Preferences.cpp index f87ea1c..098082f 100644 --- a/src/preferences/Preferences.cpp +++ b/src/preferences/Preferences.cpp @@ -91,7 +91,8 @@ Preferences::Preferences() {STR_PRF_STRICT_REGEX, QVariant()}, {STR_PRF_FILE_SIZE, QVariant()}, {STR_PRF_SHOW_DATASET_ON_LOAD, QVariant()}, - {STR_PREF_RADIO_LOAD_SELECTED_OPTION, QVariant()} + {STR_PREF_RADIO_LOAD_SELECTED_OPTION, QVariant()}, + {STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION, QVariant()} }; load(); } diff --git a/src/preferences/Preferences.h b/src/preferences/Preferences.h index 7cfbe7c..5e7ec7b 100644 --- a/src/preferences/Preferences.h +++ b/src/preferences/Preferences.h @@ -86,6 +86,7 @@ #define STR_PRF_FILE_SIZE "FileSize" #define STR_PRF_SHOW_DATASET_ON_LOAD "ShowOnLoad" #define STR_PREF_RADIO_LOAD_SELECTED_OPTION "Load_Selected_Opt" +#define STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION "Spectra_Controls_Horizontal" /** * @brief Read and save preferences between application restarts, the vaule key diff --git a/src/preferences/PreferencesDisplay.cpp b/src/preferences/PreferencesDisplay.cpp index b3fc9bb..fa315ad 100644 --- a/src/preferences/PreferencesDisplay.cpp +++ b/src/preferences/PreferencesDisplay.cpp @@ -64,6 +64,12 @@ PreferencesDisplay::PreferencesDisplay(QWidget* parent) : QWidget(parent) _ck_show_dataset_on_load = new QCheckBox(); _ck_show_dataset_on_load->setChecked(Preferences::inst()->getValue(STR_PRF_SHOW_DATASET_ON_LOAD).toBool()); + QLabel* lblIntSpecControlLoc = new QLabel("Integreated Spectra Controls On the Right of spectra? (Unchecked = Below)"); + lblIntSpecControlLoc->setFont(font); + _ck_int_spec_horiz = new QCheckBox(); + _ck_int_spec_horiz->setChecked(Preferences::inst()->getValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION).toBool()); + + QLabel* lblSearchDatasets = new QLabel("Search sub folders for datasets (ESRF datasets)."); lblSearchDatasets->setFont(font); _ck_search_datasets = new QCheckBox(); @@ -92,6 +98,7 @@ PreferencesDisplay::PreferencesDisplay(QWidget* parent) : QWidget(parent) mainLayout->addRow(lblFileSize, _cb_file_size); mainLayout->addRow(lblShowDatasetOnSelect, _ck_show_dataset_on_select); mainLayout->addRow(lblShowDatasetOnLoad, _ck_show_dataset_on_load); + mainLayout->addRow(lblIntSpecControlLoc, _ck_int_spec_horiz); mainLayout->addRow(lblSearchDatasets, _ck_search_datasets); mainLayout->addRow(lblStrictRegex, _ck_strict_regex); @@ -155,6 +162,7 @@ void PreferencesDisplay::acceptChanges() Preferences::inst()->setValue(STR_PRF_DecimalPrecision, getDecimalPrecision()); Preferences::inst()->setValue(STR_PRF_SHOW_DATASET_ON_FILE_SELECT, _ck_show_dataset_on_select->isChecked()); Preferences::inst()->setValue(STR_PRF_SHOW_DATASET_ON_LOAD, _ck_show_dataset_on_load->isChecked()); + Preferences::inst()->setValue(STR_PREF_SPRECTRA_CONTROLS_HORIZONTAL_OPTION, _ck_int_spec_horiz->isChecked()); Preferences::inst()->setValue(STR_SEARCH_SUB_DIR_FOR_DATASETS, _ck_search_datasets->isChecked()); Preferences::inst()->setValue(STR_PRF_STRICT_REGEX, _ck_strict_regex->isChecked()); Preferences::inst()->setValue(STR_PRF_FILE_SIZE, _cb_file_size->currentIndex()); diff --git a/src/preferences/PreferencesDisplay.h b/src/preferences/PreferencesDisplay.h index c32d295..c69c0fd 100644 --- a/src/preferences/PreferencesDisplay.h +++ b/src/preferences/PreferencesDisplay.h @@ -112,6 +112,8 @@ public slots: QCheckBox* _ck_strict_regex; QComboBox* _cb_file_size; + + QCheckBox* _ck_int_spec_horiz; }; //---------------------------------------------------------------------------