New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dragjs #231

Closed
wants to merge 15 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@clintberry
Contributor

clintberry commented Apr 23, 2013

This adds the ability to create a mousedown event in the DOM that will drag the shell window around the screen. Convenient if you remove the frame from CEF and need a way to move the window around still.

Show outdated Hide outdated appshell/appshell_extensions.cpp
@@ -580,7 +580,21 @@ class ProcessMessageDelegate : public ClientHandler::ProcessMessageDelegate {
responseArgs->SetString(2, parentId);
responseArgs->SetInt(3, index);
}
} else {
} else if (message_name == "Drag") {

This comment has been minimized.

@gruehle

gruehle May 9, 2013

Member

The name "Drag" is a bit too generic. "DragWindow" would be better.

@gruehle

gruehle May 9, 2013

Member

The name "Drag" is a bit too generic. "DragWindow" would be better.

This comment has been minimized.

@clintberry

clintberry May 9, 2013

Contributor

Sounds good, I will update.

@clintberry

clintberry May 9, 2013

Contributor

Sounds good, I will update.

Show outdated Hide outdated appshell/appshell_extensions.cpp
} else {
} else if (message_name == "Drag") {
// Parameters:
// 0: int32 - callback id

This comment has been minimized.

@gruehle

gruehle May 9, 2013

Member

This comment is out of date. Please update or remove.

@gruehle

gruehle May 9, 2013

Member

This comment is out of date. Please update or remove.

Show outdated Hide outdated appshell/appshell_extensions.js
@@ -687,6 +687,19 @@ if (!appshell.app) {
appshell.app.showExtensionsFolder = function (appURL, callback) {
appshell.app.showOSFolder(GetApplicationSupportDirectory() + "/extensions", callback);
};
/**
* Open the extensions folder in an OS file window.

This comment has been minimized.

@gruehle

gruehle May 9, 2013

Member

This comment block needs updating.

@gruehle

gruehle May 9, 2013

Member

This comment block needs updating.

Show outdated Hide outdated appshell/appshell_extensions.js
* @return None. This is an asynchronous call that sends all return information to the callback.
*/
native function Drag();
appshell.app.drag = function () {

This comment has been minimized.

@gruehle

gruehle May 9, 2013

Member

Again, "drag" is a bit too generic. This should be "dragWindow".

@gruehle

gruehle May 9, 2013

Member

Again, "drag" is a bit too generic. This should be "dragWindow".

Show outdated Hide outdated appshell/appshell_extensions_mac.mm
origin.y -= current.y;
while (YES) {
NSEvent* event = [win nextEventMatchingMask:(NSLeftMouseDraggedMask | NSLeftMouseUpMask)];

This comment has been minimized.

@gruehle

gruehle May 9, 2013

Member

Style nit: this block of code should be indented by 4 spaces instead of 2.

@gruehle

gruehle May 9, 2013

Member

Style nit: this block of code should be indented by 4 spaces instead of 2.

@gruehle

This comment has been minimized.

Show comment
Hide comment
@gruehle

gruehle May 9, 2013

Member

@clintberry - sorry it's taken so long to review. The code works great on Mac and Windows, I just had a few small comments.

Also, it would be best if you could squash/rebase your commits. Thanks!

Member

gruehle commented May 9, 2013

@clintberry - sorry it's taken so long to review. The code works great on Mac and Windows, I just had a few small comments.

Also, it would be best if you could squash/rebase your commits. Thanks!

@clintberry

This comment has been minimized.

Show comment
Hide comment
@clintberry

clintberry May 9, 2013

Contributor

Nice! okay, I have never rebased before. I will give it a go now...

Contributor

clintberry commented May 9, 2013

Nice! okay, I have never rebased before. I will give it a go now...

@clintberry

This comment has been minimized.

Show comment
Hide comment
@clintberry

clintberry May 9, 2013

Contributor

I'm not sure why that last merge got in there. Still learning Git, sorry. But I did clean up the code. Sorry it was so messy. I will make sure to clean up comments and styling better next time. Working on getting the chrome frame transparent so you can make apps with all sorts of shapes :-)

Contributor

clintberry commented May 9, 2013

I'm not sure why that last merge got in there. Still learning Git, sorry. But I did clean up the code. Sorry it was so messy. I will make sure to clean up comments and styling better next time. Working on getting the chrome frame transparent so you can make apps with all sorts of shapes :-)

@gruehle

This comment has been minimized.

Show comment
Hide comment
@gruehle

gruehle May 9, 2013

Member

Thanks! I rebased/squashed your commits into 5e52d86 and merged.

Member

gruehle commented May 9, 2013

Thanks! I rebased/squashed your commits into 5e52d86 and merged.

@gruehle gruehle closed this May 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment