quick UI updates (center imageview, fix terminal cursor colors, and add firacode font) (#445)

* center imageview images

* fix terminal selection colors #442

* add firacode font
This commit is contained in:
Mike Sawka 2024-03-13 16:24:47 -07:00 committed by GitHub
parent d1baf504ba
commit fc0b82836c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 36 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@
:root {
/*
* term colors (16 + 5) form the base terminal theme
* term colors (16 + 6) form the base terminal theme
* for consistency these colors should be used by plugins/applications
*/
--term-black: #000000;
@ -27,5 +27,6 @@
--term-cmdtext: #ffffff;
--term-foreground: #d3d7cf;
--term-background: #000000;
--term-selection-background: #ffffff40;
--term-selection-background: #ffffff90;
--term-cursor-accent: #000000;
}

View File

@ -6,5 +6,6 @@
--term-foreground: #000000;
--term-background: #fefefe;
--term-cmdtext: #000000;
--term-selection-background: #00000018;
--term-selection-background: #00000040;
--term-cursor-accent: #000000;
}

View File

@ -87,6 +87,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
const availableFontFamilies: DropdownItem[] = [];
availableFontFamilies.push({ label: "JetBrains Mono", value: "JetBrains Mono" });
availableFontFamilies.push({ label: "Hack", value: "Hack" });
availableFontFamilies.push({ label: "Fira Code", value: "Fira Code" });
return availableFontFamilies;
}

View File

@ -1,4 +1,10 @@
.image-renderer {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: var(--termpad);
img {
display: block;
}

View File

@ -58,6 +58,9 @@ function getThemeFromCSSVars(): ITheme {
theme.brightCyan = rootStyle.getPropertyValue("--term-bright-cyan");
theme.brightWhite = rootStyle.getPropertyValue("--term-bright-white");
theme.selectionBackground = rootStyle.getPropertyValue("--term-selection-background");
theme.selectionInactiveBackground = rootStyle.getPropertyValue("--term-selection-background");
theme.cursor = rootStyle.getPropertyValue("--term-selection-background");
theme.cursorAccent = rootStyle.getPropertyValue("--term-cursor-accent");
return theme;
}

View File

@ -5,6 +5,7 @@ let isJetBrainsMonoLoaded = false;
let isLatoFontLoaded = false;
let isHackFontLoaded = false;
let isBaseFontsLoaded = false;
let isFiraCodeLoaded = false;
function addToFontFaceSet(fontFaceSet: FontFaceSet, fontFace: FontFace) {
// any cast to work around typing issue
@ -55,6 +56,25 @@ function loadLatoFont() {
latoFontBold.load();
}
function loadFiraCodeFont() {
if (isFiraCodeLoaded) {
return;
}
isFiraCodeLoaded = true;
let firaCodeRegular = new FontFace("Fira Code", "url('public/fonts/firacode-regular.woff2')", {
style: "normal",
weight: "400",
});
let firaCodeBold = new FontFace("Fira Code", "url('public/fonts/firacode-bold.woff2')", {
style: "normal",
weight: "700",
});
addToFontFaceSet(document.fonts, firaCodeRegular);
addToFontFaceSet(document.fonts, firaCodeBold);
firaCodeRegular.load();
firaCodeBold.load();
}
function loadHackFont() {
if (isHackFontLoaded) {
return;
@ -104,6 +124,7 @@ function loadFonts() {
loadLatoFont();
loadJetBrainsMonoFont();
loadHackFont();
loadFiraCodeFont();
}
export { loadFonts };