freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] gsoc-2022-chariri-3 1f97743 32/36: * src/ftinspect/mod


From: Werner Lemberg
Subject: [freetype2-demos] gsoc-2022-chariri-3 1f97743 32/36: * src/ftinspect/models/customcomboboxmodels.cpp: Disable subpixel light too.
Date: Wed, 27 Jul 2022 06:32:46 -0400 (EDT)

branch: gsoc-2022-chariri-3
commit 1f97743b044f3a3dde856c37cfcc86a5c16f8247
Author: Charlie Jiang <w@chariri.moe>
Commit: Charlie Jiang <w@chariri.moe>

    * src/ftinspect/models/customcomboboxmodels.cpp: Disable subpixel light too.
    
    When "Light" AA mode is disabled, the SubPixel-Light mode should be disabled
    as well.
---
 src/ftinspect/models/customcomboboxmodels.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/ftinspect/models/customcomboboxmodels.cpp 
b/src/ftinspect/models/customcomboboxmodels.cpp
index da82f00..454e3c9 100644
--- a/src/ftinspect/models/customcomboboxmodels.cpp
+++ b/src/ftinspect/models/customcomboboxmodels.cpp
@@ -270,8 +270,10 @@ QVariant
 AntiAliasingComboBoxModel::data(const QModelIndex& index,
                                 int role) const
 {
+  auto row = index.row();
   if (role == Qt::ForegroundRole)
-    if (index.row() == AntiAliasing_Light && !lightAntiAliasingEnabled_)
+    if ((row == AntiAliasing_Light || row == AntiAliasing_Light_SubPixel)
+        && !lightAntiAliasingEnabled_)
       return QApplication::palette().color(QPalette::Disabled, 
                                            QPalette::Text);
   return SimpleComboBoxModelImpl::data(index, role);
@@ -281,7 +283,9 @@ AntiAliasingComboBoxModel::data(const QModelIndex& index,
 Qt::ItemFlags
 AntiAliasingComboBoxModel::flags(const QModelIndex& index) const
 {
-  if (index.row() == AntiAliasing_Light && !lightAntiAliasingEnabled_)
+  auto row = index.row();
+  if ((row == AntiAliasing_Light || row == AntiAliasing_Light_SubPixel)
+      && !lightAntiAliasingEnabled_)
     return Qt::ItemFlags {};
   return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]