[ease] Set the color dialog to modal.



commit 0271c642b8ec74c8656e17545f2d2a6bd63e00b0
Author: Nate Stedman <natesm gmail com>
Date:   Thu Jun 24 14:16:53 2010 -0400

    Set the color dialog to modal.
    
    - This allows the "OK" and "Cancel" buttons to function
      logically.

 src/ease-editor-window.vala |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index 79c9799..9307759 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -357,12 +357,15 @@ public class Ease.EditorWindow : Gtk.Window
 	
 	private void show_color_dialog()
 	{
+		if (embed.selected == null) return;
 		if (color_dialog != null)
 		{
 			color_dialog.present();
 			return;
 		}
 		
+		var original_color = embed.selected.element.get_color();
+		
 		color_dialog = new Gtk.ColorSelectionDialog(_("Select Color"));
 		color_selection = color_dialog.color_selection as Gtk.ColorSelection;
 		
@@ -377,6 +380,18 @@ public class Ease.EditorWindow : Gtk.Window
 			color_dialog = null;
 		});
 		
+		(color_dialog.ok_button as Gtk.Button).clicked.connect(() => {
+			color_dialog.hide();
+		});
+		
+		(color_dialog.cancel_button as Gtk.Button).clicked.connect(() => {
+			embed.selected.element.set_color(original_color);
+			color_dialog.hide();
+		});
+		
+		color_dialog.set_transient_for(this);
+		color_dialog.modal = true;
+		
 		color_dialog.show_all();
 	}
 	



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