查看带有单个标题的容器

发布于 2025-02-11 09:48:52 字数 250 浏览 0 评论 0 原文

我有一个位于视图容器中的奇异视图,我希望有一个标题包含它们。例如,此视图的默认位置在面板中,但是当移动到另一个视图容器中的活动栏时,标题显示为[视图容器标题]:[view title]。虽然这很有意义,但最好将我的视图显示为[视图或视图容器标题],而没有结肠期望第二部分。 VSCODE标准视图(例如问题,输出,调试控制台)展示了通缉行为。当放置在另一个容器中时,它们只是显示为“输出”或“问题”,而不是诸如“面板:输出”之类的东西。是否可以拥有一个没有结肠/第二部分的单个标题?谢谢。

I have a singular view residing in a view container, and I wish to have one title encompassing them. For instance, this view's default position is in the panel, but when moved to the activity bar in another view container, the title is displayed as [view container title]:[view title]. While this makes sense, it would be nice to display my view as [view or view container title], without a colon expecting a second part. The VSCode standard views like Problems, Output, Debug Console exhibit the wanted behavior. They just display as "Output" or "Problems" when placed in another container, rather than something like "Panel:Output". Is it possible to have a single title with no colon/second part? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请恋爱 2025-02-18 09:48:52

您可以尝试使用视图的 contextualtitle 属性。根据发布时的文档,它应该满足您的需求:

用于扩展作者,贡献视​​图或查看容器

当围绕工作台周围移动视图时,如果它们不在默认位置,则有时需要以图标或额外的上下文来不同。当贡献观点时,作者现在可以提供图标属性和上下文属性。如果未提供,这些将默认为构造其贡献的视图容器的图标和标题。

从那时起,我不确定他们是否更新了API或更新了行为,但是,如果没有,您可能会在尝试使用它时遇到的相同问题。我什至为VS代码团队打开了问题( https://githbithub.com/microsoft/microsoft/vscscode /eskoes/102447 ),但他们将问题标记为设计,我放弃了使用它。

希望这会有所帮助

You may try to use the contextualTitle property of the view. Based on its documentation when launched, it should fit your needs:

https://code.visualstudio.com/updates/v1_46#_flexible-layout

For extension authors contributing views or view containers

When views are moved around the workbench, they sometimes need to be presented differently, either with an icon or extra context if they aren't in their default location. When contributing a view, authors may now provide an icon property and a contextualTitle. If not provided, these will default to the icon and title of the view container to which they are contributed.

I'm not sure they updated the API or updated the behavior since then but, if not, you will probably face the same issue I had while trying to use it. I even opened an issue to the VS Code team (https://github.com/microsoft/vscode/issues/102447), but they marked the issue as designed and I gave up on using it.

Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文