Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Icon refactoring #3956

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Icon refactoring #3956

wants to merge 4 commits into from

Conversation

vancura
Copy link
Contributor

@vancura vancura commented Feb 26, 2018

We have a huge chaos in file and folder icons. I am trying to clean it up here.

As a part of https://github.com/xamarin/icons/issues/194 I cleaned up our special folder references. Results: md-component-folder-* and md-folder-assets are unused. I'll have more icons to use soon, so we'll work on references afterward.

Please don't merge, this is WIP.

@vancura vancura self-assigned this Feb 26, 2018
@vancura vancura requested a review from sevoku February 26, 2018 13:15
@@ -42,9 +41,6 @@ public class Stock
public static readonly IconId CloseAllDocuments = "md-close-all-documents";
public static readonly IconId CloseCombine = "md-close-combine-icon";
public static readonly IconId CloseIcon = Gtk.Stock.Close;
public static readonly IconId ClosedFolder = "md-closed-folder";
public static readonly IconId ClosedReferenceFolder = "md-closed-reference-folder";
public static readonly IconId ClosedResourceFolder = "md-closed-resource-folder";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public API break. I think we need to keep the old names otherwise this will break any third party addins that use these Stock icons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrward See the last commit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vancura vancura requested review from slluis, mrward and Therzok February 26, 2018 14:28
@vancura
Copy link
Contributor Author

vancura commented Feb 26, 2018

Could you please review this PR? I'd like to know if this is fine before I do the same thing in md-addins. Thanks!

<StockIcon stockid="md-services-folder" resource="folder-services-16.png" size="Menu" />

<!-- File icons -->
<StockIcon stockid="md-generic-file" resource="file-generic-16.png" size="Menu" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the pattern (md-file-* -> md-*-file) change? Imo we should use the same pattern like we have for other categories (md-prefs-*, md-file-* etc.). Also the Stock IDs belong to the public API too, kind of. AddIns can reference and use them directly (instead of Gui.Stock). I remember that we changed some id's before and it was really hard for AddIn devs to track that, since we don't expose ALL icons throught Gui.Stock. @slluis?

Copy link
Contributor Author

@vancura vancura Feb 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I can use md-folder-* and md-file-*. The reason why I did it was that there's a huge chaos in IDs. Take a look: sometimes they're reversed, sometimes there's an -icon suffix. A mess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong, but I really think we should clean up these IDs if we want to have more extensions in the marketplace. There should be a clear pattern, or it will look like they're glued together from different sources (which they in fact are). We might break some APIs today, but if we design a pattern now, it will pay off later in the longer run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against cleaning them up, I'm just for a unified pattern and for not breaking AddIns that use the IDs directly. And we should definitely remove the -icon suffix everywhere. If we don't care about the IDs to be changed without an API bump, then it's ok, otherwise we should sync it with the next API bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @slluis agrees to rename icon IDs, I'd make sure we have same pattern for all names. Plus I'd document it so it's super-clear.

Copy link
Member

@slluis slluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't remove existing icon ids, as this could break existing extensions. Before doing such a change, I'd like to have a document in the monodevelop wiki that explains what's the icon naming policy.

public static readonly IconId ServicesFolder = "md-services-folder";

// Deprecated folder icons
public static readonly IconId ClosedFolder = "md-folder";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: To make this easier in the future, in case we do other renames, I'd say the pattern should be:

public static readonly IconId Folder = "md-folder";
public static readonly IconId ReferenceFolder = "md-reference-folder";

...

public static readonly IconId ClosedFolder = Folder;
public static readonly IconId OpenFolder = Folder;
public static readonly IconId ClosedReferenceFolder = ReferenceFolder;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Sure, thanks!

Base automatically changed from master to main March 9, 2021 14:17
@akoeplinger akoeplinger changed the base branch from main to master March 15, 2021 17:02
Base automatically changed from master to main March 15, 2021 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants