Eugene Pankov 7 лет назад
Родитель
Сommit
a98f2ce12d

+ 1 - 1
terminus-core/package.json

@@ -22,7 +22,7 @@
     "@types/webpack-env": "^1.13.0",
     "@types/winston": "^2.3.6",
     "axios": "0.16.2",
-    "bootstrap": "4.0.0-alpha.6",
+    "bootstrap": "^4.1.3",
     "core-js": "^2.4.1",
     "electron-updater": "^2.8.9",
     "ng2-dnd": "^5.0.2",

+ 1 - 0
terminus-core/src/api/index.ts

@@ -10,6 +10,7 @@ export { ConfigService } from '../services/config.service'
 export { DockingService } from '../services/docking.service'
 export { ElectronService } from '../services/electron.service'
 export { Logger, LogService } from '../services/log.service'
+export { HomeBaseService } from '../services/homeBase.service'
 export { HotkeysService } from '../services/hotkeys.service'
 export { HostAppService, Platform } from '../services/hostApp.service'
 export { ThemesService } from '../services/themes.service'

+ 7 - 8
terminus-core/src/components/startPage.component.pug

@@ -4,21 +4,20 @@ div
         sup α 
 
     .list-group
-        a.list-group-item.list-group-item-action(
+        a.list-group-item.list-group-item-action.d-flex(
             *ngFor='let button of getButtons()',
             (click)='button.click()',
         )
             .d-flex.align-self-center([innerHTML]='button.icon')
             span {{button.title}}
 
-footer
-    .pull-right
-        .form-control-static Version: {{version}}
-            
-    .btn-group
-        button.btn.btn-secondary((click)='openGitHub()')
+footer.d-flex.align-items-center
+    .btn-group.mr-auto
+        button.btn.btn-secondary((click)='homeBase.openGitHub()')
             i.fa.fa-github
             span GitHub
-        button.btn.btn-secondary((click)='reportBug()')
+        button.btn.btn-secondary((click)='homeBase.reportBug()')
             i.fa.fa-bug
             span Report a problem
+
+    .form-control-static Version: {{homeBase.appVersion}}

+ 1 - 0
terminus-core/src/components/startPage.component.scss

@@ -3,6 +3,7 @@
     flex-direction: column;
     flex: auto;
     -webkit-app-region: drag;
+    overflow-y: auto;
 }
 
 :host > div {

+ 2 - 19
terminus-core/src/components/startPage.component.ts

@@ -1,7 +1,6 @@
-import * as os from 'os'
 import { Component, Inject } from '@angular/core'
-import { ElectronService } from '../services/electron.service'
 import { ConfigService } from '../services/config.service'
+import { HomeBaseService } from '../services/homeBase.service'
 import { IToolbarButton, ToolbarButtonProvider } from '../api'
 
 @Component({
@@ -13,11 +12,10 @@ export class StartPageComponent {
     version: string
 
     constructor (
-        private electron: ElectronService,
         private config: ConfigService,
+        private homeBase: HomeBaseService,
         @Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
     ) {
-        this.version = electron.app.getVersion()
     }
 
     getButtons (): IToolbarButton[] {
@@ -26,19 +24,4 @@ export class StartPageComponent {
             .reduce((a, b) => a.concat(b))
             .sort((a: IToolbarButton, b: IToolbarButton) => (a.weight || 0) - (b.weight || 0))
     }
-
-    openGitHub () {
-        this.electron.shell.openExternal('https://github.com/eugeny/terminus')
-    }
-
-    reportBug () {
-        let body = `Version: ${this.version}\n`
-        body += `Platform: ${os.platform()} ${os.release()}\n\n`
-        let label = {
-            darwin: 'macOS',
-            windows: 'Windows',
-            linux: 'Linux',
-        }[os.platform()]
-        this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
-    }
 }

+ 2 - 0
terminus-core/src/index.ts

@@ -11,6 +11,7 @@ import { ConfigService } from './services/config.service'
 import { ElectronService } from './services/electron.service'
 import { HostAppService } from './services/hostApp.service'
 import { LogService } from './services/log.service'
+import { HomeBaseService } from './services/homeBase.service'
 import { HotkeysService, AppHotkeyProvider } from './services/hotkeys.service'
 import { DockingService } from './services/docking.service'
 import { TabRecoveryService } from './services/tabRecovery.service'
@@ -44,6 +45,7 @@ const PROVIDERS = [
     ConfigService,
     DockingService,
     ElectronService,
+    HomeBaseService,
     HostAppService,
     HotkeysService,
     LogService,

+ 29 - 0
terminus-core/src/services/homeBase.service.ts

@@ -0,0 +1,29 @@
+import * as os from 'os'
+import { Inject, Injectable } from '@angular/core'
+import { ElectronService } from './electron.service'
+
+@Injectable()
+export class HomeBaseService {
+    appVersion: string
+
+    constructor (
+        private electron: ElectronService,
+    ) {
+        this.appVersion = electron.app.getVersion()
+    }
+
+    openGitHub () {
+        this.electron.shell.openExternal('https://github.com/eugeny/terminus')
+    }
+
+    reportBug () {
+        let body = `Version: ${this.appVersion}\n`
+        body += `Platform: ${os.platform()} ${os.release()}\n\n`
+        let label = {
+            darwin: 'macOS',
+            windows: 'Windows',
+            linux: 'Linux',
+        }[os.platform()]
+        this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
+    }
+}

+ 6 - 1
terminus-core/src/theme.scss

@@ -14,13 +14,17 @@ $teal:   #5bc0de !default;
 $pink:   #ff5b77 !default;
 $purple: #613d7c !default;
 
+$theme-colors: (
+    "primary":    $blue,
+    "secondary": #394b5d
+);
 
 $content-bg: rgba(39, 49, 60, 0.65); //#1D272D;
 $content-bg-solid: #1D272D;
 $body-bg: #131d27;
 $body-bg2: #20333e;
 
-$body-color: #aaa;
+$body-color: #ccc;
 $font-family-sans-serif: "Source Sans Pro";
 $font-size-base: 14rem / 16;
 
@@ -39,6 +43,7 @@ $nav-tabs-link-hover-border-color:            $body-bg;
 $nav-tabs-active-link-hover-color:            $white;
 $nav-tabs-active-link-hover-bg:               $blue;
 $nav-tabs-active-link-hover-border-color:     darken($blue, 30%);
+$nav-pills-border-radius:  0;
 
 $input-bg:                       #111;
 $input-bg-disabled:              #333;

+ 3 - 14
terminus-core/yarn.lock

@@ -47,12 +47,9 @@ bluebird@^3.5.0:
   version "3.5.0"
   resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c"
 
[email protected]:
-  version "4.0.0-alpha.6"
-  resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.0.0-alpha.6.tgz#4f54dd33ac0deac3b28407bc2df7ec608869c9c8"
-  dependencies:
-    jquery ">=1.9.1"
-    tether "^1.4.0"
+bootstrap@^4.1.3:
+  version "4.1.3"
+  resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be"
 
 [email protected]:
   version "1.0.3"
@@ -152,10 +149,6 @@ [email protected]:
   version "0.1.2"
   resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
 
-jquery@>=1.9.1:
-  version "3.2.1"
-  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
-
 js-yaml@^3.9.0, js-yaml@^3.9.1:
   version "3.9.1"
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0"
@@ -230,10 +223,6 @@ [email protected]:
   version "0.0.10"
   resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
 
-tether@^1.4.0:
-  version "1.4.0"
-  resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a"
-
 universalify@^0.1.0:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"

+ 9 - 8
terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug

@@ -19,7 +19,7 @@ h3 Installed
                 .d-flex.flex-column.align-items-end.mr-3
                     div {{plugin.version}}
                     small.text-muted {{plugin.author}}
-                button.btn.btn-outline-primary(
+                button.btn.btn-secondary.ml-2(
                     *ngIf='npmInstalled && knownUpgrades[plugin.name]',
                     (click)='upgradePlugin(plugin)',
                     [disabled]='busy[plugin.name] != undefined'
@@ -27,19 +27,19 @@ h3 Installed
                     i.fa.fa-fw.fa-arrow-up(*ngIf='busy[plugin.name] != BusyState.Installing')
                     i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='busy[plugin.name] == BusyState.Installing')
                     span Upgrade ({{knownUpgrades[plugin.name].version}})
-                button.btn.btn-outline-danger(
+                button.btn.btn-secondary.ml-2(
                     (click)='uninstallPlugin(plugin)', 
                     *ngIf='!plugin.isBuiltin && npmInstalled',
                     [disabled]='busy[plugin.name] != undefined'
                 )
                     i.fa.fa-fw.fa-trash-o(*ngIf='busy[plugin.name] != BusyState.Uninstalling')
                     i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='busy[plugin.name] == BusyState.Uninstalling')
-                button.btn.btn-outline-danger(
+                button.btn.btn-secondary.ml-2(
                     *ngIf='config.store.pluginBlacklist.includes(plugin.name)',
                     (click)='enablePlugin(plugin)'
                 )
                     i.fa.fa-fw.fa-play
-                button.btn.btn-outline-primary(
+                button.btn.btn-secondary.ml-2(
                     *ngIf='!config.store.pluginBlacklist.includes(plugin.name)',
                     (click)='disablePlugin(plugin)'
                 )
@@ -60,9 +60,10 @@ div(*ngIf='npmInstalled')
     h3.mt-4 Available
 
     .input-group.mb-4
-        .input-group-addon
-            i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='!availablePluginsReady')
-            i.fa.fa-fw.fa-search(*ngIf='availablePluginsReady')
+        .input-group-prepend
+            .input-group-text
+                i.fa.fa-fw.fa-circle-o-notch.fa-spin(*ngIf='!availablePluginsReady')
+                i.fa.fa-fw.fa-search(*ngIf='availablePluginsReady')
         input.form-control(
             type='text',
             '[(ngModel)]'='_1',
@@ -83,7 +84,7 @@ div(*ngIf='npmInstalled')
                         div {{plugin.version}}
                         small.text-muted {{plugin.author}}
                             i.fa.fa-check.text-success.ml-1(*ngIf='plugin.isOfficial', title='Official')
-                    button.btn.btn-outline-primary(
+                    button.btn.btn-primary(
                         (click)='installPlugin(plugin)',
                         [disabled]='busy[plugin.name] != undefined'
                     )

+ 24 - 3
terminus-settings/src/components/settingsTab.component.pug

@@ -1,11 +1,26 @@
 button.btn.btn-outline-warning.btn-block(*ngIf='config.restartRequested', '(click)'='restartApp()') Restart the app to apply changes
 
-ngb-tabset.vertical(type='tabs', [activeId]='activeTab')
+ngb-tabset.vertical(type='pills', [activeId]='activeTab')
     ngb-tab(id='application')
         ng-template(ngbTabTitle)
             | Application
         ng-template(ngbTabContent)
-            h3.mb-3 Application
+            .d-flex.align-items-center.mb-4
+                h1.terminus-title.mb-2.mr-2 Terminus
+                    sup α 
+                
+                .text-muted.mr-auto {{homeBase.appVersion}}
+                            
+                button.btn.btn-secondary.mr-3((click)='homeBase.openGitHub()')
+                    i.fa.fa-github
+                    span GitHub
+                    
+                button.btn.btn-secondary((click)='homeBase.reportBug()')
+                    i.fa.fa-bug
+                    span Report a problem
+
+
+
             .form-line
                 .header
                     .title Theme
@@ -211,7 +226,13 @@ ngb-tabset.vertical(type='tabs', [activeId]='activeTab')
             | Hotkeys
         ng-template(ngbTabContent)
             h3.mb-3 Hotkeys
-            input.form-control(type='search', placeholder='Search hotkeys', [(ngModel)]='hotkeyFilter')
+            
+            .input-group.mb-4
+                .input-group-prepend
+                    .input-group-text
+                        i.fa.fa-fw.fa-search
+                input.form-control(type='search', placeholder='Search hotkeys', [(ngModel)]='hotkeyFilter')
+                            
             .form-group
                 table.hotkeys-table
                     tr

+ 2 - 1
terminus-settings/src/components/settingsTab.component.ts

@@ -1,5 +1,5 @@
 import { Component, Inject, Input } from '@angular/core'
-import { ElectronService, DockingService, ConfigService, IHotkeyDescription, HotkeyProvider, BaseTabComponent, Theme, HostAppService, Platform } from 'terminus-core'
+import { ElectronService, DockingService, ConfigService, IHotkeyDescription, HotkeyProvider, BaseTabComponent, Theme, HostAppService, Platform, HomeBaseService } from 'terminus-core'
 
 import { SettingsTabProvider } from '../api'
 
@@ -23,6 +23,7 @@ export class SettingsTabComponent extends BaseTabComponent {
         private electron: ElectronService,
         public docking: DockingService,
         public hostApp: HostAppService,
+        public homeBase: HomeBaseService,
         @Inject(HotkeyProvider) hotkeyProviders: HotkeyProvider[],
         @Inject(SettingsTabProvider) public settingsProviders: SettingsTabProvider[],
         @Inject(Theme) public themes: Theme[],

+ 3 - 3
terminus-terminal/src/components/terminalSettingsTab.component.pug

@@ -17,14 +17,14 @@ h3.mb-3 Appearance
             .header
                 .title Font
 
-            .d-flex.w-50
-                input.form-control(
+            .d-flex.w-75
+                input.form-control.w-75(
                     type='text',
                     [ngbTypeahead]='fontAutocomplete',
                     [(ngModel)]='config.store.terminal.font',
                     (ngModelChange)='config.save()',
                 )
-                input.form-control(
+                input.form-control.w-25(
                     type='number',
                     [(ngModel)]='config.store.terminal.fontSize',
                     (ngModelChange)='config.save()',