Exemple #1
0
 void InitIcons()
 {
     // could use this.RenderIcon(...) but those icons can be less appealing (grey check mark, red cross)
     Gtk.Image image = new Gtk.Image();
     pixbufs[0] = image.RenderIcon(Gtk.Stock.No, IconSize.SmallToolbar, null);
     pixbufs[1] = image.RenderIcon(Gtk.Stock.Yes, IconSize.SmallToolbar, null);
     image.Destroy();
 }
        private void HandleThumbnailIconViewButtonPressEvent(object sender, Gtk.ButtonPressEventArgs args)
        {
            int old_item = current_item;

            current_item = thumbnail_iconview.CellAtPosition((int)args.Event.X, (int)args.Event.Y, false);

            if (current_item < 0 || current_item >= items.Length)
            {
                current_item = old_item;
                return;
            }

            captions [old_item] = caption_textview.Buffer.Text;

            string caption = captions [current_item];

            if (caption == null)
            {
                captions [current_item] = caption = "";
            }
            caption_textview.Buffer.Text = caption;

            tag_treeview.Model = new TagStore(account.Facebook, tags [current_item], friends);

            IBrowsableItem item           = items [current_item];
            string         thumbnail_path = ThumbnailGenerator.ThumbnailPath(item.DefaultVersionUri);

            if (tag_image_eventbox.Children.Length > 0)
            {
                tag_image_eventbox.Remove(tag_image);
                tag_image.Destroy();
            }

            using (ImageFile image = new ImageFile(thumbnail_path)) {
                Gdk.Pixbuf data = image.Load();
                data             = PixbufUtils.ScaleToMaxSize(data, 400, 400);
                tag_image_height = data.Height;
                tag_image_width  = data.Width;
                tag_image        = new Gtk.Image(data);
                tag_image_eventbox.Add(tag_image);
                tag_image_eventbox.ShowAll();
            }
        }
        void HandleThumbnailIconViewButtonPressEvent(object sender, Gtk.ButtonPressEventArgs args)
        {
            // Store caption before switching
            StoreCaption();

            int old_item = current_item;

            current_item = tray_view.CellAtPosition((int)args.Event.X, (int)args.Event.Y);

            if (current_item < 0 || current_item >= items.Length)
            {
                current_item = old_item;
                return;
            }

            string caption = captions [current_item];

            if (caption == null)
            {
                captions [current_item] = caption = "";
            }
            caption_textview.Buffer.Text = caption;
            caption_textview.Sensitive   = true;

            tag_treeview.Model = new TagStore(account.Facebook, tags [current_item], friends);

            IPhoto item = items [current_item];

            if (tag_image_eventbox.Children.Length > 0)
            {
                tag_image_eventbox.Remove(tag_image);
                tag_image.Destroy();
            }

            using (Gdk.Pixbuf data = App.Instance.Container.Resolve <IThumbnailService> ().GetThumbnail(item.DefaultVersion.Uri, ThumbnailSize.Large)) {
                tag_image_height = data.Height;
                tag_image_width  = data.Width;
                tag_image        = new Gtk.Image(data);
                tag_image_eventbox.Add(tag_image);
                tag_image_eventbox.ShowAll();
            }
        }
 void InitIcons()
 {
     // could use this.RenderIcon(...) but those icons can be less appealing (grey check mark, red cross)
     Gtk.Image image = new Gtk.Image ();
     pixbufs[0] = image.RenderIcon (Gtk.Stock.No, IconSize.SmallToolbar, null);
     pixbufs[1] = image.RenderIcon (Gtk.Stock.Yes, IconSize.SmallToolbar, null);
     image.Destroy ();
 }
Exemple #5
0
        //literally, destroy all our gui stuff
        private void DestroyEverything()
        {
            if (hbox != null)
            {
                hbox.Destroy();
            }

            if (vbox != null)
            {
                vbox.Destroy();
            }

            if (newi != null)
            {
                newi.Destroy();
            }

            if (menuBar != null)
            {
                menuBar.Destroy();
            }

            if (filemenu != null)
            {
                filemenu.Destroy();
            }

            if (file != null)
            {
                file.Destroy();
            }

            if (sep != null)
            {
                sep.Destroy();
            }

            if (exit != null)
            {
                exit.Destroy();
            }

            if (uploadButton != null)
            {
                uploadButton.Destroy();
            }

            if (toCropBox != null)
            {
                toCropBox.Destroy();
            }

            if (appimg != null)
            {
                appimg.Destroy();
            }

            if (menuItemQuit != null)
            {
                menuItemQuit.Destroy();
            }

            if (popupMenu != null)
            {
                popupMenu.Destroy();
            }

            if (notificationMessage != null)
            {
                notificationMessage.Destroy();
            }

            if (notificationEventBox != null)
            {
                notificationEventBox.Destroy();
            }

            if (mainWindowTracker != null)
            {
                mainWindowTracker.Destroy();
            }

            if (trayIcon != null)
            {
                trayIcon.Dispose();
            }

            if (agr != null)
            {
                agr.Dispose();
            }
        }