[education/rkward/releases/0.7.4] rkward/plugin: Fix detection of disabled rows

Thomas Friedrichsmeier null at kde.org
Thu May 26 09:13:04 BST 2022


Git commit 0be582578aaac1aa65d05573b0ed298e051f2302 by Thomas Friedrichsmeier.
Committed on 26/05/2022 at 08:12.
Pushed by tfry into branch 'releases/0.7.4'.

Fix detection of disabled rows

M  +7    -2    rkward/plugin/rkcomponent.cpp

https://invent.kde.org/education/rkward/commit/0be582578aaac1aa65d05573b0ed298e051f2302

diff --git a/rkward/plugin/rkcomponent.cpp b/rkward/plugin/rkcomponent.cpp
index 2fdfb94e..05b04ff4 100644
--- a/rkward/plugin/rkcomponent.cpp
+++ b/rkward/plugin/rkcomponent.cpp
@@ -324,8 +324,13 @@ void RKComponent::updateEnablednessRecursive (bool parent_enabled) {
 
 bool RKComponent::isInactive () {
 	if (!isEnabled ()) return true;
-	if (parentWidget() && !isVisible()) return true;	// Note: Components embedded as button may be "hidden" without being unaccessible
-	if (!visibility_property->boolValue ()) return true;	// Note for those, this is the appropriate check
+	if (parentWidget() && isHidden()) return true; // Note: Components embedded as button may be "hidden" without being unaccessible
+	if (!visibility_property->boolValue ()) return true; // Note for those, this is the appropriate check
+	// NOTE: What an eye-sore, and TODO: should be fixed. Needed to detect, if this is e.g. the child of a hidden row (which is the parentWidget, but not the logical parentComponent)
+	if (parentWidget()) {
+		auto p = qobject_cast<RKComponent*>(parentWidget());
+		if (p && !p->visibility_property->boolValue()) return true;
+	}
 	return false;
 }
 


More information about the rkward-tracker mailing list