Skip to content

A full-featured download manager.

refactor: improve responsive style

Dr_rOotedd405373079
diff --git a/src/main/configs/page.js b/src/main/configs/page.js
index 4abdbe6e..320844b9 100644
--- a/src/main/configs/page.js
+++ b/src/main/configs/page.js
@@ -6,7 +6,7 @@ export default {
title: 'Motrix',
width: 1024,
height: 768,
- minWidth: 400,
+ minWidth: 478,
minHeight: 420,
// backgroundColor: '#FFFFFF',
transparent: !is.windows()
diff --git a/src/renderer/components/Main.vue b/src/renderer/components/Main.vue
index 52659fe5..757fa622 100644
--- a/src/renderer/components/Main.vue
+++ b/src/renderer/components/Main.vue
@@ -57,7 +57,7 @@
<style lang="scss">
.mo-speedometer {
position: fixed;
- right: 36px;
+ right: 16px;
bottom: 24px;
z-index: 20;
}
diff --git a/src/renderer/components/Preference/Advanced.vue b/src/renderer/components/Preference/Advanced.vue
index 46bf9a89..dd874a18 100644
--- a/src/renderer/components/Preference/Advanced.vue
+++ b/src/renderer/components/Preference/Advanced.vue
@@ -60,14 +60,26 @@
v-if="form.useProxy"
style="margin-top: -16px;"
>
- <el-col class="form-item-sub" :span="16">
+ <el-col
+ class="form-item-sub"
+ :xs="24"
+ :sm="20"
+ :md="16"
+ :lg="16"
+ >
<el-input
placeholder="[http://][USER:PASSWORD@]HOST[:PORT]"
@change="onAllProxyBackupChange"
v-model="form.allProxyBackup">
</el-input>
</el-col>
- <el-col class="form-item-sub" :span="20">
+ <el-col
+ class="form-item-sub"
+ :xs="24"
+ :sm="24"
+ :md="20"
+ :lg="20"
+ >
<el-input
type="textarea"
rows="2"
@@ -182,7 +194,13 @@
:label-width="formLabelWidth"
>
<el-row style="margin-bottom: 8px;">
- <el-col class="form-item-sub" :span="12">
+ <el-col
+ class="form-item-sub"
+ :xs="24"
+ :sm="18"
+ :md="12"
+ :lg="12"
+ >
<el-switch
v-model="form.enableUpnp"
active-text="UPnP/NAT-PMP"
@@ -191,7 +209,12 @@
</el-col>
</el-row>
<el-row style="margin-bottom: 8px;">
- <el-col class="form-item-sub" :span="10">
+ <el-col class="form-item-sub"
+ :xs="24"
+ :sm="18"
+ :md="10"
+ :lg="10"
+ >
{{ $t('preferences.bt-port') }}
<el-input
placeholder="BT Port"
@@ -205,7 +228,13 @@
</el-col>
</el-row>
<el-row>
- <el-col class="form-item-sub" :span="10">
+ <el-col
+ class="form-item-sub"
+ :xs="24"
+ :sm="18"
+ :md="10"
+ :lg="10"
+ >
{{ $t('preferences.dht-port') }}
<el-input
placeholder="DHT Port"
@@ -261,7 +290,13 @@
<el-button @click="() => changeUA('du')">du</el-button>
</el-button-group>
</el-col>
- <el-col class="form-item-sub" :span="18">
+ <el-col
+ class="form-item-sub"
+ :xs="24"
+ :sm="18"
+ :md="18"
+ :lg="18"
+ >
{{ $t('preferences.rpc-secret') }}
<el-input
:show-password="hideRpcSecret"
diff --git a/src/renderer/components/Preference/Index.vue b/src/renderer/components/Preference/Index.vue
index 3337ad3b..d5eef5a3 100644
--- a/src/renderer/components/Preference/Index.vue
+++ b/src/renderer/components/Preference/Index.vue
@@ -18,7 +18,7 @@
<style lang="scss">
.form-preference {
- padding: 16px 7% 64px 0;
+ padding: 16px 7% 64px 16px;
.el-switch__label {
font-weight: normal;
color: $--color-text-regular;
@@ -62,7 +62,7 @@
z-index: 10;
width: -webkit-fill-available;
box-sizing: border-box;
- padding: 24px 36px 24px 0;
+ padding: 24px 16px;
}
.action-link {
cursor: pointer;
diff --git a/src/renderer/components/Preference/Lab.vue b/src/renderer/components/Preference/Lab.vue
index 0b92b51c..f97cf00b 100644
--- a/src/renderer/components/Preference/Lab.vue
+++ b/src/renderer/components/Preference/Lab.vue
@@ -91,6 +91,6 @@
flex-basis: auto;
overflow: auto;
box-sizing: border-box;
- padding: 0 0 0 36px;
+ padding: 0;
}
</style>
diff --git a/src/renderer/components/Task/TaskList.vue b/src/renderer/components/Task/TaskList.vue
index 279cea4a..6ec9a6ca 100644
--- a/src/renderer/components/Task/TaskList.vue
+++ b/src/renderer/components/Task/TaskList.vue
@@ -69,7 +69,7 @@
<style lang="scss">
.task-list {
- padding: 16px 0 64px 0;
+ padding: 16px 16px 64px;
min-height: 100%;
box-sizing: border-box;
}
diff --git a/src/renderer/components/Task/TaskProgressInfo.vue b/src/renderer/components/Task/TaskProgressInfo.vue
index d5564088..3fb5a704 100644
--- a/src/renderer/components/Task/TaskProgressInfo.vue
+++ b/src/renderer/components/Task/TaskProgressInfo.vue
@@ -1,13 +1,26 @@
<template>
<el-row class="task-progress-info">
- <el-col :span="6" class="task-progress-info-left">
+ <el-col
+ class="task-progress-info-left"
+ :xs="12"
+ :sm="7"
+ :md="6"
+ :lg="6"
+ >
<div v-if="task.completedLength > 0 || task.totalLength > 0">
<span>{{ task.completedLength | bytesToSize(2) }}</span>
<span v-if="task.totalLength > 0"> / {{ task.totalLength | bytesToSize(2) }}</span>
</div>
</el-col>
- <el-col :span="18" class="task-progress-info-right">
- <div class="task-speed-info" v-if="isActive">
+ <el-col
+ class="task-progress-info-right"
+ v-if="isActive"
+ :xs="12"
+ :sm="17"
+ :md="18"
+ :lg="18"
+ >
+ <div class="task-speed-info">
<div class="task-speed-text" v-if="isBT">
<i><mo-icon name="arrow-up" width="10" height="14" /></i>
<span>{{ task.uploadSpeed | bytesToSize }}/s</span>
@@ -16,7 +29,7 @@
<i><mo-icon name="arrow-down" width="10" height="14" /></i>
<span>{{ task.downloadSpeed | bytesToSize }}/s</span>
</div>
- <div class="task-speed-text" v-if="remaining > 0">
+ <div class="task-speed-text hidden-sm-and-down" v-if="remaining > 0">
<span>
{{
remaining | timeFormat({
@@ -31,11 +44,11 @@
}}
</span>
</div>
- <div class="task-speed-text" v-if="isBT">
+ <div class="task-speed-text hidden-sm-and-down" v-if="isBT">
<i><mo-icon name="magnet" width="10" height="14" /></i>
<span>{{ task.numSeeders }}</span>
</div>
- <div class="task-speed-text">
+ <div class="task-speed-text hidden-sm-and-down">
<i><mo-icon name="node" width="10" height="14" /></i>
<span>{{ task.connections }}</span>
</div>
diff --git a/src/renderer/components/TaskDetail/Index.vue b/src/renderer/components/TaskDetail/Index.vue
index 27e215ba..184849d8 100644
--- a/src/renderer/components/TaskDetail/Index.vue
+++ b/src/renderer/components/TaskDetail/Index.vue
@@ -285,12 +285,14 @@
<style lang="scss">
.task-detail-drawer {
+ min-width: 478px;
.el-drawer__header {
padding-top: 2rem;
margin-bottom: 0;
}
.el-drawer__body {
position: relative;
+ overflow: hidden;
}
.task-detail-actions {
position: sticky;
diff --git a/src/renderer/components/TaskDetail/TaskFiles.vue b/src/renderer/components/TaskDetail/TaskFiles.vue
index 14b9000c..b175de42 100644
--- a/src/renderer/components/TaskDetail/TaskFiles.vue
+++ b/src/renderer/components/TaskDetail/TaskFiles.vue
@@ -41,7 +41,13 @@
</el-table>
</div>
<el-row class="file-filters" :gutter="12">
- <el-col class="quick-filters" :span="8">
+ <el-col
+ class="quick-filters"
+ :xs="24"
+ :sm="8"
+ :md="8"
+ :lg="8"
+ >
<el-button-group>
<el-button @click="toggleVideoSelection()">
<mo-icon name="video" width="12" height="12" />
@@ -54,7 +60,13 @@
</el-button>
</el-button-group>
</el-col>
- <el-col :span="16" class="files-summary">
+ <el-col
+ class="files-summary"
+ :xs="24"
+ :sm="16"
+ :md="16"
+ :lg="16"
+ >
{{ $t('task.selected-files-sum', { selectedFilesCount, selectedFilesTotalSize }) }}
</el-col>
</el-row>
diff --git a/src/renderer/components/Theme/Default.scss b/src/renderer/components/Theme/Default.scss
index 758bc830..14f485a5 100644
--- a/src/renderer/components/Theme/Default.scss
+++ b/src/renderer/components/Theme/Default.scss
@@ -237,7 +237,7 @@ iframe {
.panel-header {
position: relative;
padding: 44px 0 12px;
- margin: 0 36px;
+ margin: 0 16px;
border-bottom: 2px solid $--panel-border-color;
user-select: none;
h4 {
@@ -250,7 +250,7 @@ iframe {
}
.panel-content {
position: relative;
- padding: 0 36px 0;
+ padding: 0;
height: 100%;
}
}
@@ -289,11 +289,30 @@ iframe {
@media only screen and (max-width:567px) {
.hidden-xs-only {
- display:none!important
+ display:none !important
}
}
@media only screen and (min-width: 568px) {
+ .panel {
+ .panel-header {
+ margin-left: 36px;
+ margin-right: 36px;
+ }
+ }
+ .task-list {
+ padding-left: 36px;
+ padding-right: 36px;
+ }
+ .form-preference {
+ padding-left: 36px;
+ }
+ .form-actions {
+ padding: 24px 36px;
+ }
+ .mo-speedometer {
+ right: 36px;
+ }
.hidden-sm-and-up {
display: none !important;
}