commit d1d3946d04304add27db23c209de23a5dbfb65be
Merge: 4ac4bd718f d3f2c0175a
Author: Koji Yokota <[email protected]>
Date:   Thu Mar 27 22:38:47 2025 +0900

    Merge branch 'features/color-theme'

 src/frontends/qt/GuiPrefs.cpp       | 625 +++++++++++++++++++++---------------
 src/frontends/qt/GuiPrefs.h         | 209 +++++++++---
 src/frontends/qt/ui/PrefColorsUi.ui | 501 ++++++++++++++---------------
 3 files changed, 755 insertions(+), 580 deletions(-)

diff --cc src/frontends/qt/GuiPrefs.cpp
index dd62143032,4ee86406f2..267500af83
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@@ -59,7 -59,9 +59,8 @@@
  #include <QAbstractItemModel>
  #include <QCheckBox>
  #include <QFile>
 -#include <QFileInfo>
  #include <QFontDatabase>
+ #include <QGraphicsColorizeEffect>
  #include <QHeaderView>
  #include <QInputDialog>
  #include <QLineEdit>
@@@ -1023,19 -1024,10 +1023,9 @@@ PrefColors::PrefColors(GuiPreferences 
                lcolors_.push_back(lc);
        }
        sort(lcolors_.begin(), lcolors_.end(), ColorSorter);
-       colorsTW->setRowCount(lcolors_.size());
-       colorsTW->setHorizontalHeaderLabels({qt_("Light"), qt_("Dark"),
-                                            qt_("Color name")});
-       
colorsTW->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
-       for (size_type row=0; row!=lcolors_.size(); ++row) {
-               colorsTW->setItem(row, 0, new QTableWidgetItem(icon, ""));
-               colorsTW->setItem(row, 1, new QTableWidgetItem(icon, ""));
-               QTableWidgetItem* txtItem = new 
QTableWidgetItem(toqstr(lcolor.getGUIName(lcolors_[row])));
-               txtItem->setFlags(~QFlags(Qt::ItemIsEditable));
-               colorsTW->setItem(row, 2, txtItem);
-       }
 -
        curcolors_.resize(lcolors_.size());
        newcolors_.resize(lcolors_.size());
+       theme_colors_.resize(lcolors_.size());
  
        undo_stack_ = new QUndoStack(this);
  
@@@ -1056,22 -1045,12 +1043,13 @@@
  
        connect(autoapplyCB, SIGNAL(toggled(bool)),
                this, SLOT(changeAutoapply()));
-       connect(colorResetPB, SIGNAL(clicked()),
-               this, SLOT(resetColor()));
++
+       connect(colorsTV, SIGNAL(pressed(QModelIndex)),
+               this, SLOT(pressedColorsTV(QModelIndex)));
+       connect(colorsTV, SIGNAL(clicked(QModelIndex)),
+               this, SLOT(clickedColorsTV(QModelIndex)));
        connect(colorResetAllPB, SIGNAL(clicked()),
                this, SLOT(resetAllColor()));
-       connect(colorsTW, SIGNAL(cellClicked(int,int)),
-               this, SLOT(changeColor(int,int)));
-       connect(colorsTW, SIGNAL(itemActivated(QTableWidgetItem*)),
-               this, SLOT(changeColor()));
-       connect(colorsTW, SIGNAL(itemSelectionChanged()),
-               this, SLOT(changeLyxObjectsSelection()));
-       connect(colorsTW, SIGNAL(itemPressed(QTableWidgetItem*)),
-               this, SLOT(pressCurrentItem(QTableWidgetItem*)));
-       connect(findNextPB, SIGNAL(clicked()),
-               this, SLOT(searchNextColorItem()));
-       connect(findPreviousPB, SIGNAL(clicked()),
-               this, SLOT(searchPreviousColorItem()));
        connect(redoColorPB, SIGNAL(clicked()),
                undo_stack_, SLOT(redo()));
        connect(removeThemePB, SIGNAL(clicked()),
@@@ -1255,12 -1226,9 +1225,10 @@@ bool PrefColors::resetAllColor(
  
        colorResetAllPB->setDisabled(true);
  
-       for (int irow = 0, count = colorsTW->rowCount(); irow < count; ++irow) {
-               ColorNamePair const & colors = newcolors_[size_t(irow)];
-               ColorPair const c = getDefaultColorsByRow(irow);
 +
-               if (setColor(irow, c, colors))
-                       isChanged = true;
+       for (int row = 0, count = colorsTV_model_.rowCount(); row < count; 
++row) {
+               isChanged |= resetColor(row, LightColorResetColumn);
+               isChanged |= resetColor(row, DarkColorResetColumn);
        }
  
        if (isChanged) {
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to