- layout adjustments in deploy tab

- click on title of the card is opening it
- removed shortut info from tooltips untill farther desition
- fixed tiny bug on icon panel colors

arrow
pull/3094/head
LianaHus 6 years ago
parent 2bb97c20a0
commit bcc845fec0
  1. 44
      src/app/components/vertical-icons-component.js
  2. 2
      src/app/tabs/runTab/contractDropdown.js
  3. 2
      src/app/tabs/styles/run-tab-styles.js
  4. 12
      src/app/ui/card.js
  5. 1
      src/framingService.js

@ -33,6 +33,11 @@ class VerticalIconComponent {
}) })
this.store.event.on('add', (api) => { }) this.store.event.on('add', (api) => { })
this.store.event.on('remove', (api) => { }) this.store.event.on('remove', (api) => { })
let themeModule = globalRegistry.get('themeModule').api
themeModule.events.on('themeChanged', (type) => {
this.onThemeChanged(type)
})
} }
stopListenOnStatus (api) { stopListenOnStatus (api) {
@ -58,7 +63,7 @@ class VerticalIconComponent {
* @param {ModuleProfile} profile The profile of the module * @param {ModuleProfile} profile The profile of the module
*/ */
addIcon ({kind, name, icon, displayName, tooltip}) { addIcon ({kind, name, icon, displayName, tooltip}) {
let title = (displayName || name) + " " + tooltip let title = (displayName || name)// + (tooltip ? tooltip : "")
this.icons[name] = yo` this.icons[name] = yo`
<div <div
class="${css.icon}" class="${css.icon}"
@ -108,30 +113,51 @@ class VerticalIconComponent {
} }
/** /**
* Set an icon as active * Remove active for the current activated icons
* @param {string} name Name of profile of the module to activate
*/ */
select (name) { removeActive () {
const themeType = globalRegistry.get('themeModule').api.currentTheme().quality
const invert = themeType === 'dark' ? 1 : 0
// Remove active for the current activated icons
const currentActive = this.view.querySelector(`.${css.active}`) const currentActive = this.view.querySelector(`.${css.active}`)
if (currentActive) { if (currentActive) {
currentActive.classList.remove(css.active) currentActive.classList.remove(css.active)
let image = currentActive.querySelector('.image') let image = currentActive.querySelector('.image')
image.style.setProperty('filter', 'invert(0.5)') image.style.setProperty('filter', 'invert(0.5)')
} }
// Add active for the new activated icon }
/**
* Add active for the new activated icon
* @param {string} name Name of profile of the module to activate
*/
addActive (name) {
const themeType = globalRegistry.get('themeModule').api.currentTheme().quality
const invert = themeType === 'dark' ? 1 : 0
const nextActive = this.view.querySelector(`[plugin="${name}"]`) const nextActive = this.view.querySelector(`[plugin="${name}"]`)
if (nextActive) { if (nextActive) {
let image = nextActive.querySelector('.image') let image = nextActive.querySelector('.image')
nextActive.classList.add(css.active) nextActive.classList.add(css.active)
image.style.setProperty('filter', `invert(${invert})`) image.style.setProperty('filter', `invert(${invert})`)
} }
}
/**
* Set an icon as active
* @param {string} name Name of profile of the module to activate
*/
select (name) {
this.removeActive()
this.addActive(name)
this.events.emit('showContent', name) this.events.emit('showContent', name)
} }
onThemeChanged (themeType) {
const invert = themeType === 'dark' ? 1 : 0
const active = this.view.querySelector(`.${css.active}`)
if (active) {
let image = active.querySelector('.image')
image.style.setProperty('filter', `invert(${invert})`)
}
}
_iconClick (name) { _iconClick (name) {
this.select(name) this.select(name)
} }
@ -223,7 +249,7 @@ const css = csjs`
height: 28px; height: 28px;
padding: 4px; padding: 4px;
} }
.icon[title='Settings (Ctrl+Shift+S)'] { .icon[title='Settings'] {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
} }

@ -44,7 +44,7 @@ class ContractDropdownUI {
} }
render () { render () {
this.compFails = yo`<i title="Contract compilation failed. Please check the compile tab for more information." class="fa fa-times-circle ${css.errorIcon}" ></i>` this.compFails = yo`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="fa fa-times-circle ${css.errorIcon}" ></i>`
var info = yo`<i class="fa fa-info ${css.infoDeployAction}" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>` var info = yo`<i class="fa fa-info ${css.infoDeployAction}" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>`
this.atAddressButtonInput = yo`<input class="${css.input} ${css.ataddressinput} ataddressinput form-control" placeholder="Load contract from Address" title="atAddress" />` this.atAddressButtonInput = yo`<input class="${css.input} ${css.ataddressinput} ataddressinput form-control" placeholder="Load contract from Address" title="atAddress" />`

@ -12,6 +12,7 @@ var css = csjs`
font-size: 12px; font-size: 12px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-left: 15px;
} }
.settings { .settings {
margin-bottom: 2%; margin-bottom: 2%;
@ -141,6 +142,7 @@ var css = csjs`
.noInstancesText { .noInstancesText {
font-style: italic; font-style: italic;
text-align: left; text-align: left;
padding-left: 15px;
} }
.pendingTxsText { .pendingTxsText {
font-style: italic; font-style: italic;

@ -16,17 +16,15 @@ module.exports = class Card {
if (self._view.el) return self._view.el if (self._view.el) return self._view.el
self._view.cardBody = yo`<div class=${css.cardBody}></div>` self._view.cardBody = yo`<div class=${css.cardBody}></div>`
self._view.arrow = yo`<i class="${css.arrow} fa fa-angle-down" self._view.arrow = yo`<i class="${css.arrow} fa fa-angle-down" onclick="${(e) => trigger(ev.target)}"></i>`
onclick=${(ev) => trigger(ev.target)}></i>`
self._view.expandCollapseButton = yo` self._view.expandCollapseButton = yo`
<div class=${css.expandCollapseButton}>${self._view.arrow}</div>` <div class=${css.expandCollapseButton}>${self._view.arrow}</div>`
self._view.statusBar = yo`<div class=${css.statusBar}>${self._opts.collapsedView}</div>` self._view.statusBar = yo`<div class=${css.statusBar}>${self._opts.collapsedView}</div>`
self._view.cardHeader = yo` self._view.cardHeader = yo`
<div class=${css.cardHeader}> <div class=${css.cardHeader} onclick=${() => trigger(self._view.arrow)}>
<div class=${css.cardTitles}> <div class="p-1 ${css.cardTitles}">
<div class=${css.cardTitle}>${self._opts.title}</div> <div class=${css.cardTitle}>${self._opts.title}</div>
${self._view.statusBar} ${self._view.statusBar}
</div> </div>
@ -43,7 +41,7 @@ module.exports = class Card {
// HTML // HTML
self._view.el = yo` self._view.el = yo`
<div class="${css.cardContainer} list-group-item"> <div class="${css.cardContainer} p-2 list-group-item">
${self._view.cardHeader} ${self._view.cardHeader}
${self._view.cardBody} ${self._view.cardBody}
</div>` </div>`
@ -55,7 +53,7 @@ module.exports = class Card {
const css = csjs` const css = csjs`
.cardContainer { .cardContainer {
padding: 10px 15px 15px 0; padding : 10px 15px 15px 0;
margin-bottom : 2%; margin-bottom : 2%;
} }
.cardHeader { .cardHeader {

@ -14,7 +14,6 @@ export default {
verticalIconApi.select('fileExplorers') verticalIconApi.select('fileExplorers')
mainPanelApi.showContent('home') mainPanelApi.showContent('home')
document.addEventListener('keypress', (e) => { document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) { if (e.shiftKey && e.ctrlKey) {
if (e.code === 'KeyF') { // Ctrl+Shift+F if (e.code === 'KeyF') { // Ctrl+Shift+F

Loading…
Cancel
Save