Fix progress color in dark theme

resolve #32
This commit is contained in:
CzBiX
2020-05-05 21:24:54 +08:00
parent 0cdd5c57ea
commit 219f8648b3

View File

@@ -173,7 +173,7 @@
:color="row.item.state | stateColor(true)"
class="text-center ma-0"
>
<span :class="row.item.progress | progressColorClass">
<span :class="getProgressColorClass(row.item.progress)">
{{ row.item.progress | progress }}
</span>
</v-progress-linear>
@@ -331,10 +331,6 @@ function getStateInfo(state: string) {
}),
},
filters: {
progressColorClass(progress: number) {
const color = progress >= 0.5 ? 'white' : 'black';
return `${color}--text`;
},
formatNetworkSpeed(speed: number) {
if (speed === 0) {
return null;
@@ -448,6 +444,12 @@ export default class Torrents extends Vue {
=== Math.min(this.torrents.length, this.pageOptions.rowsPerPage);
}
getProgressColorClass(progress: number) {
const color = (progress >= 0.5 || (this as any).$vuetify.theme.dark)
? 'white' : 'black';
return `${color}--text`;
}
created() {
this.pageOptions = this.$store.getters.config.pageOptions;
}