Пример #1
0
        public FullScreenView(IBrowsableCollection collection, Gtk.Window parent) : base("Full Screen Mode")
        {
            //going fullscreen on the same screen the parent window
            Gdk.Screen screen  = Screen;
            int        monitor = screen.GetMonitorAtWindow(parent.GdkWindow);

            Gdk.Rectangle bounds = screen.GetMonitorGeometry(monitor);
            Move(bounds.X, 0);


            string style = "style \"test\" {\n" +
                           "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" +
                           "}\n" +
                           "class \"GtkToolbar\" style \"test\"";

            Gtk.Rc.ParseString(style);

            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup("joe");

                actions.Add(new ActionEntry [] {
                    new ActionEntry(HideToolbar, Stock.Close,
                                    Catalog.GetString("Hide"),
                                    null,
                                    Catalog.GetString("Hide Toolbar"),
                                    HideToolbarAction)
                });

                actions.Add(new ToggleActionEntry [] {
                    new ToggleActionEntry(Info,
                                          Stock.Info,
                                          Catalog.GetString("Info"),
                                          null,
                                          Catalog.GetString("Image Information"),
                                          InfoAction,
                                          false)
                });

                Gtk.Action exit_full_screen = new Gtk.Action(ExitFullScreen,
                                                             Catalog.GetString("Exit fullscreen"),
                                                             null,
                                                             null);
#if GTK_2_10
                exit_full_screen.IconName = "view-restore";
#endif
                exit_full_screen.Activated += ExitAction;
                actions.Add(exit_full_screen);

                Gtk.Action slide_show = new Gtk.Action(SlideShow,
                                                       Catalog.GetString("Slideshow"),
                                                       Catalog.GetString("Start slideshow"),
                                                       null);
#if GTK_2_10
                slide_show.IconName = "media-playback-start";
#endif
                slide_show.Activated += SlideShowAction;
                actions.Add(slide_show);

                new Fader(this, 1.0, 3);
                notebook            = new Notebook();
                notebook.ShowBorder = false;
                notebook.ShowTabs   = false;
                notebook.Show();

                scroll = new ScrolledView();
                scroll.ScrolledWindow.SetPolicy(PolicyType.Never, PolicyType.Never);
                view = new PhotoImageView(collection);
                // FIXME this should be handled by the new style setting code
                view.ModifyBg(Gtk.StateType.Normal, this.Style.Black);
                this.Add(notebook);
                view.Show();
                view.MotionNotifyEvent += HandleViewMotion;
                view.PointerMode        = ImageView.PointerModeType.Scroll;

                scroll.ScrolledWindow.Add(view);

                Toolbar tbar = new Toolbar();
                tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;

                tbar.ShowArrow   = false;
                tbar.BorderWidth = 15;

                ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem() as ToolItem;
                t_item.IsImportant = true;
                tbar.Insert(t_item, -1);

                Gtk.Action action = new PreviousPictureAction(view.Item);
                actions.Add(action);
#if GTK_2_10
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);
#else
                t_item = action.CreateToolItem() as ToolItem;
                (t_item as ToolButton).IconName = "gtk-go-back-ltr";
                tbar.Insert(t_item, -1);
#endif

                play_pause_button = (actions [SlideShow]).CreateToolItem() as ToolButton;
#if GTK_2_10
                tbar.Insert(play_pause_button, -1);
#else
                play_pause_button.IconName = "media-playback-start";
                tbar.Insert(play_pause_button, -1);
#endif

                action = new NextPictureAction(view.Item);
                actions.Add(action);
#if GTK_2_10
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);
#else
                t_item = action.CreateToolItem() as ToolItem;
                (t_item as ToolButton).IconName = "gtk-go-forward-ltr";
                tbar.Insert(t_item, -1);
#endif

                t_item       = new ToolItem();
                t_item.Child = new Label(Catalog.GetString("Slide transition:"));
                tbar.Insert(t_item, -1);

                display = new TextureDisplay(view.Item);
                display.AddEvents((int)(Gdk.EventMask.PointerMotionMask));
                display.ModifyBg(Gtk.StateType.Normal, this.Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                display.Show();

                t_item       = new ToolItem();
                t_item.Child = display.GetCombo();
                tbar.Insert(t_item, -1);

                action = new RotateLeftAction(view.Item);
                actions.Add(action);
#if GTK_2_10
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);
#else
                t_item = action.CreateToolItem() as ToolItem;
                (t_item as ToolButton).IconName = "object-rotate-left";
                tbar.Insert(t_item, -1);
#endif

                action = new RotateRightAction(view.Item);
                actions.Add(action);
#if GTK_2_10
                tbar.Insert(action.CreateToolItem() as ToolItem, -1);
#else
                t_item = action.CreateToolItem() as ToolItem;
                (t_item as ToolButton).IconName = "object-rotate-right";
                tbar.Insert(t_item, -1);
#endif

                info_button = (ToggleToolButton)((actions [Info]).CreateToolItem() as ToolItem);
                tbar.Insert(info_button, -1);

                tbar.Insert((actions [HideToolbar]).CreateToolItem() as ToolItem, -1);

                notebook.AppendPage(scroll, null);
                notebook.AppendPage(display, null);

                tbar.ShowAll();

                scroll.Show();
                this.Decorated = false;
                this.Fullscreen();
                this.ButtonPressEvent += HandleButtonPressEvent;

                view.Item.Changed += HandleItemChanged;
                view.GrabFocus();

                hide_cursor_delay = new Delay(3000, new GLib.IdleHandler(HideCursor));
                hide_cursor_delay.Start();

                controls = new ControlOverlay(this);
                controls.Add(tbar);
                controls.Dismiss();

                notebook.CurrentPage = 0;
            } catch (System.Exception e) {
                Log.Exception(e);
            }
        }
		public FullScreenView (IBrowsableCollection collection) : base ("Full Screen Mode")
		{
			Name = "FullscreenContainer";
			try {
				//scroll = new Gtk.ScrolledWindow (null, null);
				actions = new ActionGroup ("joe");
				
				actions.Add (new ActionEntry [] {
					new ActionEntry (HideToolbar, Stock.Close, 
							 Catalog.GetString ("Hide"), 
							 null, 
							 Catalog.GetString ("Hide Toolbar"), 
							 HideToolbarAction),
					new ActionEntry (ExitFullScreen, 
							 "f-spot-view-restore", 
							 Catalog.GetString ("Exit fullscreen"), 
							 null, 
							 null, 
							 ExitAction),
					new ActionEntry (SlideShow,
							 "f-spot-slideshow",
							 Catalog.GetString ("Slideshow"),
							 null,
							 Catalog.GetString ("Start slideshow"),
							 SlideShowAction),
						});

				actions.Add (new ToggleActionEntry [] {
					new ToggleActionEntry (Info,
							       Stock.Info,
							       Catalog.GetString ("Info"),
							       null,
							       Catalog.GetString ("Image Information"),
							       InfoAction,
							       false)
						});
				
				new Fader (this, 1.0, 3);
				notebook = new Notebook ();
				notebook.ShowBorder = false;
				notebook.ShowTabs = false;
				notebook.Show ();

				scroll = new ScrolledView ();
				view = new PhotoImageView (collection);
				// FIXME this should be handled by the new style setting code
				view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				view.PointerMode = ImageView.PointerModeType.Scroll;
				this.Add (notebook);
				view.Show ();
				view.MotionNotifyEvent += HandleViewMotion;
				
				Action rotate_left = new RotateLeftAction (view.Item);
				actions.Add (rotate_left);
				
				Action rotate_right = new RotateRightAction (view.Item);
				actions.Add (rotate_right);

				scroll.ScrolledWindow.Add (view);
				HBox hhbox = new HBox ();
				hhbox.PackEnd (GetButton (HideToolbar), false, true, 0);
				hhbox.PackEnd (GetButton (Info), false, true, 0);
				hhbox.PackStart (GetButton (ExitFullScreen, true), false, false, 0);
				hhbox.PackStart (Add (new PreviousPictureAction (view.Item)), false, false, 0);
				hhbox.PackStart (GetButton (SlideShow), false, true, 0);
				hhbox.PackStart (Add (new NextPictureAction (view.Item)), false, false, 0);
				//hhbox.PackStart (Add (new AutoColor (view.Item)), false, false, 0);

				display = new TextureDisplay (view.Item);
				display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
				display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				display.MotionNotifyEvent += HandleViewMotion;
				Label effect = new Label (Catalog.GetString ("Slide transition: "));
				hhbox.PackStart (effect, false, false, 5);
				hhbox.PackStart (display.GetCombo (), false, false, 0);
				display.Show ();

				hhbox.PackStart (Add (new RotateLeftAction (view.Item)), false, false, 0);
				hhbox.PackStart (Add (new RotateRightAction (view.Item)), false, false, 0);
				hhbox.BorderWidth = 15;

				tag_view = new TagView ();
				hhbox.PackStart (tag_view, false, false, 0);

				//display = new ImageDisplay (view.Item);

				notebook.AppendPage (scroll, null);
				notebook.AppendPage (display, null);

				hhbox.ShowAll ();
				//scroll.ShowControls ();
				
				scroll.Show ();
				this.Decorated = false;
				this.Fullscreen ();
				this.ButtonPressEvent += HandleButtonPressEvent;
				
				view.Item.Changed += HandleItemChanged;
				view.GrabFocus ();
				
				controls = new ControlOverlay (this);
				controls.Add (hhbox);
				controls.Dismiss ();

				notebook.CurrentPage = 0;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}	

		}
Пример #3
0
        public FullScreenView(IBrowsableCollection collection) : base("Full Screen Mode")
        {
            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup("joe");

                actions.Add(new ActionEntry [] {
                    new ActionEntry(HideToolbar, Stock.Close,
                                    Catalog.GetString("Hide"),
                                    null,
                                    Catalog.GetString("Hide Toolbar"),
                                    HideToolbarAction),
                    new ActionEntry(ExitFullScreen,
                                    "f-spot-view-restore",
                                    Catalog.GetString("Exit fullscreen"),
                                    null,
                                    null,
                                    ExitAction),
                    new ActionEntry(SlideShow,
                                    "f-spot-slideshow",
                                    Catalog.GetString("Slideshow"),
                                    null,
                                    Catalog.GetString("Start slideshow"),
                                    SlideShowAction),
                });

                actions.Add(new ToggleActionEntry [] {
                    new ToggleActionEntry(Info,
                                          Stock.Info,
                                          Catalog.GetString("Info"),
                                          null,
                                          Catalog.GetString("Image Information"),
                                          InfoAction,
                                          false)
                });

                new Fader(this, 1.0, 3);
                notebook            = new Notebook();
                notebook.ShowBorder = false;
                notebook.ShowTabs   = false;
                notebook.Show();

                scroll = new ScrolledView();
                view   = new PhotoImageView(collection);
                // FIXME this should be handled by the new style setting code
                view.ModifyBg(Gtk.StateType.Normal, this.Style.Black);
                view.PointerMode = ImageView.PointerModeType.Scroll;
                this.Add(notebook);
                view.Show();
                view.MotionNotifyEvent += HandleViewMotion;

                Action rotate_left = new RotateLeftAction(view.Item);
                actions.Add(rotate_left);

                Action rotate_right = new RotateRightAction(view.Item);
                actions.Add(rotate_right);

                scroll.ScrolledWindow.Add(view);
                HBox hhbox = new HBox();
                hhbox.PackEnd(GetButton(HideToolbar), false, true, 0);
                hhbox.PackEnd(GetButton(Info), false, true, 0);
                hhbox.PackStart(GetButton(ExitFullScreen, true), false, false, 0);
                hhbox.PackStart(Add(new PreviousPictureAction(view.Item)), false, false, 0);
                hhbox.PackStart(GetButton(SlideShow), false, true, 0);
                hhbox.PackStart(Add(new NextPictureAction(view.Item)), false, false, 0);
                //hhbox.PackStart (Add (new AutoColor (view.Item)), false, false, 0);

                display = new TextureDisplay(view.Item);
                display.AddEvents((int)(Gdk.EventMask.PointerMotionMask));
                display.ModifyBg(Gtk.StateType.Normal, this.Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                Label effect = new Label(Catalog.GetString("Slide transition: "));
                hhbox.PackStart(effect, false, false, 5);
                hhbox.PackStart(display.GetCombo(), false, false, 0);
                display.Show();

                hhbox.PackStart(Add(new RotateLeftAction(view.Item)), false, false, 0);
                hhbox.PackStart(Add(new RotateRightAction(view.Item)), false, false, 0);
                hhbox.BorderWidth = 15;

                tag_view = new TagView();
                hhbox.PackStart(tag_view, false, false, 0);

                //display = new ImageDisplay (view.Item);

                notebook.AppendPage(scroll, null);
                notebook.AppendPage(display, null);

                hhbox.ShowAll();
                //scroll.ShowControls ();

                scroll.Show();
                this.Decorated = false;
                this.Fullscreen();
                this.ButtonPressEvent += HandleButtonPressEvent;

                view.Item.Changed += HandleItemChanged;
                view.GrabFocus();

                controls = new ControlOverlay(this);
                controls.Add(hhbox);
                controls.Dismiss();

                notebook.CurrentPage = 0;
            } catch (System.Exception e) {
                System.Console.WriteLine(e);
            }
        }