diff options
-rw-r--r-- | qt-ui/printdialog.cpp | 8 | ||||
-rw-r--r-- | qt-ui/printoptions.h | 6 | ||||
-rw-r--r-- | qt-ui/templateedit.cpp | 12 |
3 files changed, 16 insertions, 10 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index d5a16df11..25c102201 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -39,7 +39,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f printOptions.type = print_options::DIVELIST; templateOptions.font_index = 0; templateOptions.font_size = 9; - templateOptions.color_palette_index = 0; + templateOptions.color_palette_index = ALMOND; templateOptions.line_spacing = 1; custom_colors = almond_colors; } else { @@ -70,13 +70,13 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f } switch (templateOptions.color_palette_index) { - case 0: // almond + case ALMOND: // almond templateOptions.color_palette = almond_colors; break; - case 1: // blueshades + case BLUESHADES: // blueshades templateOptions.color_palette = blueshades_colors; break; - case 2: // custom + case CUSTOM: // custom templateOptions.color_palette = custom_colors; break; } diff --git a/qt-ui/printoptions.h b/qt-ui/printoptions.h index 5a4ca3504..2e2e2a9f4 100644 --- a/qt-ui/printoptions.h +++ b/qt-ui/printoptions.h @@ -46,6 +46,12 @@ struct template_options { extern template_options::color_palette_struct almond_colors, blueshades_colors, custom_colors; +enum color_palette { + ALMOND, + BLUESHADES, + CUSTOM +}; + // should be based on a custom QPrintDialog class class PrintOptions : public QWidget { Q_OBJECT diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp index c26740506..6df11ea79 100644 --- a/qt-ui/templateedit.cpp +++ b/qt-ui/templateedit.cpp @@ -92,13 +92,13 @@ void TemplateEdit::on_colorpalette_currentIndexChanged(int index) { newTemplateOptions.color_palette_index = index; switch (newTemplateOptions.color_palette_index) { - case 0: // almond + case ALMOND: // almond newTemplateOptions.color_palette = almond_colors; break; - case 1: // blueshades + case BLUESHADES: // blueshades newTemplateOptions.color_palette = blueshades_colors; break; - case 2: // custom + case CUSTOM: // custom newTemplateOptions.color_palette = custom_colors; break; } @@ -147,11 +147,11 @@ void TemplateEdit::colorSelect(QAbstractButton *button) { // reset custom colors palette switch (newTemplateOptions.color_palette_index) { - case 0: // almond + case ALMOND: // almond newTemplateOptions.color_palette = almond_colors; custom_colors = newTemplateOptions.color_palette; break; - case 1: // blueshades + case BLUESHADES: // blueshades newTemplateOptions.color_palette = blueshades_colors; custom_colors = newTemplateOptions.color_palette; break; @@ -181,6 +181,6 @@ void TemplateEdit::colorSelect(QAbstractButton *button) newTemplateOptions.color_palette.color5 = color; break; } - newTemplateOptions.color_palette_index = 2; + newTemplateOptions.color_palette_index = CUSTOM; updatePreview(); } |