Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add activityBar.itemMargin configuration #61

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ define(['exports', 'apc/auxiliary'], function (exports, auxiliary) {

ACTIVITY_BAR_SIZE: 48,
get activityBar() {
const { size, itemSize, position, hideSettings } = this.getConfiguration('apc.activityBar') || {};
const { size, itemSize, itemMargin, position, hideSettings } = this.getConfiguration('apc.activityBar') || {};
const isHorizontal = !!position;
return {
position,
Expand All @@ -120,6 +120,7 @@ define(['exports', 'apc/auxiliary'], function (exports, auxiliary) {
orientation: isHorizontal ? store.ActionsOrientation.HORIZONTAL : store.ActionsOrientation.VERTICAL,
size: (size ?? this.ACTIVITY_BAR_SIZE) * this.zoomFactor,
itemSize: (itemSize ?? size ?? this.ACTIVITY_BAR_SIZE) * this.zoomFactor,
itemMargin: (itemMargin ?? 3) * this.zoomFactor,
isEnabled: !!size
};
},
Expand Down
2 changes: 1 addition & 1 deletion modules/layout.activitybar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define(
const options = store.activityBarCompositeBar.activityBarOptions;
const size = config.activityBar.itemSize;
options.overflowActionSize = size;
options.compositeSize = size + 3; // 3 margine
options.compositeSize = size + config.activityBar.itemMargin;
store.activityBarCompositeBar.recomputeSizes();

store.activitybarPartView.layout();
Expand Down
4 changes: 2 additions & 2 deletions modules/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ div.monaco-workbench {
}

.custom-activitybar:not(.horizontal-activitybar) div.monaco-workbench div.activitybar>div.content div.monaco-action-bar ul.actions-container li.action-item {
margin-top: 3px;
margin-top: var(--activity-bar-action-item-margin);
}

.horizontal-activitybar div.monaco-workbench div.activitybar>div.content div.monaco-action-bar ul.actions-container li.action-item {
margin-left: 3px;
margin-left: var(--activity-bar-action-item-margin);
}

.inline-title-bar:not(.horizontal-activitybar) .monaco-workbench:not(.fullscreen) .activitybar:not(.right) .content {
Expand Down
1 change: 1 addition & 0 deletions modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ define(['exports', 'apc/auxiliary', 'apc/configuration'], (exports, auxiliary, c
--titlebar-font-size: ${sidebarTitlebarConfig.fontSize}px;
--activity-bar-action-size: ${activityBarConfig.size}px;
--activity-bar-action-item-size: ${activityBarConfig.itemSize}px;
--activity-bar-action-item-margin: ${activityBarConfig.itemMargin}px;
--status-bar-font-size: ${statusBarConfig.fontSize}px;
--traffic-X: ${trafficLightPosition.x}px;
--custom-font-family: '${customFontFamily}';
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
"type": "number",
"description": "Works only if apc.activityBar.size is specified, default apc.activityBar.size"
},
"itemMargin": {
"type": "number",
"default": 3
},
"position": {
"type": "string",
"enum": [
Expand Down