mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Printing: show colors in edit tab
- Add default color struct - Init the color struct with default colors - Show color text in labels - Preview colors Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
dcedc8ebea
commit
ad531c25fb
3 changed files with 44 additions and 2 deletions
|
@ -12,8 +12,17 @@
|
|||
|
||||
#define SETTINGS_GROUP "PrintDialog"
|
||||
|
||||
template_options::color_palette_struct almond_colors;
|
||||
|
||||
PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
||||
{
|
||||
// initialize const colors
|
||||
almond_colors.color1 = QColor::fromRgb(243, 234, 207);
|
||||
almond_colors.color2 = QColor::fromRgb(253, 204, 156);
|
||||
almond_colors.color3 = QColor::fromRgb(136, 160, 150);
|
||||
almond_colors.color4 = QColor::fromRgb(187, 171, 139);
|
||||
almond_colors.color5 = QColor::fromRgb(239, 130, 117);
|
||||
|
||||
// check if the options were previously stored in the settings; if not use some defaults.
|
||||
QSettings s;
|
||||
bool stored = s.childGroups().contains(SETTINGS_GROUP);
|
||||
|
@ -41,6 +50,8 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f
|
|||
templateOptions.line_spacing = s.value("line_spacing").toDouble();
|
||||
}
|
||||
|
||||
templateOptions.color_palette = almond_colors;
|
||||
|
||||
// create a print options object and pass our options struct
|
||||
optionsWidget = new PrintOptions(this, &printOptions, &templateOptions);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue