f-spot r4389 - trunk/src/Widgets
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4389 - trunk/src/Widgets
- Date: Wed, 17 Sep 2008 10:40:06 +0000 (UTC)
Author: sdelcroix
Date: Wed Sep 17 10:40:06 2008
New Revision: 4389
URL: http://svn.gnome.org/viewvc/f-spot?rev=4389&view=rev
Log:
various fixes to the EditorPage.cs
Modified:
trunk/src/Widgets/EditorPage.cs
Modified: trunk/src/Widgets/EditorPage.cs
==============================================================================
--- trunk/src/Widgets/EditorPage.cs (original)
+++ trunk/src/Widgets/EditorPage.cs Wed Sep 17 10:40:06 2008
@@ -65,9 +65,10 @@
public EditorPageWidget () {
editors = new List<Editor> ();
+ editor_buttons = new Dictionary<Editor, Button> ();
+ ShowTools ();
AddinManager.AddExtensionNodeHandler ("/FSpot/Editors", OnExtensionChanged);
- ShowTools ();
}
private void OnExtensionChanged (object s, ExtensionNodeEventArgs args) {
@@ -78,6 +79,7 @@
editor.ProcessingStep += OnProcessingStep;
editor.ProcessingFinished += OnProcessingFinished;
editors.Add (editor);
+ PackButton (editor);
}
}
@@ -102,13 +104,22 @@
internal void ChangeButtonVisibility () {
foreach (Editor editor in editors) {
Button button;
- editor_buttons.TryGetValue (editor, out button);
-
- bool visible = Page.InPhotoView || editor.CanHandleMultiple;
- button.Visible = visible;
+ if (editor_buttons.TryGetValue (editor, out button))
+ button.Visible = Page.InPhotoView || editor.CanHandleMultiple;
}
}
+ void PackButton (Editor editor)
+ {
+ Button button = new Button (editor.Label);
+ if (editor.IconName != null)
+ button.Image = new Image (GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags)0));
+ button.Clicked += delegate (object o, EventArgs e) { ChooseEditor (editor); };
+ button.Show ();
+ buttons.Add (button);
+ editor_buttons.Add (editor, button);
+ }
+
public void ShowTools () {
// Remove any open editor, if present.
if (current_editor != null) {
@@ -141,17 +152,8 @@
buttons.Spacing = 5;
buttons.LayoutStyle = ButtonBoxStyle.Start;
- editor_buttons = new Dictionary<Editor, Button> ();
- foreach (Editor editor in editors) {
- // Build sidebar button and add it to the sidebar.
- Editor current = editor;
- Button button = new Button (editor.Label);
- button.Image = new Image (GtkUtil.TryLoadIcon (FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags)0));
- button.Clicked += delegate (object o, EventArgs e) { ChooseEditor (current); };
- button.Show ();
- buttons.Add (button);
- editor_buttons.Add (editor, button);
- }
+ foreach (Editor editor in editors)
+ PackButton (editor);
buttons.Show ();
widgets.Add (buttons);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]