SVG icons

This commit is contained in:
Eugene Pankov
2018-08-09 15:13:31 +02:00
parent deca9a20b4
commit e0e24878e2
19 changed files with 114 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import * as fs from 'mz/fs'
import * as path from 'path'
import { first } from 'rxjs/operators'
import { Injectable } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'
import { HotkeysService, ToolbarButtonProvider, IToolbarButton, ConfigService, HostAppService, ElectronService } from 'terminus-core'
import { TerminalService } from './services/terminal.service'
@@ -10,6 +11,7 @@ import { TerminalService } from './services/terminal.service'
export class ButtonProvider extends ToolbarButtonProvider {
constructor (
private terminal: TerminalService,
private domSanitizer: DomSanitizer,
private config: ConfigService,
hostApp: HostAppService,
electron: ElectronService,
@@ -51,7 +53,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
provide (): IToolbarButton[] {
return [{
icon: 'plus',
icon: this.domSanitizer.bypassSecurityTrustHtml(require('./icons/plus.svg')),
title: 'New terminal',
touchBarTitle: 'New',
click: async () => {

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M368 224H224V80c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v144H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h144v144c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V288h144c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"/></svg>

After

Width:  |  Height:  |  Size: 303 B

View File

@@ -36,6 +36,7 @@ module.exports = {
{ test: /\.pug$/, use: ['apply-loader', 'pug-loader'] },
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['to-string-loader', 'css-loader'] },
{ test: /\.svg/, use: ['svg-inline-loader'] },
{
test: /\.(ttf|eot|otf|woff|woff2|ogg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: {