Change position of a TreeView to the Panel from ActivityBar - visual-studio-code

I'm fully able to move my TreeView from the SideBar to the bottom panel (Problems, output, terminal...).
However, I'm uncertain how I would go about making my TreeView appear in the bottom panel by default. The documentation doesn't state anything about the bottom panel.
Any ideas?

I see the panel as an option for the viewContainer as in:
"contributes": {
"viewsContainers": {
"panel" : [ // instead of activityBar here
{
"id": "your virewContainer id",
"title": "your title",
"icon": "$(....)"
}
]
}
}
Found by using intellisense.

Related

VSCode: Is there a way to hide top action menu bar?

In VSCode, is there a way to hide the top action menu bar that appears in the tabs row? I rarely use it and I find that it crowds the already limited space available to browse through open tabs. Moreover, its presentation is also inconsistent, especially when split panes are activated.
I'm not sure if I am referring to this VSCode functionality properly, so here's a screenshot demonstrating what I'm talking about (file names had to be blurred out due to NDA reasons):
Thank you.
Update 2022-09-28
An issue to address this feature has been completed and it will arrive with the next release. It is already available on the Insiders version.
This closed issue references another feature request different from the original one referenced on this answer.
Context
It is called editor actions and, within the standard/native VSCode settings, you cannot hide it.
A setting to hide this annoying bar is an open issue at VScode's GitHub since March 2018.
Fixes
Removing the whole bar
I feel your pain. This worked for me:
Install the Customize UI extension.
Open your user settings JSON:
cmd + shift + P / ctrl + shift + P
Add this setting:
"customizeUI.stylesheet": {
".editor-actions": "display: none !important;",
},
It is gone!
Removing specific icons, by position
The foremost left icon is the number 1.
Example in plain CSS:
.menu-item-action-item-icon-1,
.menu-item-action-item-icon-3 {
display: none !important;
}
Example using Customize UI extension:
"customizeUI.stylesheet": {
".menu-item-action-item-icon-1": "display: none !important;",
".menu-item-action-item-icon-3": "display: none !important;",
},
Removing just Gitlens icons
Gitlens icons can be hidden within Gitlens' settings:
"gitlens.menus": {
"editorGroup": {
"blame": false,
"compare": false
},
},
I came up with a slightly different approach: instead of hiding the buttons, move them down one level to the breadcrumb bar:
This is done using the Customize UI extension with the following configuration:
"customizeUI.stylesheet": {
".tabs-and-actions-container": {
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions": {
"position": "absolute",
"top": "100%",
"right": "0px",
"height": "22px !important",
"z-index": "1",
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions .action-item": {
"margin-right": "3px !important",
},
".tabs-and-actions-container .editor-actions .action-item a": {
"font-size": "13px",
},
".tabs-and-actions-container .editor-actions .action-item .codicon": {
"width": "13px",
"height": "13px",
},
".tabs-and-actions-container .tab:last-child": {
"margin-right": "0 !important",
},
".title.tabs.show-file-icons": {
"overflow": "unset !important",
},
}
This solution is theme-independent, so it should work for all colour combinations. The background color for the buttons is always the same as the background color of the tab bar. If you use only one static theme, you could hard-code the background-color for the .tabs-and-actions-container .editor-actions selector to the exact color of the breadcrumb bar for a more seamless design. However, this does not work when switching themes.
The only drawback to this solution is that the buttons overflow the rightmost breadcrumb information, but I'm fine with that. At least the tab bar does not resize anymore, while I still have those buttons.
Hi there 👋🏼 I removed the GitLens plugin and it disappeared
For anyone using Customize UI and not getting the icons to disappear after targeting ".editor-actions", I was able to get the action icons to disappear by selecting ".monaco-toolbar":
"customizeUI.stylesheet": {
".monaco-toolbar": "display: none !important"
}

Leaflet: Change popup behavior so that if popup is open, click outside popup will only close popup (not open new popup based on click location)?

Final Edit
My thinking on this experience was for a web app targeting mobile use. On mobile, users often expect that a tap will dismiss the item. The most similar standard web experience would be clicking outside of a model (on the translucent overlay) to dismiss the modal (sort of an implicit Escape Key). This approach would work well on my map because then I can hide the close button the popup and the user would probably try either clicking the popup itself, or clicking off it, and both would close the popup.
For example, see this video of my project: YouTube
By default, popups are dismissed when clicking the basemap. But when zooming into the playground and clicking a marker, the entire viewable area of the map has an active polygon overlay, so clicking off of the popup fires a new popup. For a mobile experience, I think it'd be better to have the options to just close the open popup (as if you were clicking on the basemap), and require another tap to open a new one.
Solution
My solution was to move all popups to a pane with z index 700, and then create another pane at z 699 for a transparent overlay. Then I used the popupopen and popupclose events to add and remove a transparent polygon from the map at z699 which effectively block clicks to any layers down below until the user closes the current popup.
map.getPane('popupPane').style.zIndex = 700;
map.createPane('hiddenOverlay').style.zIndex = 699;
let hiddenData = [{
"type": "Feature",
"properties": {
"name": "overlay",
"popupContent": "test"
},
"geometry": {
"type": "Polygon",
"coordinates": [[
[-121.728602, 37.691681],
[-121.724186, 37.691543],
[-121.723973, 37.689516],
[-121.728260, 37.689467]]]
}
}];
let transparentStyle = {
color: "#ff0b00",
weight: 5,
fillOpacity: 0,
opacity: 0
};
let hiddenLayer = L.geoJSON(hiddenData, {
pane: 'hiddenOverlay',
style: transparentStyle
});
map.on('popupopen', function(e){
map.addLayer(hiddenLayer);
});
map.on('popupclose', function(e){
map.removeLayer(hiddenLayer);
});

facebook messaging templates - text and background color

is there any option to set color of background or text in list messaging template. I have this element in payload:
{
"title":"priority #2: and this is clickable title",
"subtitle":"And here’s some text, makes no sense, but I need it here",
"default_action": {
"type": "web_url",
"url": "http://google.com",
"messenger_extensions": false,
"webview_height_ratio": "tall"
}
}
but unfortunely I wasn't able to find in docs the info how to set these colors. Maybe somebody have already done this, and could tell me what I have to add.
Nope, background and text color is not supported.

How do I change color of comments in visual studio code?

I went through https://code.visualstudio.com/docs/getstarted/theme-color-reference but can't seem to find the setting for changing the comment color.
I am currently using Atom One Dark Theme and just like to lighten the color a little bit so I can read it better.
From 1.15 (July 2017) you can change it from settings.json Ctrl+,
"editor.tokenColorCustomizations": {
"comments": "#d4922f"
},
From 1.20 (January 2018) you can also do it for each theme separately:
"editor.tokenColorCustomizations": {
"[Atom One Dark]": {
"comments": "#d4922f"
}
},
Or now you can specify settings for multiple themes at once as "[Atom One Dark][Tomorrow Night Blue]": {...}
Finding the right scope:
Developer: Inspect TM Scopes editor.action.inspectTMScopes
Selector priority:
https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_textmate-themes
Ok, more examples (for js):
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "INSERT_SCOPE_HERE",
"settings": {
"foreground": "#ff0000"
}
}]
}
comment
punctuation.definition.comment
comment.block.documentation
storage.type.class.jsdoc
entity.name.type.instance.jsdoc
variable.other.jsdoc
1.Go to your settings.
2.Type “editor.tokenColorCustomizations” into the search bar then click on “Edit in settings.json”:
3.By default, “editor.tokenColorCustomizations” is set to “null”. To customize the comment color, you can add:
{ "comments": "[color code]" }
You can type something like this:
> "editor.tokenColorCustomizations": {
> "comments": "#e45e91" },
4.Change the color of comments,based on your liking by hovering over the color and choosing your desired color.
5.Then save the changes.(Ctrl+S)
6.Exit the program. open it again, you will see the changes.
To expand on the answer and #Johnny Derp's comment. You can change the font color and style using:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic",
"foreground": "#C69650",
}
}
]
},
background cannot be changed in this way, only the color and style. As of June, 2018.
Also in answer to a couple of comments about changing comments puntuation (like the //) colors - which now have to be separately colored with their own textmate rule, a change may be coming to fix that in the October 2019 release - at this point it is an unresolved issue but added to the October 2019 milestone. See https://github.com/microsoft/vscode/milestone/102
In VS Code: 1.56.2
Add to settings.json:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block.documentation",
"comment.block.documentation.js",
"comment.line.double-slash.js",
"storage.type.class.jsdoc",
"entity.name.type.instance.jsdoc",
"variable.other.jsdoc",
"punctuation.definition.comment",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"fontStyle": "italic",
"foreground": "#287a1d"
}
}
]
}
If there is still stoff missing: CTRL+SHIFT+P => Developer: Inspect Editor Tokens and Scopes hover over the parts that are not colored correctly and add them to "scope".
There you are. :)
Looks like the token colors cannot be customized within the settings at the moment:
The most prominent editor colors are the token colors that are based
on the language grammar installed. These colors are defined by the
Color Theme and can (currently) not be customized in the settings.
Source: https://code.visualstudio.com/docs/getstarted/theme-color-reference
I did notice that if you go into the theme folders, for example:
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-monokai
and edit the monokai-color-theme.json file, look for the line with "name": "Comment" and change the "foreground" color it will work. Just make sure to restart the program.
Like Mark said, but add in the "scope": after "comment"
"punctuation.definition.comment"
to color also the punctuation,
e.g. (// in javescript | /* */ in css | <!-- --> in html).
"scope": ["comment", "punctuation.definition.comment"]
While commenting on comment subject, I found "Better Comments" extension of VS Code very useful. You can give various colors ‎to your comments and hence categorize your comments based on importance etc. ‎
Default comments color can also be changed.‎
https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
Example:‎
This extension can be configured in User Settings or Workspace settings.‎
Doc, Block, and Line settings
To have differnet colors for Doc, Block, and Line comments:
I.e. for the Cobalt2 theme:
"editor.tokenColorCustomizations": {
"[Cobalt2]": {
"textMateRules": [
{
"scope": [
"comment.block",
"punctuation.definition.comment.end",
"punctuation.definition.comment.begin"
],
"settings": {
"foreground": "#85b3f8",
"fontStyle": "bold"
}
},
{
"scope": [
"comment.block.documentation",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"foreground": "#6bddb7",
"fontStyle": "bold"
}
},{
"scope":["comment.line", "punctuation.definition.comment"],
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold"
}
}
]
}
}
Tested with C++.
You can modify your VS code by simply edit your setting file in VS code and follow these 3 steps.
step1:
step2:
Step3:
To change VS Code comment color
File --> Preferences --> Settings
Choose the "Workspace Settings" tab to only change it for this project
Choose the "User Settings" tab to change it for all projects
Do a search for "settings.json" and look for an option to "Edit in settings.json"
Insert this color setting for the comments somewhere inside the curly brackets:
"editor.tokenColorCustomizations": {
"comments": "#ff4"
}
It might complain that you are overriding your current color theme, just ignore that.
If there is already a section for "editor.tokenColorCustomizations" then just add the line to specify the comment color.

Kendo Grid in MVVM and translating or customizing command buttons

This is my MVVM Code and I have troubles customizing the text of Update/Cancel command buttons.
I have customized Edit/Delete buttons but what about the command buttons that are hidden for now and will be visible when I click on Edit button?
Please help me customizing such commands. How can I do that?
<div id="grid" data-role="grid" data-sortable="true" data-editable="inline" data-Scrollable="true"
data-toolbar='[{name:"create", text:"新しいドメインの追加"}]'
data-pageable="true" data-columns='[{field: "Domain", title: "ドメイン", width: 250, filterable: false, sortable: false},
{"command": [{name:"destroy",text:"削除"},
{name:"edit",text:"編集"}]}]'
data-bind="source: dataSource, events: { edit: edit, dataBound: dataBound }"></div>
Answering this question would help a lot of people who want to customize or translate Update Command or Cancel Command as well as Edit Command or Destroy Command.
If you want to customize the buttons update,cancel,delete,add,edit just do this
{
command : [{
name : "edit",
text : {// sets the text of the "Edit", "Update" and "Cancel" buttons
edit : "CustomEdit",
update : "CustomUpdate",
cancel : "CustomCancel"
},
}, {
name : "destroy",
text : "Destroy"
} // sets the text of the "Delete" button
]
Here is a fiddle
For localizing Update and Cancel buttons when you update on popup mode, you need to define the command as:
command: [
{
name: "edit",
text: { edit: "Edita", update: "Actualiza", cancel: "Cancela"}
},
{
name : "destroy",
text : "Borra"
}
],
EDIT: If you also want to change the title of the popup window, then you should add window.title to editable in the grid definition:
editable : {
mode : "popup",
window : {
title: "Edición",
}
},
If you want to take a look into an example: JSFiddle