[vlc-commits] macosx: CAS: added visual feedback for drag and drop operations just because we can
Felix Paul Kühne
git at videolan.org
Sun Jul 15 23:39:02 CEST 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Jul 15 20:57:55 2012 +0200| [a3c2e9d284d80275f1ee10d7936b1521f1bca3ee] | committer: Felix Paul Kühne
macosx: CAS: added visual feedback for drag and drop operations just because we can
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3c2e9d284d80275f1ee10d7936b1521f1bca3ee
---
.../Resources/English.lproj/ConvertAndSave.xib | 59 +++++++++++++++++++-
modules/gui/macosx/ConvertAndSave.h | 3 +
modules/gui/macosx/ConvertAndSave.m | 30 ++++++++++
3 files changed, 89 insertions(+), 3 deletions(-)
diff --git a/extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib b/extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib
index 2290064..a4de0b9 100644
--- a/extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib
+++ b/extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib
@@ -102,7 +102,7 @@
<object class="NSTextField" id="807070215">
<reference key="NSNextResponder" ref="370005935"/>
<int key="NSvFlags">303</int>
- <string key="NSFrame">{{15, 183}, {597, 22}}</string>
+ <string key="NSFrame">{{15, 181}, {597, 22}}</string>
<reference key="NSSuperview" ref="370005935"/>
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<bool key="NSEnabled">YES</bool>
@@ -2058,6 +2058,28 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
+ <object class="NSButton" id="236566072">
+ <reference key="NSNextResponder" ref="258594766"/>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{14, 12}, {163, 32}}</string>
+ <reference key="NSSuperview" ref="258594766"/>
+ <string key="NSReuseIdentifierKey">_NS:610</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1013523753">
+ <int key="NSCellFlags">604110336</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Save As New Profile</string>
+ <reference key="NSSupport" ref="1024428774"/>
+ <string key="NSCellIdentifier">_NS:610</string>
+ <reference key="NSControlView" ref="236566072"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
<string key="NSFrameSize">{558, 370}</string>
<reference key="NSSuperview"/>
@@ -2543,6 +2565,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">293</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closeCustomizationSheet:</string>
+ <reference key="source" ref="203744709"/>
+ <reference key="destination" ref="236566072"/>
+ </object>
+ <int key="connectionID">296</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2904,6 +2934,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference ref="766667681"/>
<reference ref="876884721"/>
<reference ref="427605043"/>
+ <reference ref="236566072"/>
</object>
<reference key="parent" ref="450022049"/>
</object>
@@ -3765,6 +3796,20 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="992521422"/>
<reference key="parent" ref="874510397"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">294</int>
+ <reference key="object" ref="236566072"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1013523753"/>
+ </object>
+ <reference key="parent" ref="258594766"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">295</int>
+ <reference key="object" ref="1013523753"/>
+ <reference key="parent" ref="236566072"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -3954,6 +3999,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>290.IBPluginDependency</string>
<string>291.IBPluginDependency</string>
<string>292.IBPluginDependency</string>
+ <string>294.IBPluginDependency</string>
+ <string>294.IBViewBoundsToFrameTransform</string>
+ <string>295.IBPluginDependency</string>
<string>3.CustomClassName</string>
<string>3.IBPluginDependency</string>
<string>3.IBViewBoundsToFrameTransform</string>
@@ -4043,7 +4091,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAABD9QAAwkQAAA</bytes>
+ <bytes key="NSTransformStruct">P4AAAL+AAABDpAAAwigAAA</bytes>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -4262,6 +4310,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABBYAAAwigAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>VLCDropEnabledBox</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSAffineTransform">
@@ -4332,7 +4385,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">293</int>
+ <int key="maxID">296</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.1+">
diff --git a/modules/gui/macosx/ConvertAndSave.h b/modules/gui/macosx/ConvertAndSave.h
index 957c306..5aedc9b 100644
--- a/modules/gui/macosx/ConvertAndSave.h
+++ b/modules/gui/macosx/ConvertAndSave.h
@@ -113,6 +113,9 @@
@end
@interface VLCDropEnabledBox : NSBox
+{
+ BOOL b_activeDragAndDrop;
+}
@end
diff --git a/modules/gui/macosx/ConvertAndSave.m b/modules/gui/macosx/ConvertAndSave.m
index 6e16add..1851936 100644
--- a/modules/gui/macosx/ConvertAndSave.m
+++ b/modules/gui/macosx/ConvertAndSave.m
@@ -602,12 +602,42 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
+ b_activeDragAndDrop = YES;
+ [self setNeedsDisplay:YES];
+
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) == NSDragOperationGeneric)
return NSDragOperationGeneric;
return NSDragOperationNone;
}
+- (void)draggingEnded:(id < NSDraggingInfo >)sender
+{
+ b_activeDragAndDrop = NO;
+ [self setNeedsDisplay:YES];
+}
+
+- (void)draggingExited:(id < NSDraggingInfo >)sender
+{
+ b_activeDragAndDrop = NO;
+ [self setNeedsDisplay:YES];
+}
+
+- (void)drawRect:(NSRect)dirtyRect
+{
+ if (b_activeDragAndDrop) {
+ [[NSColor colorWithCalibratedRed:(.154/.255) green:(.154/.255) blue:(.154/.255) alpha:1.] setFill];
+ NSRect frameRect = [[self contentView] bounds];
+ frameRect.origin.x += 10;
+ frameRect.origin.y += 10;
+ frameRect.size.width -= 17;
+ frameRect.size.height -= 17;
+ NSFrameRectWithWidthUsingOperation(frameRect, 4., NSCompositeHighlight);
+ }
+
+ [super drawRect:dirtyRect];
+}
+
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
More information about the vlc-commits
mailing list