Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Quicksilver/Code-QuickStepInterface/QSObjectView.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef enum {
} QSObjectDropMode;


@interface QSObjectView : NSControl {
@interface QSObjectView : NSControl <NSDraggingSource> {
NSString *searchString;
BOOL dragImageDraw;
BOOL dragAcceptDraw;
Expand Down
12 changes: 9 additions & 3 deletions Quicksilver/Code-QuickStepInterface/QSObjectView.m
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,15 @@ - (void)setSearchString:(NSString *)newSearchString {
// [self setNeedsDisplay:YES];
}

- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal {
if (isLocal) return NSDragOperationMove;
else return ([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagCommand) ? NSDragOperationNone : NSDragOperationEvery;
- (NSDragOperation)draggingSession:(NSDraggingSession *)session
sourceOperationMaskForDraggingContext:(NSDraggingContext) context {
switch (context) {
case NSDraggingContextWithinApplication:
return NSDragOperationMove;
case NSDraggingContextOutsideApplication:
default:
return ([[NSApp currentEvent] modifierFlags] & NSEventModifierFlagCommand) ? NSDragOperationNone : NSDragOperationEvery;
}
}

- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation {
Expand Down
12 changes: 9 additions & 3 deletions Quicksilver/Code-QuickStepInterface/QSOutlineView.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ - (void)setHighlightColor:(NSColor *)aHighlightColor {
- (BOOL)shouldCollapseAutoExpandedItemsForDeposited:(BOOL)deposited {
return NO;
}
- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal {
if (isLocal) return NSDragOperationMove;
else return NSDragOperationCopy;
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
switch (context) {
case NSDraggingContextWithinApplication:
return NSDragOperationMove;
case NSDraggingContextOutsideApplication:
default:
return NSDragOperationCopy;
}
}

- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect {
if ([[self delegate] respondsToSelector:@selector(outlineView:itemIsSeparator:)]
&& [[self delegate] outlineView:self itemIsSeparator:[self itemAtRow:rowIndex]]) {
Expand Down
1 change: 1 addition & 0 deletions Quicksilver/Code-QuickStepInterface/QSSearchObjectView.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef NS_ENUM(NSUInteger, QSSearchMode) {

// whether or not the string in the underlying text editor should be 'sniffed' when editing (see QSObject_StringHandling.m - sniffString for more info)
BOOL shouldSniff;
BOOL hasMarkedTextState; // tracks input method composition state
QSAction *alternateActionCounterpart;

@public
Expand Down
39 changes: 31 additions & 8 deletions Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ - (void)awakeFromNib {
preferredEdge = NSMaxXEdge;
partialString = [[NSMutableString alloc] initWithCapacity:1];
[partialString setString:@""];
hasMarkedTextState = NO;

matchedString = nil;

Expand Down Expand Up @@ -1089,10 +1090,12 @@ - (void)keyDown:(NSEvent *)theEvent {
return;

if ([eventCharactersIgnoringModifiers isEqualToString:@" "]) {
if ([theEvent type] == NSEventTypeKeyDown) {
if ([theEvent type] == NSEventTypeKeyDown && ![self hasMarkedText]) {
[self insertSpace:nil];
}
return;
if (![self hasMarkedText]) {
return;
}
}

// ***warning * have downshift move to indirect object
Expand Down Expand Up @@ -1662,10 +1665,31 @@ - (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange {
[self setMarkedText:aString selectedRange:selRange replacementRange:NSMakeRange(0, 0)];
}

- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange {}
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange {
// Set marked text state for input method composition
hasMarkedTextState = (aString != nil && [aString length] > 0);

// Extend timers when input method is composing text
// This prevents the search from timing out while user is typing with input methods

// Extend search timer
if ([searchTimer isValid]) {
[searchTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:[[NSUserDefaults standardUserDefaults] floatForKey:kSearchDelay]]];
}

// Extend reset timer
if ([resetTimer isValid]) {
CGFloat resetDelay = [[NSUserDefaults standardUserDefaults] floatForKey:kResetDelay];
if (resetDelay) {
[resetTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:resetDelay]];
}
}
}

- (void)unmarkText {}
- (BOOL)hasMarkedText { return NO; }
- (void)unmarkText {
hasMarkedTextState = NO;
}
- (BOOL)hasMarkedText { return hasMarkedTextState; }
- (NSInteger)conversationIdentifier { return (long)self; }

- (NSAttributedString *)attributedSubstringFromRange:(NSRange)theRange {
Expand Down Expand Up @@ -1693,11 +1717,10 @@ - (NSArray *)validAttributesForMarkedText {

#pragma mark Drag and Drop

- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation
{
- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation {
[self updateHistory];
[self saveMnemonic];
[super draggedImage:anImage endedAt:aPoint operation:operation];
[super draggingSession:session endedAtPoint:screenPoint operation:operation];
}
@end

Expand Down
12 changes: 8 additions & 4 deletions Quicksilver/Code-QuickStepInterface/QSTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ - (void)draggingExited:(id <NSDraggingInfo>)sender {
}


- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal {
//NSLog(@"source");
if (isLocal) return NSDragOperationEvery;
else return NSDragOperationEvery;
- (NSDragOperation) draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
switch (context) {
case NSDraggingContextWithinApplication:
return NSDragOperationEvery;
case NSDraggingContextOutsideApplication:
default:
return NSDragOperationEvery;
}
}

- (BOOL)isOpaque {
Expand Down
Loading