Skip to content

Commit 4e0b739

Browse files
committed
[*] refactor: video editor
1 parent e0e8e5f commit 4e0b739

File tree

9 files changed

+444
-82
lines changed

9 files changed

+444
-82
lines changed

wayshot/ui/logic.slint

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
SubtitleType,
3030
VideoEditorExportVideoConfig,
3131
VideoEditorExportAudioConfig,
32+
VideoEditorTrackSegment,
3233
} from "store.slint";
3334

3435
import { Theme } from "base/theme.slint";
@@ -313,6 +314,27 @@ export global Logic {
313314
callback video-editor-export-queue-cancel(index: int);
314315
callback video-editor-export-queue-remove(index: int);
315316

317+
callback video-editor-segment-up-filter(index: int);
318+
callback video-editor-segment-down-filter(index: int);
319+
callback video-editor-segment-remove-filter(index: int);
320+
callback video-editor-segment-toggle-filter(index: int);
321+
322+
pure callback video-editor-selected-segment() -> VideoEditorTrackSegment;
323+
video-editor-selected-segment => {
324+
return Store.video-editor-tracks-manager.tracks[0].segments[0];
325+
}
326+
327+
pure callback video-editor-is-video-track() -> bool;
328+
video-editor-is-video-track => {
329+
return true;
330+
}
331+
pure callback video-editor-is-audio-track() -> bool;
332+
video-editor-is-audio-track => {
333+
return true;
334+
}
335+
pure callback video-editor-is-subtitle-track() -> bool;
336+
pure callback video-editor-is-overlay-track() -> bool;
337+
316338
pure callback video-editor-contain-audio-track(index: int) -> bool;
317339
pure callback video-editor-contain-subtitle-track(index: int) -> bool;
318340
pure callback video-editor-is-selected-track(selected-tracks: [SelectedTrackIndex], index: int) -> bool;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export struct SegmentFilterListItem {
2+
enabled: bool,
3+
name: string,
4+
detail: string, // 经过序列化后的json
5+
}
6+
7+
export struct BrightnessDetail {
8+
adjustment: float, // -100.0 to 100.0 (0.0 = no change)
9+
}
10+
11+
export global VEFilter {
12+
pure callback from_brightness_json(json: string) -> BrightnessDetail;
13+
callback to_brightness_json(datail: BrightnessDetail) -> string;
14+
}

wayshot/ui/panel/desktop/video-editor/header.slint

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -152,36 +152,6 @@ export component Header inherits Rectangle {
152152
}
153153
}
154154

155-
TextBtnWithoutIcon {
156-
text: Logic.tr("Export");
157-
font-size: Theme.title4-font-size;
158-
159-
private property <[PopupActionEntry]> export-action-entries: [
160-
{
161-
icon: Icons.video-light,
162-
text: Logic.tr("Export Video"),
163-
shotcut: "Ctrl+Alt+E",
164-
action: "video-editor-export-video-dialog",
165-
},
166-
{
167-
icon: Icons.audio-light,
168-
text: Logic.tr("Export Audio"),
169-
shotcut: "Ctrl+Alt+A",
170-
action: "video-editor-export-audio-dialog",
171-
},
172-
{
173-
icon: Icons.subtitle-light,
174-
text: Logic.tr("Export Subtitle"),
175-
shotcut: "Ctrl+Alt+S",
176-
action: "video-editor-export-subtitle",
177-
},
178-
];
179-
180-
clicked => {
181-
PopupActionSetting.show(self.absolute-position.x, self.absolute-position.y + self.preferred-height, export-action-entries);
182-
}
183-
}
184-
185155
TextBtnWithoutIcon {
186156
text: Logic.tr("Help");
187157
font-size: Theme.title4-font-size;

wayshot/ui/panel/desktop/video-editor/left-panel/export-queue.slint

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,22 @@ component ExportDetailSubtitle inherits SettingDetail {
385385
component ExportDetail inherits Rectangle {
386386
tab := ExportDetailTab {
387387
x: (root.width - self.width) / 2;
388-
y: Theme.padding;
388+
y: 0;
389389
}
390390

391391
if tab.checked-index == 0: ExportDetailVideo {
392-
y: tab.y + tab.height;
393-
height: root.height - tab.height;
392+
y: tab.y + tab.height + Theme.spacing * 2;
393+
height: root.height - self.y;
394394
}
395395

396396
if tab.checked-index == 1: ExportDetailAudio {
397-
y: tab.y + tab.height;
398-
height: root.height - tab.height;
397+
y: tab.y + tab.height + Theme.spacing * 2;
398+
height: root.height - self.y;
399399
}
400400

401401
if tab.checked-index == 2: ExportDetailSubtitle {
402-
y: tab.y + tab.height;
403-
height: root.height - tab.height;
402+
y: tab.y + tab.height + Theme.spacing * 2;
403+
height: root.height - self.y;
404404
}
405405
}
406406

wayshot/ui/panel/desktop/video-editor/right-panel/filter.slint

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)