@@ -118,7 +118,7 @@ component DetailItem inherits Rectangle {
118118 }
119119
120120 hbox := HorizontalLayout {
121- spacing : Theme.spacing * 8 ;
121+ spacing : Theme.spacing * 4 ;
122122 padding : Theme.padding * 2 ;
123123 alignment : space-between;
124124
@@ -141,19 +141,20 @@ component DetailItem inherits Rectangle {
141141 }
142142 }
143143
144- HorizontalLayout {
145- padding-left : Theme.padding * 4 ;
146- Label {
147- text : playlist-item.name;
148- overflow : elide;
149- }
144+ Label {
145+ text : playlist-item.name;
146+ overflow : elide;
150147 }
151148 }
152149
153150 HorizontalLayout {
154151 alignment : end;
155152 spacing : Theme.spacing * 4 ;
156153
154+ Label {
155+ text : playlist-item.duration;
156+ }
157+
157158 Label {
158159 text : playlist-item.file-size;
159160 }
@@ -196,6 +197,7 @@ component ThumbnailItem inherits Rectangle {
196197 in property <VideoEditorPlaylistItem > playlist-item ;
197198
198199 callback double-clicked <=> ta.double-clicked;
200+ callback right-clicked (absolute-x : length , absolute-y : length );
199201
200202 public pure function get-media-icon (ty : MediaType ) -> image {
201203 if (ty == MediaType.Video) {
@@ -213,6 +215,12 @@ component ThumbnailItem inherits Rectangle {
213215
214216 ta := TouchArea {
215217 mouse-cursor : MouseCursor.pointer;
218+
219+ pointer-event (event) => {
220+ if (event.button == PointerEventButton.right) {
221+ root .right-clicked (self .absolute-position.x, self .absolute-position.y + self .preferred-height);
222+ }
223+ }
216224 }
217225
218226 rec := Rectangle {
@@ -229,7 +237,7 @@ component ThumbnailItem inherits Rectangle {
229237 alignment : center;
230238
231239 Image {
232- width : rec.width * Theme.golden-ratio ;
240+ width : rec.width * 0.8 ;
233241 source : playlist-item.thumbnail;
234242 }
235243 }
@@ -258,12 +266,13 @@ component ThumbnailItem inherits Rectangle {
258266export component ThumbnailView inherits ListView {
259267 in-out property <[VideoEditorPlaylistItem ]> playlist ;
260268
261- private property <length > thumbnail-size : Theme.icon-size * 5 ;
269+ private property <length > thumbnail-size : Theme.icon-size * 6 ;
262270 private property <int > column-count : clamp (root .width / (thumbnail-size + Theme.spacing), 1 , 20 );
263271
264272 private property <int> row-count: playlist.length == 0 ? 0 : (mod(playlist.length, column-count) == 0 ? playlist.length / column-count : playlist.length / column-count + 1 );
265273
266274 callback double-clicked(index: int);
275+ callback right-clicked(index: int, absolute-x: length, absolute-y: length);
267276
268277 for row-index in row-count: HorizontalLayout {
269278 alignment: space-around;
@@ -277,6 +286,10 @@ export component ThumbnailView inherits ListView {
277286 double-clicked => {
278287 root .double-clicked(self .index);
279288 }
289+
290+ right-clicked(absolute-x, absolute-y) => {
291+ root .right-clicked (self .index, absolute-x, absolute-y);
292+ }
280293 }
281294 }
282295}
@@ -333,6 +346,23 @@ export component Playlist inherits Rectangle {
333346 width : root .width;
334347 playlist <=> root .playlist;
335348
349+ right-clicked (index, absolute-x, absolute-y) => {
350+ PopupActionSetting.show (absolute-x, absolute-y + self .preferred-height, [
351+ {
352+ icon: Icons.add-light,
353+ text: Logic.tr("Add To Track" ),
354+ action: "video-editor-playlist-item-add-to-track" ,
355+ user-data: index,
356+ },
357+ {
358+ icon: Icons.clear-light,
359+ text: Logic.tr ("Remove" ),
360+ action: "video-editor-playlist-item-remove" ,
361+ user-data: index,
362+ },
363+ ]);
364+ }
365+
336366 double-clicked (index) => {
337367 Logic.video-editor-playlist-item-add-to-track (index);
338368 }
0 commit comments