Restyle download dialog

Moves close button to the bottom, adds borders like other dialogs.

Bug: Issue 8884
Change-Id: I12adab48151f12f5dc7db2e1a992ea23d25f5e22
This commit is contained in:
Kasper Nilsson
2018-06-20 16:43:01 -07:00
parent e73dc26b22
commit d489bccee5
4 changed files with 41 additions and 16 deletions

View File

@@ -28,21 +28,32 @@ limitations under the License.
:host { :host {
background-color: var(--dialog-background-color); background-color: var(--dialog-background-color);
display: block; display: block;
padding: 1em;
} }
header { section {
display: flex; display: flex;
padding: .5em 1.5em;
} }
footer { section:not(:first-of-type) {
border-top: 1px solid var(--border-color);
}
.flexContainer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-top: .75em; padding-top: .75em;
} }
.footer {
justify-content: flex-end;
}
.closeButtonContainer { .closeButtonContainer {
align-items: flex-end;
display: flex; display: flex;
flex: 0; flex: 0;
justify-content: flex-end; justify-content: flex-end;
} }
.patchFiles,
.archivesContainer {
padding-bottom: .5em;
}
.patchFiles { .patchFiles {
margin-right: 2em; margin-right: 2em;
} }
@@ -56,26 +67,26 @@ limitations under the License.
margin-right: 0; margin-right: 0;
} }
.title { .title {
text-align: center;
flex: 1; flex: 1;
font-family: var(--font-family-bold);
}
.hidden {
display: none;
} }
</style> </style>
<header> <section>
<span class="title"> <span class="title">
Patch set [[patchNum]] of [[_computePatchSetQuantity(change.revisions)]] Patch set [[patchNum]] of [[_computePatchSetQuantity(change.revisions)]]
</span> </span>
<span class="closeButtonContainer"> </section>
<gr-button id="closeButton" <section class$="[[_computeShowDownloadCommands(_schemes)]]">
link
on-tap="_handleCloseTap">Close</gr-button>
</span>
</header>
<gr-download-commands <gr-download-commands
id="downloadCommands" id="downloadCommands"
commands="[[_computeDownloadCommands(change, patchNum, _selectedScheme)]]" commands="[[_computeDownloadCommands(change, patchNum, _selectedScheme)]]"
schemes="[[_schemes]]" schemes="[[_schemes]]"
selected-scheme="{{_selectedScheme}}"></gr-download-commands> selected-scheme="{{_selectedScheme}}"></gr-download-commands>
<footer> </section>
<section class="flexContainer">
<div class="patchFiles"> <div class="patchFiles">
<label>Patch file</label> <label>Patch file</label>
<div> <div>
@@ -104,7 +115,14 @@ limitations under the License.
</template> </template>
</div> </div>
</div> </div>
</footer> </section>
<section class="footer">
<span class="closeButtonContainer">
<gr-button id="closeButton"
link
on-tap="_handleCloseTap">Close</gr-button>
</span>
</section>
</template> </template>
<script src="gr-download-dialog.js"></script> <script src="gr-download-dialog.js"></script>
</dom-module> </dom-module>

View File

@@ -172,5 +172,9 @@
this._selectedScheme = schemes.sort()[0]; this._selectedScheme = schemes.sort()[0];
} }
}, },
_computeShowDownloadCommands(schemes) {
return schemes.length ? '' : 'hidden';
},
}); });
})(); })();

View File

@@ -183,5 +183,10 @@ limitations under the License.
MockInteractions.tap(element.$$('.closeButtonContainer gr-button')); MockInteractions.tap(element.$$('.closeButtonContainer gr-button'));
}); });
}); });
test('_computeShowDownloadCommands', () => {
assert.equal(element._computeShowDownloadCommands([]), 'hidden');
assert.equal(element._computeShowDownloadCommands(['test']), '');
});
}); });
</script> </script>

View File

@@ -55,8 +55,6 @@ limitations under the License.
.commands { .commands {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-bottom: 1px solid var(--border-color);
border-top: 1px solid var(--border-color);
padding: .5em; padding: .5em;
} }
gr-copy-clipboard { gr-copy-clipboard {