Permalink
Browse files

backport 90217 from trunk to 1.2.6 branch.

svn path=/branches/mono-1-2-6/mono-tools/; revision=90864
  • Loading branch information...
1 parent 4535551 commit 61a2129eaae8e05cc8944f4895646fbfa2c874a3 Wade Berrier committed Dec 6, 2007
Showing with 63 additions and 6 deletions.
  1. +10 −0 docbrowser/ChangeLog
  2. +31 −6 docbrowser/browser.cs
  3. +22 −0 docbrowser/browser.glade
View
@@ -1,3 +1,13 @@
+2007-11-23 Mario Sopena <mario.sopena@gmail.com>
+
+ * browser.cs:
+ - fix #324305. Now, when search results panel lost focus,
+ unselects the selected search result
+ - fix #322097. Solution based on the patch provided
+ by gabriel.burt@gmail.com
+ - Use CSS when gecko is used as renderer
+
+
2007-11-15 Wade Berrier <wberrier@novell.com>
* monodoc.in: force --no-gecko because xulrunner crashes on some distros
View
@@ -161,6 +161,7 @@ public class Browser {
[Glade.Widget] public MenuItem cut1;
[Glade.Widget] public MenuItem paste1;
[Glade.Widget] public MenuItem print;
+ [Glade.Widget] public MenuItem close_tab;
public Notebook tabs_nb;
public Tab CurrentTab;
bool HoldCtrl;
@@ -383,6 +384,7 @@ void CreateSearchPanel ()
search_tree.Model = search_store;
search_tree.AppendColumn ("Searches", new CellRendererText(), "text", 0);
search_tree.Selection.Changed += new EventHandler (ShowSearchResult);
+ search_tree.FocusOutEvent += new FocusOutEventHandler(LostFocus);
vbox1.ShowAll ();
search_vbox.ShowAll ();
@@ -394,6 +396,7 @@ void AddTab()
CurrentTab = new Tab (this);
tabs_nb.AppendPage (CurrentTab, CurrentTab.TabLabel);
tabs_nb.ShowTabs = (tabs_nb.NPages > 1);
+ close_tab.Sensitive = (tabs_nb.NPages > 1);
tabs_nb.ShowAll (); //Needed to show the new tab
tabs_nb.CurrentPage = tabs_nb.PageNum (CurrentTab);
//Show root node
@@ -405,6 +408,14 @@ void AddTab()
}
}
+
+ void CloseTab ()
+ {
+ tabs_nb.RemovePage(tabs_nb.CurrentPage);
+ bool multiple_tabs = (tabs_nb.NPages > 1);
+ tabs_nb.ShowTabs = multiple_tabs;
+ close_tab.Sensitive = multiple_tabs;
+ }
//Called when the user changes the active Tab
void ChangeTab(object o, SwitchPageArgs args)
@@ -463,6 +474,15 @@ void OnSearchActivated (object sender, EventArgs a)
search_tree.Selection.SelectPath (p);
search_term.Editable = true;
}
+
+ //
+ // Invoked when the search results panel losts focus
+ //
+ void LostFocus(object sender, FocusOutEventArgs a)
+ {
+ search_tree.Selection.UnselectAll();
+ }
+
//
// Invoked when the user click on one of the search results
//
@@ -1610,6 +1630,14 @@ void OnNewTab (object sender, EventArgs a)
{
AddTab();
}
+
+ //
+ // Invoked by Close Tab menu entry.
+ //
+ public void OnCloseTab (object sender, EventArgs a)
+ {
+ CloseTab();
+ }
}
@@ -2275,12 +2303,14 @@ public Tab(Browser br)
if (browser.UseGecko) {
html = GetRenderer ("GeckoHtmlRender.dll", "Monodoc.GeckoHtmlRender", browser);
html_preview = GetRenderer ("GeckoHtmlRender.dll", "Monodoc.GeckoHtmlRender", browser);
+ HelpSource.use_css = true;
}
if (html == null || html_preview == null) {
html = GetRenderer ("GtkHtmlHtmlRender.dll", "Monodoc.GtkHtmlHtmlRender", browser);
html_preview = GetRenderer ("GtkHtmlHtmlRender.dll", "Monodoc.GtkHtmlHtmlRender", browser);
browser.UseGecko = false;
+ HelpSource.use_css = false;
}
if (html == null || html_preview == null)
@@ -2389,7 +2419,7 @@ public Tab(Browser br)
tabClose.Add(img);
tabClose.Relief = Gtk.ReliefStyle.None;
tabClose.SetSizeRequest (18, 18);
- tabClose.Clicked += new EventHandler (OnTabClose);
+ tabClose.Clicked += new EventHandler (browser.OnCloseTab);
//Icon showed when the Tab is in Edit Mode
EditImg = new Image (Stock.Convert, IconSize.SmallToolbar);
@@ -2538,11 +2568,6 @@ void EditedTextChanged (object sender, EventArgs args)
return false;
});
}
- void OnTabClose (object sender, EventArgs a)
- {
- browser.tabs_nb.RemovePage(browser.tabs_nb.PageNum(this));
- browser.tabs_nb.ShowTabs = (browser.tabs_nb.NPages > 1);
- }
}
}
View
@@ -110,6 +110,28 @@
</widget>
</child>
+ <child>
+ <widget class="GtkImageMenuItem" id="close_tab">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Close Tab</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="OnCloseTab" last_modification_time="Sat, 10 Nov 2007 15:30:32 GMT"/>
+ <accelerator key="W" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+
+ <child internal-child="image">
+ <widget class="GtkImage" id="image144">
+ <property name="visible">True</property>
+ <property name="stock">gtk-close</property>
+ <property name="icon_size">1</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
<child>
<widget class="GtkImageMenuItem" id="quit1">
<property name="visible">True</property>

0 comments on commit 61a2129

Please sign in to comment.