Revision: 24249
          http://sourceforge.net/p/bibdesk/svn/24249
Author:   hofman
Date:     2019-09-29 13:54:24 +0000 (Sun, 29 Sep 2019)
Log Message:
-----------
Explicitly update binding when changing color from color label well action

Modified Paths:
--------------
    trunk/bibdesk/BDSKColorLabelWell.m

Modified: trunk/bibdesk/BDSKColorLabelWell.m
===================================================================
--- trunk/bibdesk/BDSKColorLabelWell.m  2019-09-29 06:30:27 UTC (rev 24248)
+++ trunk/bibdesk/BDSKColorLabelWell.m  2019-09-29 13:54:24 UTC (rev 24249)
@@ -255,6 +255,18 @@
         if ([self isActive])
             [self deactivate];
         [self setColor:color];
+        NSDictionary *info = [self infoForBinding:NSValueBinding];
+        id observedObject = [info objectForKey:NSObservedObjectKey];
+        NSString *observedKeyPath = [info objectForKey:NSObservedKeyPathKey];
+        if (observedObject && observedKeyPath) {
+            id value = color;
+            NSString *transformerName = [[info objectForKey:NSOptionsKey] 
objectForKey:NSValueTransformerNameBindingOption];
+            if (transformerName && [transformerName isEqual:[NSNull null]] == 
NO) {
+                NSValueTransformer *valueTransformer = [NSValueTransformer 
valueTransformerForName:transformerName];
+                value = [valueTransformer reverseTransformedValue:value];
+            }
+            [observedObject setValue:value forKeyPath:observedKeyPath];
+        }
         if ([self action])
             [self sendAction:[self action] to:[self target]];
     } else if ([self isActive]) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to