seed r538 - trunk/examples/browser



Author: hortont
Date: Tue Dec 23 06:23:55 2008
New Revision: 538
URL: http://svn.gnome.org/viewvc/seed?rev=538&view=rev

Log:
Sync browser.


Modified:
   trunk/examples/browser/browser-actions.js
   trunk/examples/browser/browser-find.js
   trunk/examples/browser/browser-menu.js
   trunk/examples/browser/browser-tab.js
   trunk/examples/browser/main.js

Modified: trunk/examples/browser/browser-actions.js
==============================================================================
--- trunk/examples/browser/browser-actions.js	(original)
+++ trunk/examples/browser/browser-actions.js	Tue Dec 23 06:23:55 2008
@@ -199,6 +199,17 @@
 					  "gtk-reload", 
 					  "F5", 
 					 refresh_page);
+
+	select_all_location_bar_action = 
+		create_action("select-all-location-bar", 
+					  "Select All Text in the Location Bar", 
+					  null, 
+					  "F6", 
+					 function() {
+						var bar = current_tab().toolbar.urlBar;
+						bar.select_region(0,bar.get_text_length());
+					});
+	
 	
 	quit_action = 
 		create_action("quit",
@@ -306,6 +317,18 @@
 					  "gtk-add",
 					  "<Ctrl>B",
 					  add_bookmark);
+
+	fullscreen_action = 
+		create_action("fullscreen",
+						"Fullscreen",
+						null,
+						"F11",
+						function(){
+							if (window_is_fullscreen)
+								window.unfullscreen();
+							else
+								window.fullscreen();
+						});
 	
 	// Someone needs to figure out how to use Tab in a key accel.
 	/*cycle_tabs_action = new Gtk.Action({name:"cycletabs", label:"Cycle Through Tabs",

Modified: trunk/examples/browser/browser-find.js
==============================================================================
--- trunk/examples/browser/browser-find.js	(original)
+++ trunk/examples/browser/browser-find.js	Tue Dec 23 06:23:55 2008
@@ -9,10 +9,10 @@
 		closeButton.set_image(new Gtk.Image({stock: "gtk-close", 
 				icon_size: Gtk.IconSize.Menu}));
 		closeButton.signal.clicked.connect(
-			function ()
+			function (button, findBox)
             {
-				this.entryBox.text = "";
-				this.hide();
+				findBox.entryBox.text = "";
+				findBox.hide();
             }, this);
 		closeButton.set_relief(Gtk.ReliefStyle.None);
 

Modified: trunk/examples/browser/browser-menu.js
==============================================================================
--- trunk/examples/browser/browser-menu.js	(original)
+++ trunk/examples/browser/browser-menu.js	Tue Dec 23 06:23:55 2008
@@ -56,9 +56,23 @@
 		this.append(this.addBookmarkItem);
 		this.append(new Gtk.SeparatorMenuItem());
 	}};
-
 BookmarksMenu = new GType(BookmarksMenuType);
 
+HistoryMenuType = {
+	parent: Gtk.Menu.type,
+	name: "HistoryMenu",
+	class_init: function(klass, prototype)
+	{
+	},
+	instance_init: function(klass)
+	{
+		//TODO: Add something meaningful to the history here
+		//this.aboutTabItem = about_action.create_menu_item();
+		//this.append(this.aboutTabItem);
+	}};
+
+HistoryMenu = new GType(HistoryMenuType);
+
 HelpMenuType = {
 	parent: Gtk.Menu.type,
 	name: "HelpMenu",
@@ -104,6 +118,7 @@
 		this.fileMenu = new FileMenu();
 		this.editMenu = new EditMenu();
 		this.bookmarksMenu = new BookmarksMenu();
+		this.historyMenu = new HistoryMenu();
 		this.helpMenu = new HelpMenu();
 		this.viewMenu = new ViewMenu();
 		
@@ -111,18 +126,21 @@
 		this.editItem = new Gtk.MenuItem({"child": new Gtk.Label({"label": "Edit"})});
 		this.viewItem = new Gtk.MenuItem({"child": new Gtk.Label({"label": "View"})});
 		this.bookmarksItem = new Gtk.MenuItem({"child": new Gtk.Label({"label": "Bookmarks"})});
+		this.historyItem = new Gtk.MenuItem({"child": new Gtk.Label({"label": "History"})});
 		this.helpItem = new Gtk.MenuItem({"child": new Gtk.Label({"label": "Help"})});
 		
 		this.fileItem.submenu = this.fileMenu;
 		this.editItem.submenu = this.editMenu;
 		this.viewItem.submenu = this.viewMenu;
 		this.bookmarksItem.submenu = this.bookmarksMenu;
+		this.historyItem.submenu = this.historyMenu;
 		this.helpItem.submenu = this.helpMenu;
 		
 		this.append(this.fileItem);
 		this.append(this.editItem);
 		this.append(this.viewItem);
 		this.append(this.bookmarksItem);
+		this.append(this.historyItem);
 		this.append(this.helpItem);
 	}};
 

Modified: trunk/examples/browser/browser-tab.js
==============================================================================
--- trunk/examples/browser/browser-tab.js	(original)
+++ trunk/examples/browser/browser-tab.js	Tue Dec 23 06:23:55 2008
@@ -48,6 +48,10 @@
 				return;
 			
 			this.webView = webView;
+
+			//not sure what the default on this is, so we'll do it live
+ 			//this.histList = WebKit.WebBackForwardList.new_with_web_view(this.webView);
+ 			this.webView.set_maintains_back_forward_list(true);
 			
 			this.webView.set_scroll_adjustments(null, null);
 			this.webView.signal.title_changed.connect(title_changed, this);

Modified: trunk/examples/browser/main.js
==============================================================================
--- trunk/examples/browser/main.js	(original)
+++ trunk/examples/browser/main.js	Tue Dec 23 06:23:55 2008
@@ -80,9 +80,16 @@
 
 var window = new Gtk.Window({title: "Browser"});
 window.signal.hide.connect(shutdown);
-window.resize(800,500);
+window.resize(1024,768);
 window.add_accel_group(initialize_actions());
 
+//this keeping track of being fullscreen could probably be done better, maybe a BrowserWindow class or something
+//like this is kind of dumb, we set this to true since it will be toggled to false
+//when the event is generated from the window first appearing, since it's not exclusively
+//a fullscreen event.
+var window_is_fullscreen = true;
+window.signal.window_state_event.connect(function(){window_is_fullscreen = ! window_is_fullscreen; return false});
+
 var status = new Gtk.Statusbar();
 // Small race condition with progressBar of sorts.
 // ^^ /what/?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]