mirror of
https://github.com/godotengine/godot-prs-by-file.git
synced 2026-02-26 00:53:50 +03:00
Usability improvements
This commit is contained in:
@@ -57,6 +57,15 @@ export default class FileItem extends LitElement {
|
|||||||
filter: brightness(0.5);
|
filter: brightness(0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
:host .file-icon--folder {
|
||||||
|
filter: brightness(0.5);
|
||||||
|
}
|
||||||
|
:host .file-icon--file {
|
||||||
|
filter: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:host .file-title {
|
:host .file-title {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ export default class RootItem extends LitElement {
|
|||||||
min-width: 16px;
|
min-width: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
:host .root-icon {
|
||||||
|
filter: brightness(0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:host .root-title {
|
:host .root-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -29,13 +29,38 @@ export default class PullFilter extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:host .pull-filter-value {
|
:host .pull-filter-value {
|
||||||
|
position: relative;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host .pull-filter-value input {
|
||||||
background: var(--g-background-extra2-color);
|
background: var(--g-background-extra2-color);
|
||||||
border: 2px solid var(--g-background-extra-color);
|
border: 2px solid var(--g-background-extra-color);
|
||||||
border-radius: 4px 4px;
|
border-radius: 4px 4px;
|
||||||
color: var(--g-font-color);
|
color: var(--g-font-color);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
flex-grow: 1;
|
padding: 8px 48px 8px 12px;
|
||||||
padding: 8px 12px;
|
width: calc(100% - 60px);
|
||||||
|
}
|
||||||
|
|
||||||
|
:host .pull-filter-reset {
|
||||||
|
position: absolute;
|
||||||
|
right: -3px;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 36px;
|
||||||
|
background-color: var(--g-background-extra-color);
|
||||||
|
background-image: url('/remove.svg');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
background-size: 20px 20px;
|
||||||
|
border: 2px solid var(--g-background-extra-color);
|
||||||
|
border-left: none;
|
||||||
|
border-radius: 0 4px 4px 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
:host .pull-filter-reset:hover {
|
||||||
|
background-color: var(--g-background-extra2-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host .pull-filter-resolved {
|
:host .pull-filter-resolved {
|
||||||
@@ -45,7 +70,9 @@ export default class PullFilter extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 900px) {
|
@media only screen and (max-width: 900px) {
|
||||||
|
:host .pull-filter {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -53,6 +80,7 @@ export default class PullFilter extends LitElement {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this._rawValue = "";
|
||||||
this._resolvedValue = "";
|
this._resolvedValue = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,10 +105,10 @@ export default class PullFilter extends LitElement {
|
|||||||
|
|
||||||
_filterChanged(event) {
|
_filterChanged(event) {
|
||||||
this._resolvedValue = "";
|
this._resolvedValue = "";
|
||||||
const rawValue = event.target.value.trim();
|
this._rawValue = event.target.value.trim();
|
||||||
|
|
||||||
if (rawValue !== "") {
|
if (this._rawValue !== "") {
|
||||||
this._resolvedValue = this._parsePullNumber(rawValue);
|
this._resolvedValue = this._parsePullNumber(this._rawValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatchEvent(greports.util.createEvent("filterchanged", {
|
this.dispatchEvent(greports.util.createEvent("filterchanged", {
|
||||||
@@ -89,17 +117,33 @@ export default class PullFilter extends LitElement {
|
|||||||
this.requestUpdate();
|
this.requestUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_filterReset(event) {
|
||||||
|
this._rawValue = "";
|
||||||
|
this._resolvedValue = "";
|
||||||
|
|
||||||
|
this.dispatchEvent(greports.util.createEvent("filterchanged", {
|
||||||
|
"pull": this._resolvedValue,
|
||||||
|
}));
|
||||||
|
this.requestUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
return html`
|
return html`
|
||||||
<div class="pull-filter">
|
<div class="pull-filter">
|
||||||
<span class="pull-filter-label">Input PR link or number:</span>
|
<span class="pull-filter-label">Input PR link or number:</span>
|
||||||
<input
|
<div class="pull-filter-value">
|
||||||
class="pull-filter-value"
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@change="${this._filterChanged.bind(this)}"
|
.value="${this._rawValue}"
|
||||||
/>
|
@change="${this._filterChanged.bind(this)}"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="pull-filter-reset"
|
||||||
|
@click="${this._filterReset.bind(this)}"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
<span class="pull-filter-resolved">
|
<span class="pull-filter-resolved">
|
||||||
${this._resolvedValue}
|
${(this._resolvedValue !== "" ? "#" + this._resolvedValue : "")}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
1
src/static/icons/remove.svg
Normal file
1
src/static/icons/remove.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m5 1v1h-4v2h14v-2h-4v-1zm-3 4v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-8zm1 2h2v6h-2zm4 0h2v6h-2zm4 0h2v6h-2z" fill="#e0e0e0"/></svg>
|
||||||
|
After Width: | Height: | Size: 218 B |
Reference in New Issue
Block a user