Skip to content

Commit

Permalink
added minimum contrast ratio setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 4, 2022
1 parent 96b3a40 commit 1171330
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 12 additions & 0 deletions tabby-terminal/src/components/appearanceSettingsTab.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,18 @@ h3.mb-3(translate) Appearance
(ngModelChange)='config.save()',
)

.form-line
.header
.title(translate) Minimum contrast ratio
input.form-control(
type='number',
min='1',
max='21',
step='0.5',
[(ngModel)]='config.store.terminal.minimumContrastRatio',
(ngModelChange)='config.save()'
)

.form-line
.header
.title(translate) Fallback font
Expand Down
1 change: 1 addition & 0 deletions tabby-terminal/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class TerminalConfigProvider extends ConfigProvider {
scrollbackLines: 25000,
drawBoldTextInBrightColors: true,
sixel: true,
minimumContrastRatio: 4,
},
}

Expand Down
15 changes: 0 additions & 15 deletions tabby-terminal/src/frontends/xterm.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,3 @@
right: 1px;
pointer-events: none;
}

.xterm-find-result-decoration {
box-sizing: content-box;

border-radius: 3px;
padding: 2px;
margin: -2px;
outline: 2px solid yellow;
backdrop-filter: contrast(2);
}

.xterm-find-active-result-decoration {
backdrop-filter: contrast(4);
outline-width: 2px !important;
}
8 changes: 5 additions & 3 deletions tabby-terminal/src/frontends/xtermFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ export class XTermFrontend extends Frontend {
this.xterm.options.drawBoldTextInBrightColors = config.terminal.drawBoldTextInBrightColors
this.xterm.options.fontWeight = config.terminal.fontWeight
this.xterm.options.fontWeightBold = config.terminal.fontWeightBold
this.xterm.options.minimumContrastRatio = config.terminal.minimumContrastRatio
this.configuredFontSize = config.terminal.fontSize
this.configuredLinePadding = config.terminal.linePadding
this.setFontSize()
Expand Down Expand Up @@ -417,11 +418,12 @@ export class XTermFrontend extends Frontend {
return {
...searchOptions,
decorations: {
matchOverviewRuler: '#cccc00',
matchOverviewRuler: '#888',
activeMatchColorOverviewRuler: '#ffff00',
matchBorder: '#cc0',
matchBorder: '#888',
matchBackground: '#888',
activeMatchBorder: '#ff0',
activeMatchBackground: 'rgba(255, 255, 0, 0.125)',
activeMatchBackground: '#ff0',
},
}
}
Expand Down

0 comments on commit 1171330

Please sign in to comment.