src/settingseditor/settingseditor.cpp

changeset 256
c6f5de03dc0f
parent 237
10a6298f636f
child 259
c27612f0eac0
equal deleted inserted replaced
255:5188f8a74a5c 256:c6f5de03dc0f
38 } 38 }
39 39
40 void SettingsEditor::handleAccepted() 40 void SettingsEditor::handleAccepted()
41 { 41 {
42 setSetting<Setting::Locale>(this->ui.language->currentData().toString()); 42 setSetting<Setting::Locale>(this->ui.language->currentData().toString());
43 setSetting<Setting::MainColor>(this->ui.mainColorButton->selectedColor()); 43 setSetting<Setting::MainColor>(this->ui.mainColorButton->color());
44 setSetting<Setting::BackgroundColor>(this->ui.backgroundColorButton->selectedColor()); 44 setSetting<Setting::BackgroundColor>(this->ui.backgroundColorButton->color());
45 setSetting<Setting::SelectedColor>(this->ui.selectedColorButton->selectedColor()); 45 setSetting<Setting::SelectedColor>(this->ui.selectedColorButton->color());
46 setSetting<Setting::LineThickness>(static_cast<GLfloat>(this->ui.lineThickness->value())); 46 setSetting<Setting::LineThickness>(static_cast<GLfloat>(this->ui.lineThickness->value()));
47 setSetting<Setting::LineAntiAliasing>(this->ui.lineAntiAliasing->isChecked()); 47 setSetting<Setting::LineAntiAliasing>(this->ui.lineAntiAliasing->isChecked());
48 setSetting<Setting::LogOpenGLDebugMessages>(this->ui.logOpenGLDebugMessages->isChecked()); 48 setSetting<Setting::LogOpenGLDebugMessages>(this->ui.logOpenGLDebugMessages->isChecked());
49 const int viewMode = this->ui.viewModeButtonGroup->checkedId(); 49 const int viewMode = this->ui.viewModeButtonGroup->checkedId();
50 if (viewMode != -1) { 50 if (viewMode != -1) {
76 } 76 }
77 77
78 void SettingsEditor::setDefaults() 78 void SettingsEditor::setDefaults()
79 { 79 {
80 this->setCurrentLanguage(setting<Setting::Locale>()); 80 this->setCurrentLanguage(setting<Setting::Locale>());
81 this->ui.mainColorButton->setSelectedColor(setting<Setting::MainColor>()); 81 this->ui.mainColorButton->setColor(setting<Setting::MainColor>());
82 this->ui.backgroundColorButton->setSelectedColor(setting<Setting::BackgroundColor>()); 82 this->ui.backgroundColorButton->setColor(setting<Setting::BackgroundColor>());
83 this->ui.selectedColorButton->setSelectedColor(setting<Setting::SelectedColor>()); 83 this->ui.selectedColorButton->setColor(setting<Setting::SelectedColor>());
84 this->ui.lineThickness->setValue(double_cast(setting<Setting::LineThickness>())); 84 this->ui.lineThickness->setValue(double_cast(setting<Setting::LineThickness>()));
85 this->ui.lineAntiAliasing->setChecked(setting<Setting::LineAntiAliasing>()); 85 this->ui.lineAntiAliasing->setChecked(setting<Setting::LineAntiAliasing>());
86 this->ui.logOpenGLDebugMessages->setChecked(setting<Setting::LogOpenGLDebugMessages>()); 86 this->ui.logOpenGLDebugMessages->setChecked(setting<Setting::LogOpenGLDebugMessages>());
87 auto* const viewModeButton = this->ui.viewModeButtonGroup->button(setting<Setting::ViewMode>()); 87 auto* const viewModeButton = this->ui.viewModeButtonGroup->button(setting<Setting::ViewMode>());
88 if (viewModeButton != nullptr) { 88 if (viewModeButton != nullptr) {

mercurial