commit 87bdf11a28ffa38ef186a995754853b60a4c9386
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Feb 21 16:01:13 2025 +0100
We don't need the whole params, just the custom colors
---
src/frontends/qt/ColorsCombo.cpp | 7 +++----
src/frontends/qt/ColorsCombo.h | 4 ++--
src/frontends/qt/GuiCharacter.cpp | 4 ++--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/frontends/qt/ColorsCombo.cpp b/src/frontends/qt/ColorsCombo.cpp
index 6bcb6110a0..2fb0798a76 100644
--- a/src/frontends/qt/ColorsCombo.cpp
+++ b/src/frontends/qt/ColorsCombo.cpp
@@ -28,7 +28,6 @@ namespace frontend {
ColorsCombo::ColorsCombo(QWidget * parent)
: CategorizedCombo(parent),
- params_(BufferParams()),
has_ignore_(false), has_inherit_(false)
{
setLeftMargin(32);
@@ -99,9 +98,9 @@ void ColorsCombo::addItemSort(QString const & item, QString
const & guiname,
}
-void ColorsCombo::setBufferParams(BufferParams const params)
+void ColorsCombo::setCustomColors(std::map<std::string, std::string> const
custom_colors)
{
- params_ = params;
+ custom_colors_ = custom_colors;
fillComboColor();
}
@@ -119,7 +118,7 @@ void ColorsCombo::fillComboColor()
addItemSort(QString("inherit"), qt_("(Without)[[color]]"),
QString());
// now custom colors
- for (auto const & lc : params_.custom_colors) {
+ for (auto const & lc : custom_colors_) {
QString const lyxname = toqstr(lc.first);
QString const guiname = toqstr(lc.first);
QString const category = qt_("Custom Colors");
diff --git a/src/frontends/qt/ColorsCombo.h b/src/frontends/qt/ColorsCombo.h
index 6f7d443d9e..085fcfa922 100644
--- a/src/frontends/qt/ColorsCombo.h
+++ b/src/frontends/qt/ColorsCombo.h
@@ -39,7 +39,7 @@ public:
void addItemSort(QString const & item, QString const & guiname,
QString const & category, QString color = QString());
/// Set BufferParams to access custom colors
- void setBufferParams(BufferParams const params);
+ void setCustomColors(std::map<std::string, std::string> const
custom_colors);
/// Add "ignore" color entry?
void hasIgnore(bool const b) { has_ignore_ = b; }
/// Add "inherit" color entry?
@@ -51,7 +51,7 @@ private:
///
void fillComboColor();
///
- BufferParams params_;
+ std::map<std::string, std::string> custom_colors_;
///
bool has_ignore_;
///
diff --git a/src/frontends/qt/GuiCharacter.cpp
b/src/frontends/qt/GuiCharacter.cpp
index 980f852083..c3d01c36ec 100644
--- a/src/frontends/qt/GuiCharacter.cpp
+++ b/src/frontends/qt/GuiCharacter.cpp
@@ -201,7 +201,7 @@ GuiCharacter::GuiCharacter(GuiView & lv)
fillCombo(langCO, language);
colorCO->hasIgnore(true);
colorCO->hasInherit(true);
- colorCO->setBufferParams(buffer().masterParams());
+ colorCO->setCustomColors(buffer().masterParams().custom_colors);
custom_colors_cache_ = buffer().masterParams().custom_colors;
colorCO->setToolTip(qt_("You can also directly type on the list to
filter on color names."));
@@ -489,7 +489,7 @@ void GuiCharacter::updateContents()
// Update custom colors if needed
if (custom_colors_cache_ != buffer().masterParams().custom_colors) {
- colorCO->setBufferParams(buffer().masterParams());
+ colorCO->setCustomColors(buffer().masterParams().custom_colors);
custom_colors_cache_ = buffer().masterParams().custom_colors;
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs