Skip to content

Commit e85da3e

Browse files
committed
Graph view style improvements
- Reduce size of toolbar icons & fix alignment - Hide pointless scrollbar on graph view
1 parent 2ce85d0 commit e85da3e

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

cypress/component/viewToolbar.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('View Toolbar Component', () => {
7676
cy
7777
// the toggle should be blue because it's active (default true)
7878
.get('.control.toggle .v-btn')
79-
.should('have.class', 'bg-blue')
79+
.should('have.class', 'text-blue')
8080
// clicking the toggle should emit a "setOption" event with the
8181
// controls key (toggle) and new value (false)
8282
.click({ force: true })
@@ -87,7 +87,7 @@ describe('View Toolbar Component', () => {
8787
})
8888
// it should not be grey because it's inactive (false)
8989
.get('.control.toggle .v-btn')
90-
.not('.bg-blue')
90+
.not('.text-blue')
9191
// click it again and it should become active again
9292
.click({ force: true })
9393
.get('@wrapper').then(({ wrapper }) => {
@@ -96,7 +96,7 @@ describe('View Toolbar Component', () => {
9696
).to.deep.equal(['toggle', true])
9797
})
9898
.get('.control.toggle .v-btn')
99-
.should('have.class', 'bg-blue')
99+
.should('have.class', 'text-blue')
100100

101101
// test action=callback
102102
expect(callbacks).to.have.length(0)

src/components/cylc/ViewToolbar.vue

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3232
<v-btn
3333
:class="iControl.title"
3434
icon
35-
variant="flat"
35+
variant="text"
3636
:disabled="iControl.disabled"
3737
:color="iControl.color"
3838
@click="iControl.callback"
3939
>
40-
<v-icon size="x-large">{{ iControl.icon }}</v-icon>
40+
<v-icon size="large">{{ iControl.icon }}</v-icon>
4141
<v-tooltip
4242
activator="parent"
4343
location="bottom"
@@ -130,6 +130,7 @@ export default {
130130
break
131131
case 'callback':
132132
callback = (e) => this.call(control, e)
133+
break
133134
}
134135
135136
// set disabled
@@ -192,31 +193,23 @@ export default {
192193
<style lang="scss">
193194
.c-view-toolbar {
194195
// give the toolbar a little respect space
195-
padding: 0.5rem 0 0.5rem 0;
196+
padding: 0.5rem;
197+
display: flex;
196198
197199
.group {
198-
// put a bit of space between the groups
199-
padding-right: 0.5rem;
200-
display: inline-block;
200+
display: flex;
201+
align-items: center;
202+
203+
$spacing: 0.5rem;
201204
202-
&:before {
205+
&:not(:first-child):before {
203206
// place a divider between groups
204-
content: '|';
205-
font-size: 2rem;
206-
position: relative;
207-
top: 0.5rem; // because the font is x2 nudge it down 1/2
208-
color: rgb(200, 200, 200);
209-
}
210-
&:first-child:before {
211-
// don't add a divider on the first group
212207
content: '';
213-
}
214-
215-
.control {
216-
// put a bit of space between the controls
217-
padding: 0 0 0 0.5rem;
218-
// make them sit side-by-side
219-
display: inline-block;
208+
height: 70%;
209+
width: 2px;
210+
background: rgb(0, 0, 0, 0.22);
211+
// put a bit of space between the groups
212+
margin: 0 $spacing;
220213
}
221214
}
222215
}

src/views/Graph.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,14 @@ export default {
678678
679679
<style lang="scss">
680680
.c-graph {
681+
overflow: hidden;
682+
681683
.c-view-toolbar {
682684
// turn the view toolbar into a floating component
683685
position: fixed;
684686
background-color: rgba(240,240,240,0.9);
685687
border-radius: 0.75em;
686-
margin: 0.25em;
688+
margin: 0.5em;
687689
padding: 0.4em;
688690
}
689691
}

0 commit comments

Comments
 (0)