Skip to content
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

Implement the beginnings of scrolling via dragging. #460

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Add rust-alert to the tree and use it to allow a new URL to be naviga…

…ted to
  • Loading branch information
pcwalton committed May 21, 2013
commit 4d7f003cd94ad3043f05a8919c6e49fe96947898
@@ -85,3 +85,6 @@
[submodule "src/compiler/rust"]
path = src/compiler/rust
url = https://github.com/mozilla/rust.git
[submodule "src/support/alert/rust-alert"]
path = src/support/alert/rust-alert
url = git://github.com/mozilla-servo/rust-alert.git
@@ -398,6 +398,7 @@ AUTOCMD="${LIBTOOLIZE} && autoconf && autoheader && automake --add-missing --cop
# Copied from cairo's autogen.sh. Build fails without

CFG_SUBMODULES="\
support/alert/rust-alert \
support/azure/rust-azure \
support/css/rust-css \
support/geom/rust-geom \
@@ -103,6 +103,11 @@ DEPS_rust-io-surface += \
rust-core-foundation \
$(NULL)

DEPS_rust-alert += \
rust-core-foundation \
rust-cocoa \
$(NULL)

DEPS_sharegl += \
rust-core-foundation \
rust-io-surface \
@@ -10,6 +10,7 @@
use windowing::{ApplicationMethods, CompositeCallback, LoadUrlCallback, ResizeCallback};
use windowing::{WindowMethods};

use alert::{Alert, AlertMethods};
use geom::size::Size2D;
use glut::glut::{DOUBLE, WindowHeight, WindowWidth};
use glut::glut;
@@ -116,7 +117,17 @@ impl Window {
fn load_url(&self) {
match self.load_url_callback {
None => error!("no URL callback registered, doing nothing"),
Some(callback) => callback("http://purple.com/"),
Some(callback) => {
let mut alert: Alert = AlertMethods::new("Navigate to:");
alert.add_prompt();
alert.run();
let value = alert.prompt_value();
if "" == value { // To avoid crashing on Linux.
callback("http://purple.com/")
} else {
callback(value)
}
}
}
}
}
@@ -11,6 +11,7 @@
#[license = "MPL"];
#[crate_type = "lib"];

extern mod alert;
extern mod azure;
extern mod geom;
extern mod gfx (name = "servo_gfx");
Submodule rust-alert added at 0cba81
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.