+void GuiDocument::changeBackgroundColor()
+{
+ QColor const & newColor = QColorDialog::getColor(
+ rgb2qcolor(set_backgroundcolor), asQWidget());
+ if (!newColor.isValid())
+ return;
+ // set the button color and text
+ colorModule->backgroundPB->setStyleSheet(
+ colorButtonStyleSheet(newColor));
+ colorModule->backgroundPB->setText(toqstr("Change..."));
+ // save color
+ set_backgroundcolor = rgbFromHexName(fromqstr(newColor.name()));
+ is_backgroundcolor = true;
+ changed();
+}
+
+
+void GuiDocument::deleteBackgroundColor()
+{
+ // set the button color back to default by setting an epmty StyleSheet
+ colorModule->backgroundPB->setStyleSheet(QLatin1String(""));
+ // change button text
+ colorModule->backgroundPB->setText(toqstr("Default..."));
+ // save default color (white)
+ set_backgroundcolor = rgbFromHexName("#ffffff");
+ is_backgroundcolor = false;
+ changed();
+}
+
+
+void GuiDocument::changeFontColor()
+{
+ QColor const & newColor = QColorDialog::getColor(
+ rgb2qcolor(set_fontcolor), asQWidget());
+ if (!newColor.isValid())
+ return;
+ // set the button color and text
+ colorModule->fontColorPB->setStyleSheet(
+ colorButtonStyleSheet(newColor));
+ colorModule->fontColorPB->setText(toqstr("Change..."));
+ // save color
+ set_fontcolor = rgbFromHexName(fromqstr(newColor.name()));
+ is_fontcolor = true;
+ changed();
+}
+
+
+void GuiDocument::deleteFontColor()
+{
+ // set the button color back to default by setting an epmty StyleSheet
+ colorModule->fontColorPB->setStyleSheet(QLatin1String(""));
+ // change button text
+ colorModule->fontColorPB->setText(toqstr("Default..."));
+ // save default color (black)
+ set_fontcolor = rgbFromHexName("#000000");
+ is_fontcolor = false;
+ changed();
+}
+
+
+void GuiDocument::changeNoteFontColor()
+{
+ QColor const & newColor = QColorDialog::getColor(
+ rgb2qcolor(set_notefontcolor), asQWidget());
+ if (!newColor.isValid())
+ return;
+ // set the button color
+ colorModule->noteFontColorPB->setStyleSheet(
+ colorButtonStyleSheet(newColor));
+ // save color
+ set_notefontcolor = rgbFromHexName(fromqstr(newColor.name()));
+ changed();
+}
+
+
+void GuiDocument::deleteNoteFontColor()
+{
+ // set the button color back to light gray
+ colorModule->noteFontColorPB->setStyleSheet(
+ colorButtonStyleSheet(QColor(204, 204, 204, 255)));
+ // save light gray as the set color
+ set_notefontcolor = rgbFromHexName("#cccccc");
+ changed();
+}
+
+
+void GuiDocument::changeBoxBackgroundColor()
+{
+ QColor const & newColor = QColorDialog::getColor(
+ rgb2qcolor(set_boxbgcolor), asQWidget());
+ if (!newColor.isValid())
+ return;
+ // set the button color
+ colorModule->boxBackgroundPB->setStyleSheet(
+ colorButtonStyleSheet(newColor));
+ // save color
+ set_boxbgcolor = rgbFromHexName(fromqstr(newColor.name()));
+ changed();
+}
+
+
+void GuiDocument::deleteBoxBackgroundColor()
+{
+ // set the button color back to red
+ colorModule->boxBackgroundPB->setStyleSheet(
+ colorButtonStyleSheet(QColor(Qt::red)));
+ // save red as the set color
+ set_boxbgcolor = rgbFromHexName("#ff0000");
+ changed();
+}
+
+