Skip to content

Add url-lnks support for pinned apps containers #71

Description

@supchyan

Now lolibar has this code:

foreach (FolderItem item in UserPinnedFolder.Items())
{
    if (item.IsLink)
    {
        ShellLinkObject lnk = (ShellLinkObject)item.GetLink;
        // Skip URL type shortcuts, which don't end up with .exe, like P5R: steam://rungameid/1687950
        if (lnk.Path.EndsWith(".exe"))
        {
            _UserPinned.Add(lnk, item.Name);
        }
    }
}

It skips url lnks, cause logic after (AddPinnedAppsToContainer method) can't handle them properly. I think there should be another if statement for item.IsBrowsable check, which should be what I think is. In that case, UserPinned dict will be class with 3 parameters instead of dict<ShellLinkObject, string> and then it will be properly handled in drawing logic. Also, for drawing logic InitializedApps dict should be converted into the class as well, since there are many properties inside to operate with, so store it in dict = bad code.

This change probably need to improve the vision of AddPinnedAppsToContainer() method as well, since in LolibarMod it looks junky:

var AppsContainer = new LolibarContainer()
{
    Parent = Lolibar.BarLeftContainer,
};
AppsContainer.Create();

LolibarProcess.AddPinnedAppsToContainer
(
    parent: AppsContainer.GetBody(),
    appContainerTitleState: LolibarEnums.AppContainerTitleState.OnlyActive,
    appTitleMaxLength:      24
);

I want something like:

var AppsContainer = new LolibarContainer()
{
    Parent = Lolibar.BarLeftContainer,
};
AppsContainer.Create();

// This a new trick here
AppsContainer.HandlePinnedApps(LolibarEnums.AppContainerTitleState.OnlyActive, 24);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions