mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: add the "Shades of blue" color theme
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
6319f0efba
commit
d41d79b549
4 changed files with 26 additions and 6 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
#define SETTINGS_GROUP "PrintDialog"
|
||||
|
||||
template_options::color_palette_struct almond_colors, custom_colors;
|
||||
template_options::color_palette_struct almond_colors, blueshades_colors, custom_colors;
|
||||
|
||||
PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
||||
{
|
||||
|
@ -22,6 +22,11 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
|
|||
almond_colors.color3 = QColor::fromRgb(136, 160, 150);
|
||||
almond_colors.color4 = QColor::fromRgb(187, 171, 139);
|
||||
almond_colors.color5 = QColor::fromRgb(239, 130, 117);
|
||||
blueshades_colors.color1 = QColor::fromRgb(182, 192, 206);
|
||||
blueshades_colors.color2 = QColor::fromRgb(142, 152, 166);
|
||||
blueshades_colors.color3 = QColor::fromRgb(31, 49, 75);
|
||||
blueshades_colors.color4 = QColor::fromRgb(21, 45, 84);
|
||||
blueshades_colors.color5 = QColor::fromRgb(5, 25, 56);
|
||||
|
||||
// check if the options were previously stored in the settings; if not use some defaults.
|
||||
QSettings s;
|
||||
|
@ -68,7 +73,10 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
|
|||
case 0: // almond
|
||||
templateOptions.color_palette = almond_colors;
|
||||
break;
|
||||
case 1: // custom
|
||||
case 1: // blueshades
|
||||
templateOptions.color_palette = blueshades_colors;
|
||||
break;
|
||||
case 2: // custom
|
||||
templateOptions.color_palette = custom_colors;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ struct template_options {
|
|||
}
|
||||
};
|
||||
|
||||
extern template_options::color_palette_struct almond_colors, custom_colors;
|
||||
extern template_options::color_palette_struct almond_colors, blueshades_colors, custom_colors;
|
||||
|
||||
// should be based on a custom QPrintDialog class
|
||||
class PrintOptions : public QWidget {
|
||||
|
|
|
@ -95,7 +95,10 @@ void TemplateEdit::on_colorpalette_currentIndexChanged(int index)
|
|||
case 0: // almond
|
||||
newTemplateOptions.color_palette = almond_colors;
|
||||
break;
|
||||
case 1: // custom
|
||||
case 1: // blueshades
|
||||
newTemplateOptions.color_palette = blueshades_colors;
|
||||
break;
|
||||
case 2: // custom
|
||||
newTemplateOptions.color_palette = custom_colors;
|
||||
break;
|
||||
}
|
||||
|
@ -115,7 +118,7 @@ void TemplateEdit::saveSettings()
|
|||
printOptions->p_template = "custom.html";
|
||||
TemplateLayout::writeTemplate("custom.html", ui->plainTextEdit->toPlainText());
|
||||
}
|
||||
if (templateOptions->color_palette_index == 1) {
|
||||
if (templateOptions->color_palette_index == 2) {
|
||||
custom_colors = templateOptions->color_palette;
|
||||
}
|
||||
}
|
||||
|
@ -148,6 +151,10 @@ void TemplateEdit::colorSelect(QAbstractButton *button)
|
|||
newTemplateOptions.color_palette = almond_colors;
|
||||
custom_colors = newTemplateOptions.color_palette;
|
||||
break;
|
||||
case 1: // blueshades
|
||||
newTemplateOptions.color_palette = blueshades_colors;
|
||||
custom_colors = newTemplateOptions.color_palette;
|
||||
break;
|
||||
}
|
||||
|
||||
//change selected color
|
||||
|
@ -174,6 +181,6 @@ void TemplateEdit::colorSelect(QAbstractButton *button)
|
|||
newTemplateOptions.color_palette.color5 = color;
|
||||
break;
|
||||
}
|
||||
newTemplateOptions.color_palette_index = 1;
|
||||
newTemplateOptions.color_palette_index = 2;
|
||||
updatePreview();
|
||||
}
|
||||
|
|
|
@ -173,6 +173,11 @@
|
|||
<string>Almond</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Shades of blue</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Custom</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue