示例#1
0
        void HandleIconButtonClicked(object sender, EventArgs args)
        {
            var dialog = new EditTagIconDialog(db, tag, this);

            var response = (ResponseType)dialog.Run();

            if (response == ResponseType.Ok)
            {
                if (dialog.ThemeIconName != null)
                {
                    tag.ThemeIconName = dialog.ThemeIconName;
                }
                else
                {
                    tag.ThemeIconName = null;
                    tag.Icon          = dialog.PreviewPixbuf;
                }
            }
            else if (response == (ResponseType)1)
            {
                tag.Icon = null;
            }

            if (tag.Icon != null && ColorManagement.Profiles.TryGetValue(Preferences.Get <string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out var screen_profile))
            {
                icon_image.Pixbuf = tag.Icon.Copy();
                ColorManagement.ApplyProfile(icon_image.Pixbuf, screen_profile);
            }
            else
            {
                icon_image.Pixbuf = tag.Icon;
            }

            dialog.Destroy();
        }
示例#2
0
        void HandleIconButtonClicked(object sender, EventArgs args)
        {
            EditTagIconDialog dialog = new EditTagIconDialog (db, tag, this);

            ResponseType response = (ResponseType)dialog.Run ();
            if (response == ResponseType.Ok)
                if (dialog.ThemeIconName != null) {
                    tag.ThemeIconName = dialog.ThemeIconName;
                } else {
                    tag.ThemeIconName = null;
                    tag.Icon = dialog.PreviewPixbuf;
                }
                else if (response == (ResponseType)1)
                    tag.Icon = null;

            Cms.Profile screen_profile;
            if (tag.Icon != null && FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) {
                icon_image.Pixbuf = tag.Icon.Copy ();
                FSpot.ColorManagement.ApplyProfile (icon_image.Pixbuf, screen_profile);
            } else
                icon_image.Pixbuf = tag.Icon;

            dialog.Destroy ();
        }