File tree 3 files changed +81
-31
lines changed
3 files changed +81
-31
lines changed Original file line number Diff line number Diff line change 61
61
style =" position : relative "
62
62
>
63
63
<div
64
- style ="
65
- position : absolute ;
66
- left : 0 ;
67
- top : -12px ;
68
- right : 0 ;
69
- bottom : -12px ;
70
- cursor : ns-resize ;
71
- z-index : 2147483647 ;
72
- "
73
- @pointerdown =" resizeSection"
64
+ class =" resize-handle"
65
+ @pointerdown =" resizeHandlePointerDown"
66
+ @dblclick =" resizeHandleDoubleClick"
74
67
></div >
75
68
</div >
76
69
@@ -83,7 +76,7 @@ import type { ComponentPublicInstance } from 'vue';
83
76
84
77
const listRef = ref <ComponentPublicInstance >();
85
78
86
- function resizeSection (downEvent : PointerEvent ) {
79
+ function resizeHandlePointerDown (downEvent : PointerEvent ) {
87
80
listenPointerEvents (downEvent , {
88
81
move(moveEvent ) {
89
82
const clientRect = listRef .value ! .$el .getBoundingClientRect ();
@@ -105,4 +98,32 @@ function resizeSection(downEvent: PointerEvent) {
105
98
},
106
99
});
107
100
}
101
+
102
+ function resizeHandleDoubleClick() {
103
+ const avgWeight =
104
+ (uiStore ().currentPathWeight + uiStore ().recentPagesWeight ) / 2 ;
105
+
106
+ uiStore ().currentPathWeight = avgWeight ;
107
+ uiStore ().recentPagesWeight = avgWeight ;
108
+ }
108
109
</script >
110
+
111
+ <style scoped lang="scss">
112
+ .resize-handle {
113
+ position : absolute ;
114
+ left : 0 ;
115
+ top : -6px ;
116
+ right : 0 ;
117
+ bottom : -6px ;
118
+ cursor : ns-resize ;
119
+ z-index : 2147483647 ;
120
+
121
+ opacity : 0 ;
122
+ background-color : white ;
123
+
124
+ transition : opacity 0.2s ;
125
+ }
126
+ .resize-handle :hover {
127
+ opacity : 0.4 ;
128
+ }
129
+ </style >
Original file line number Diff line number Diff line change 11
11
style =" display : flex ; flex-direction : column ; background-color : #212121 "
12
12
>
13
13
<div
14
- style ="
15
- position : absolute ;
16
- top : 0 ;
17
- bottom : 0 ;
18
- right : -12px ;
19
- width : 12px ;
20
- cursor : ew-resize ;
21
- z-index : 2147483647 ;
22
- "
14
+ class =" resize-handle"
23
15
@pointerdown =" resizeLeftSidebar"
24
16
@dblclick =" () => uiStore().resetLeftSidebarWidth()"
25
17
></div >
@@ -54,4 +46,22 @@ function resizeLeftSidebar(event: PointerEvent) {
54
46
border-right : 1px solid rgba (255 , 255 , 255 , 0.12 ) !important ;
55
47
}
56
48
}
49
+
50
+ .resize-handle {
51
+ position : absolute ;
52
+ top : 0 ;
53
+ bottom : 0 ;
54
+ right : -10px ;
55
+ left : calc (100% + 1px );
56
+ cursor : ew-resize ;
57
+ z-index : 2147483647 ;
58
+
59
+ opacity : 0 ;
60
+ background-color : white ;
61
+
62
+ transition : opacity 0.2s ;
63
+ }
64
+ .resize-handle :hover {
65
+ opacity : 0.4 ;
66
+ }
57
67
</style >
Original file line number Diff line number Diff line change 72
72
v-if =" uiStore().recentPagesExpanded && uiStore().selectedPagesExpanded"
73
73
>
74
74
<div
75
- style ="
76
- position : absolute ;
77
- left : 0 ;
78
- top : -12px ;
79
- right : 0 ;
80
- bottom : -12px ;
81
- cursor : ns-resize ;
82
- z-index : 2147483647 ;
83
- "
84
- @pointerdown =" resizeSection"
75
+ class =" resize-handle"
76
+ @pointerdown =" resizeHandlePointerDown"
77
+ @dblclick =" resizeHandleDoubleClick"
85
78
></div >
86
79
</div >
87
80
@@ -96,7 +89,7 @@ import type { ComponentPublicInstance } from 'vue';
96
89
97
90
const listRef = ref <ComponentPublicInstance >();
98
91
99
- function resizeSection (downEvent : PointerEvent ) {
92
+ function resizeHandlePointerDown (downEvent : PointerEvent ) {
100
93
listenPointerEvents (downEvent , {
101
94
move(moveEvent ) {
102
95
const clientRect = listRef .value ! .$el .getBoundingClientRect ();
@@ -133,6 +126,14 @@ async function removeRecentPage(pageId: string) {
133
126
handleError (error );
134
127
}
135
128
}
129
+
130
+ function resizeHandleDoubleClick() {
131
+ const avgWeight =
132
+ (uiStore ().recentPagesWeight + uiStore ().selectedPagesWeight ) / 2 ;
133
+
134
+ uiStore ().recentPagesWeight = avgWeight ;
135
+ uiStore ().selectedPagesWeight = avgWeight ;
136
+ }
136
137
</script >
137
138
138
139
<style scoped lang="scss">
@@ -160,4 +161,22 @@ async function removeRecentPage(pageId: string) {
160
161
.recent-page :hover > .remove-btn {
161
162
opacity : 1 ;
162
163
}
164
+
165
+ .resize-handle {
166
+ position : absolute ;
167
+ left : 0 ;
168
+ top : -6px ;
169
+ right : 0 ;
170
+ bottom : -6px ;
171
+ cursor : ns-resize ;
172
+ z-index : 2147483647 ;
173
+
174
+ opacity : 0 ;
175
+ background-color : white ;
176
+
177
+ transition : opacity 0.2s ;
178
+ }
179
+ .resize-handle :hover {
180
+ opacity : 0.4 ;
181
+ }
163
182
</style >
You can’t perform that action at this time.
0 commit comments