diff --git a/uppsrc/RichEdit/FormatDlg.cpp b/uppsrc/RichEdit/FormatDlg.cpp index ed30e6933..77209f8f6 100644 --- a/uppsrc/RichEdit/FormatDlg.cpp +++ b/uppsrc/RichEdit/FormatDlg.cpp @@ -67,7 +67,7 @@ void ParaFormatting::SetupIndent() void ParaFormatting::EditHdrFtr() { - if(EditRichHeaderFooter(header_qtf, footer_qtf)) + if(EditRichHeaderFooter(header_qtf, footer_qtf, allow_dark, dark)) modified = true; } @@ -351,6 +351,8 @@ ParaFormatting::ParaFormatting(const RichEdit& e) rulerstyle.Add(RichPara::RULER_DASH); e.SetupDark(rulerink); + allow_dark = e.allow_dark_content; + dark = e.dark_content; } void StyleManager::EnterStyle() diff --git a/uppsrc/RichEdit/HeaderFooter.cpp b/uppsrc/RichEdit/HeaderFooter.cpp index 4504efcf5..9415ef9b7 100644 --- a/uppsrc/RichEdit/HeaderFooter.cpp +++ b/uppsrc/RichEdit/HeaderFooter.cpp @@ -132,6 +132,10 @@ void HeaderFooterDlg::Save(RichText& text) void RichEdit::HeaderFooter() { HeaderFooterDlg dlg; + dlg.header_editor.AllowDarkContent(allow_dark_content); + dlg.footer_editor.AllowDarkContent(allow_dark_content); + dlg.header_editor.DarkContent(dark_content); + dlg.footer_editor.DarkContent(dark_content); dlg.Load(text); dlg.SetRect(0, 0, GetSize().cx, dlg.GetLayoutSize().cy); if(dlg.Execute() == IDOK) { @@ -141,9 +145,13 @@ void RichEdit::HeaderFooter() } } -bool EditRichHeaderFooter(String& header_qtf, String& footer_qtf) +bool EditRichHeaderFooter(String& header_qtf, String& footer_qtf, bool allow_dark, bool dark) { HeaderFooterDlg dlg; + dlg.header_editor.AllowDarkContent(allow_dark); + dlg.footer_editor.AllowDarkContent(allow_dark); + dlg.header_editor.DarkContent(dark); + dlg.footer_editor.DarkContent(dark); dlg.Set(header_qtf, footer_qtf); if(dlg.Execute() == IDOK) { dlg.Get(header_qtf, footer_qtf); diff --git a/uppsrc/RichEdit/RichEdit.h b/uppsrc/RichEdit/RichEdit.h index 83ac6a6e1..709dea2bc 100644 --- a/uppsrc/RichEdit/RichEdit.h +++ b/uppsrc/RichEdit/RichEdit.h @@ -126,7 +126,7 @@ struct FontHeight : public WithDropChoice { #define LAYOUTFILE #include -bool EditRichHeaderFooter(String& header_qtf, String& footer_qtf); +bool EditRichHeaderFooter(String& header_qtf, String& footer_qtf, bool allow_dark, bool dark); class RichEdit; @@ -142,6 +142,8 @@ private: Font font; bool modified; String header_qtf, footer_qtf; + bool dark = false; + bool allow_dark = false; RichPara::NumberFormat GetNumbering(); bool IsNumbering(); @@ -660,6 +662,7 @@ private: friend class StyleKeysDlg; friend class StyleManager; + friend class ParaFormatting; using Ctrl::Accept; diff --git a/uppsrc/RichEdit/Table.cpp b/uppsrc/RichEdit/Table.cpp index 6050fd0a4..4eab4386d 100644 --- a/uppsrc/RichEdit/Table.cpp +++ b/uppsrc/RichEdit/Table.cpp @@ -100,10 +100,12 @@ int CharFilterEqualize(int c) struct RichEditTableProperties : WithTablePropertiesLayout { String header_qtf, footer_qtf; + bool dark = false; + bool allow_dark = false; void EditHdrFtr() { - EditRichHeaderFooter(header_qtf, footer_qtf); + EditRichHeaderFooter(header_qtf, footer_qtf, allow_dark, dark); } void NewHdrFtr() @@ -135,6 +137,8 @@ void RichEdit::TableProps() RichEditTableProperties dlg; SetupDark(dlg.framecolor); SetupDark(dlg.gridcolor); + dlg.allow_dark = allow_dark_content; + dlg.dark = dark_content; dlg.Breaker(dlg.destroy, IDNO); RichTable::Format fmt = text.GetTableFormat(cursorp.table); String ratios;