From f3d165d3f10b57640496995c8883f38ccd58ab68 Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 2 Jun 2020 19:13:57 +0200 Subject: [PATCH] Titlebar and resizable explorebar --- package.json | 1 + src/main/index.js | 4 +- src/main/ipc-handlers/connection.js | 1 - src/main/models/InformationSchema.js | 3 +- src/renderer/App.vue | 42 +++--- .../components/DatabaseExploreBar.vue | 128 ++++++++++++----- src/renderer/components/DatabaseWorkspace.vue | 9 +- src/renderer/components/ModalSettings.vue | 7 +- .../components/TheNotificationsBoard.vue | 2 +- src/renderer/components/TheSettingBar.vue | 2 +- src/renderer/components/TheTitleBar.vue | 133 ++++++++++++++++++ src/renderer/i18n/en-US.js | 3 +- src/renderer/i18n/it-IT.js | 3 +- src/renderer/scss/_variables.scss | 4 +- src/renderer/store/modules/settings.store.js | 12 +- 15 files changed, 286 insertions(+), 68 deletions(-) create mode 100644 src/renderer/components/TheTitleBar.vue diff --git a/package.json b/package.json index ef4b92b1..f5c6443b 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "electron-log": "^4.2.0", "electron-updater": "^4.3.1", "knex": "^0.21.1", + "lodash": "^4.17.15", "material-design-icons": "^3.0.1", "mssql": "^6.2.0", "mysql": "^2.18.1", diff --git a/src/main/index.js b/src/main/index.js index 24a562c7..ca21c1e8 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -26,7 +26,9 @@ function createMainWindow () { webPreferences: { nodeIntegration: true, 'web-security': false - } + }, + frame: false, + backgroundColor: '#1d1d1d' }); if (isDevelopment) diff --git a/src/main/ipc-handlers/connection.js b/src/main/ipc-handlers/connection.js index bc50cbc1..429626d5 100644 --- a/src/main/ipc-handlers/connection.js +++ b/src/main/ipc-handlers/connection.js @@ -65,7 +65,6 @@ export default () => { return { status: 'success', response: structure }; } catch (err) { - console.log(err); return { status: 'error', response: err.toString() }; } }); diff --git a/src/main/models/InformationSchema.js b/src/main/models/InformationSchema.js index 1d88c054..a64d0f79 100644 --- a/src/main/models/InformationSchema.js +++ b/src/main/models/InformationSchema.js @@ -5,6 +5,7 @@ export default class { return connection() .select('*') .withSchema('information_schema') - .from('TABLES'); + .from('TABLES') + .orderBy(['TABLE_SCHEMA', 'TABLE_NAME'], 'asc'); } } diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 0988b274..f8218560 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -1,26 +1,30 @@ diff --git a/src/renderer/components/ModalSettings.vue b/src/renderer/components/ModalSettings.vue index 7d972e62..ebcb5b67 100644 --- a/src/renderer/components/ModalSettings.vue +++ b/src/renderer/components/ModalSettings.vue @@ -42,6 +42,7 @@ +
@@ -71,19 +72,23 @@
+
+
+

{{ appName }}

{{ $t('word.version') }}: {{ appVersion }}
- GitHub + GitHub
+ {{ $t('message.madeWithJS') }}

diff --git a/src/renderer/components/TheNotificationsBoard.vue b/src/renderer/components/TheNotificationsBoard.vue index aee7f291..b2137794 100644 --- a/src/renderer/components/TheNotificationsBoard.vue +++ b/src/renderer/components/TheNotificationsBoard.vue @@ -42,6 +42,6 @@ export default { position: absolute; z-index: 9; right: 1rem; - bottom: $footer-height+1rem; + bottom: 1rem; } diff --git a/src/renderer/components/TheSettingBar.vue b/src/renderer/components/TheSettingBar.vue index 4ab73cd4..464cc2b6 100644 --- a/src/renderer/components/TheSettingBar.vue +++ b/src/renderer/components/TheSettingBar.vue @@ -103,13 +103,13 @@ export default { diff --git a/src/renderer/i18n/en-US.js b/src/renderer/i18n/en-US.js index a4b9abbd..a7568bed 100644 --- a/src/renderer/i18n/en-US.js +++ b/src/renderer/i18n/en-US.js @@ -39,7 +39,8 @@ module.exports = { editConnection: 'Edit connection', deleteConnection: 'Delete connection', deleteConnectionCorfirm: 'Do you confirm the cancellation of', - connectionSuccessfullyMade: 'Connection successfully made!' + connectionSuccessfullyMade: 'Connection successfully made!', + madeWithJS: 'Made with 💛 and JavaScript!' }, // Date and Time short: { diff --git a/src/renderer/i18n/it-IT.js b/src/renderer/i18n/it-IT.js index 4f40bcbe..e7147dce 100644 --- a/src/renderer/i18n/it-IT.js +++ b/src/renderer/i18n/it-IT.js @@ -39,7 +39,8 @@ module.exports = { editConnection: 'Modifica connessione', deleteConnection: 'Elimina connessione', deleteConnectionCorfirm: 'Confermi l\'eliminazione di', - connectionSuccessfullyMade: 'Connessione avvenuta con successo!' + connectionSuccessfullyMade: 'Connessione avvenuta con successo!', + madeWithJS: 'Fatto con 💛 e JavaScript!' }, // Date and Time short: { diff --git a/src/renderer/scss/_variables.scss b/src/renderer/scss/_variables.scss index 3958621a..9f8d9ec6 100644 --- a/src/renderer/scss/_variables.scss +++ b/src/renderer/scss/_variables.scss @@ -9,6 +9,8 @@ $success-color: #32b643; $error-color: #de3b28; /*Sizes*/ +$titlebar-height: 1.5rem; $settingbar-width: 3rem; $explorebar-width: 14rem; -$footer-height: 1.5rem; \ No newline at end of file +$footer-height: 1.5rem; +$excluding-size: $footer-height + $titlebar-height; \ No newline at end of file diff --git a/src/renderer/store/modules/settings.store.js b/src/renderer/store/modules/settings.store.js index fe518e65..ba51e22f 100644 --- a/src/renderer/store/modules/settings.store.js +++ b/src/renderer/store/modules/settings.store.js @@ -5,20 +5,28 @@ export default { namespaced: true, strict: true, state: { - locale: 'en-US' + locale: 'en-US', + explorebar_size: null }, getters: { - getLocale: state => state.locale + getLocale: state => state.locale, + getExplorebarSize: state => state.explorebar_size }, mutations: { SET_LOCALE (state, locale) { state.locale = locale; i18n.locale = locale; + }, + SET_EXPLOREBAR_SIZE (state, size) { + state.explorebar_size = size; } }, actions: { changeLocale ({ commit }, locale) { commit('SET_LOCALE', locale); + }, + changeExplorebarSize ({ commit }, size) { + commit('SET_EXPLOREBAR_SIZE', size); } } };