From 3fe8660c5e3f9cf0e94c7dc2fd0e8ef9f3b06250 Mon Sep 17 00:00:00 2001 From: alexmitchell Date: Tue, 5 Feb 2019 02:17:59 +1030 Subject: [PATCH 1/2] Add ability to load custom cursors. Add custom cursor to left / right clip position editing. Revert white space edits in timelinewidget. --- cursors/Cursor_Left_Arrow.png | Bin 0 -> 2265 bytes cursors/Cursor_Right_Arrow.png | Bin 0 -> 2084 bytes cursors/cursors.qrc | 6 + mainwindow.cpp | 3 + olive.pro | 631 +++++++++++++++++---------------- ui/cursors.cpp | 22 ++ ui/cursors.h | 13 + ui/timelinewidget.cpp | 10 + 8 files changed, 371 insertions(+), 314 deletions(-) create mode 100644 cursors/Cursor_Left_Arrow.png create mode 100644 cursors/Cursor_Right_Arrow.png create mode 100644 cursors/cursors.qrc create mode 100644 ui/cursors.cpp create mode 100644 ui/cursors.h diff --git a/cursors/Cursor_Left_Arrow.png b/cursors/Cursor_Left_Arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..2c6cac0aaf0645c85c5caafcbfb6410bd9e44870 GIT binary patch literal 2265 zcmeHJ-AhzK6ra0$_e))5A&N~RMGz_|0_&lWFf^@Av!W=H{Nk zH51S!Z^8PhzP`TfbbGRo)?B}}wH3|D$x-ZfyAp{+;`#acXW&Q&2(-cL^`4H!V!p=4 z#v@QI+)isdiTG#1U^1Bu%gf6NRgxqo%QBJ717RW-MR64KteKgaV;DDqEnrvS*XE<@ z9FNDdpokuir%)V)X+c53Ll~(ZGT)d&zOk{P zG&eU3AWq)Qa&vPTNKT;c&d@?(Tj7Vi{{hyela` zf=4dT&d$EW*RLKQDPeMQa$$XaJpd;LusVXE#*7Cm@uUZC+Aku jxs9UIij3B^?3_a#>+iLEKDqyH6&Wf@Yf9dqzwY`4Sw)Cq literal 0 HcmV?d00001 diff --git a/cursors/Cursor_Right_Arrow.png b/cursors/Cursor_Right_Arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..53fab01c6f517e8fdc97ab8420f3da12450e37ee GIT binary patch literal 2084 zcmds2O=uHQ5Pq9v^Vc7Yhe%bhK`4q~0@0$iMOsqY#M+AVQV^-V2`Wl$=%FX=#iE2D zJ*m`7^&m%qnlw2(;mdn(-psf2W@h(2 zxYXNKXFX_TjMaI&J(n@s31%byW04!@Fc^m}ba|LWzvu5?K8D6}yL(`mv6Dv$-01Xq zKa{4s-iw{4A3B3gcRcp#)P86}UQc`f85{S)G?0VEe=1xilkwtg27uF?ky~3^d$_r| zna2LlL?ZD7d$oX0W3%U!7X%@*w6t^uR#YK{+>p&?a}I|?vfJ%aI-M@Gw6wHizor^y zBGF5dWNvC|dNwmNb9I}Xd<`7O=@B(sUted1LV*)S@dWg>)eyt(&(VB7pRuj2Ef@}m z2cfe7dSHj(WHnIm)e_6j%gf8Gr>BR=1EEmp8k9u7LvS)VO;il6$V#mObJD5$#l=O2 z$oXhA`eth6k*uycJmlnIpp(sHIi5?#`^mDjOYqgr=6(8JkQslU9@`@=L-u9Y-D7lWI9x0 z9I04eUtf_-Yk*_3@$qp=!#|=BORKA^Pw@g2kziI1$gxU5q_eZLqRnP28L`q8#pdSb zAiTZ+jQ|fQLXI5rdmp15h|}q0b8~ZIAQ1R4Ha6x_^ooOaBxm|`(ns_N&0+0lD3q4eR5hzmhuNVvl-yyd|yn+rYnd99grPf4j zrHD5+HUz)lAIAD7a2hy}%jJZZKci(id_u*F zOxp%>Dk71{Ev)+iH$Z(!g*3~ zK$qnqfbP0)K)hOFvQr98M^y?&dg>+{Ko>v}pw~B3Eir7%io&6c^iZke + + Cursor_Left_Arrow.png + Cursor_Right_Arrow.png + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 805d06552..d8b0c474c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -15,6 +15,7 @@ #include "ui/viewerwidget.h" #include "ui/sourceiconview.h" #include "ui/timelineheader.h" +#include "ui/cursors.h" #include "panels/panels.h" #include "panels/project.h" @@ -95,6 +96,8 @@ MainWindow::MainWindow(QWidget *parent, const QString &an) : enable_launch_with_project(false), appName(an) { + initCustomCursors(); + open_debug_file(); debug_dialog = new DebugDialog(this); diff --git a/olive.pro b/olive.pro index 9b7f58012..2bf0813c7 100644 --- a/olive.pro +++ b/olive.pro @@ -1,314 +1,317 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2018-05-11T10:31:59 -# -#------------------------------------------------- - -QT += core gui multimedia opengl - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -mac { - TARGET = Olive -} -!mac { - TARGET = olive-editor -} -TEMPLATE = app - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which has been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -# Tries to get the current Git short hash -system("which git") { - GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h) - DEFINES += GITHASH=\\"\"$$GITHASHVAR\\"\" -} - -CONFIG += c++11 - -CONFIG(debug, debug|release) { - CONFIG += console -} - -SOURCES += \ - main.cpp \ - mainwindow.cpp \ - panels/project.cpp \ - panels/effectcontrols.cpp \ - panels/viewer.cpp \ - panels/timeline.cpp \ - ui/sourcetable.cpp \ - dialogs/aboutdialog.cpp \ - ui/timelinewidget.cpp \ - project/media.cpp \ - project/footage.cpp \ - project/sequence.cpp \ - project/clip.cpp \ - playback/playback.cpp \ - playback/audio.cpp \ - io/config.cpp \ - dialogs/newsequencedialog.cpp \ - ui/viewerwidget.cpp \ - ui/viewercontainer.cpp \ - dialogs/exportdialog.cpp \ - ui/collapsiblewidget.cpp \ - panels/panels.cpp \ - playback/cacher.cpp \ - io/exportthread.cpp \ - ui/timelineheader.cpp \ - io/previewgenerator.cpp \ - ui/labelslider.cpp \ - dialogs/preferencesdialog.cpp \ - ui/audiomonitor.cpp \ - project/undo.cpp \ - ui/scrollarea.cpp \ - ui/comboboxex.cpp \ - ui/colorbutton.cpp \ - dialogs/replaceclipmediadialog.cpp \ - ui/fontcombobox.cpp \ - ui/checkboxex.cpp \ - ui/keyframeview.cpp \ - ui/texteditex.cpp \ - dialogs/demonotice.cpp \ - project/marker.cpp \ - dialogs/speeddialog.cpp \ - dialogs/mediapropertiesdialog.cpp \ - io/crc32.cpp \ - project/projectmodel.cpp \ - io/loadthread.cpp \ - dialogs/loaddialog.cpp \ - debug.cpp \ - io/path.cpp \ - effects/internal/linearfadetransition.cpp \ - effects/internal/transformeffect.cpp \ - effects/internal/solideffect.cpp \ - effects/internal/texteffect.cpp \ - effects/internal/timecodeeffect.cpp \ - effects/internal/audionoiseeffect.cpp \ - effects/internal/paneffect.cpp \ - effects/internal/toneeffect.cpp \ - effects/internal/volumeeffect.cpp \ - effects/internal/crossdissolvetransition.cpp \ - effects/internal/shakeeffect.cpp \ - effects/internal/exponentialfadetransition.cpp \ - effects/internal/logarithmicfadetransition.cpp \ - effects/internal/cornerpineffect.cpp \ - io/math.cpp \ - io/qpainterwrapper.cpp \ - project/effect.cpp \ - project/transition.cpp \ - project/effectrow.cpp \ - project/effectfield.cpp \ - effects/internal/cubetransition.cpp \ - project/effectgizmo.cpp \ - io/clipboard.cpp \ - dialogs/stabilizerdialog.cpp \ - io/avtogl.cpp \ - ui/resizablescrollbar.cpp \ - ui/sourceiconview.cpp \ - project/sourcescommon.cpp \ - ui/keyframenavigator.cpp \ - panels/grapheditor.cpp \ - ui/graphview.cpp \ - ui/keyframedrawing.cpp \ - ui/clickablelabel.cpp \ - project/keyframe.cpp \ - ui/rectangleselect.cpp \ - dialogs/actionsearch.cpp \ - ui/embeddedfilechooser.cpp \ - effects/internal/fillleftrighteffect.cpp \ - effects/internal/voideffect.cpp \ - dialogs/texteditdialog.cpp \ - dialogs/debugdialog.cpp \ - ui/renderthread.cpp \ - ui/renderfunctions.cpp \ - ui/viewerwindow.cpp \ - project/projectfilter.cpp \ - effects/internal/frei0reffect.cpp \ - project/effectloaders.cpp \ - io/crossplatformlib.cpp \ - effects/internal/vsthost.cpp \ - ui/flowlayout.cpp \ - dialogs/proxydialog.cpp \ - io/proxygenerator.cpp - -HEADERS += \ - mainwindow.h \ - panels/project.h \ - panels/effectcontrols.h \ - panels/viewer.h \ - panels/timeline.h \ - ui/sourcetable.h \ - dialogs/aboutdialog.h \ - ui/timelinewidget.h \ - project/media.h \ - project/footage.h \ - project/sequence.h \ - project/clip.h \ - playback/playback.h \ - playback/audio.h \ - io/config.h \ - dialogs/newsequencedialog.h \ - ui/viewerwidget.h \ - ui/viewercontainer.h \ - dialogs/exportdialog.h \ - ui/collapsiblewidget.h \ - panels/panels.h \ - playback/cacher.h \ - io/exportthread.h \ - ui/timelinetools.h \ - ui/timelineheader.h \ - io/previewgenerator.h \ - ui/labelslider.h \ - dialogs/preferencesdialog.h \ - ui/audiomonitor.h \ - project/undo.h \ - ui/scrollarea.h \ - ui/comboboxex.h \ - ui/colorbutton.h \ - dialogs/replaceclipmediadialog.h \ - ui/fontcombobox.h \ - ui/checkboxex.h \ - ui/keyframeview.h \ - ui/texteditex.h \ - dialogs/demonotice.h \ - project/marker.h \ - project/selection.h \ - dialogs/speeddialog.h \ - dialogs/mediapropertiesdialog.h \ - io/crc32.h \ - project/projectmodel.h \ - io/loadthread.h \ - dialogs/loaddialog.h \ - debug.h \ - io/path.h \ - effects/internal/transformeffect.h \ - effects/internal/solideffect.h \ - effects/internal/texteffect.h \ - effects/internal/timecodeeffect.h \ - effects/internal/audionoiseeffect.h \ - effects/internal/paneffect.h \ - effects/internal/toneeffect.h \ - effects/internal/volumeeffect.h \ - effects/internal/shakeeffect.h \ - effects/internal/linearfadetransition.h \ - effects/internal/crossdissolvetransition.h \ - effects/internal/exponentialfadetransition.h \ - effects/internal/logarithmicfadetransition.h \ - effects/internal/cornerpineffect.h \ - io/math.h \ - io/qpainterwrapper.h \ - project/effect.h \ - project/transition.h \ - project/effectrow.h \ - project/effectfield.h \ - effects/internal/cubetransition.h \ - project/effectgizmo.h \ - io/clipboard.h \ - dialogs/stabilizerdialog.h \ - io/avtogl.h \ - ui/resizablescrollbar.h \ - ui/sourceiconview.h \ - project/sourcescommon.h \ - ui/keyframenavigator.h \ - panels/grapheditor.h \ - ui/graphview.h \ - ui/keyframedrawing.h \ - ui/clickablelabel.h \ - project/keyframe.h \ - ui/rectangleselect.h \ - dialogs/actionsearch.h \ - ui/embeddedfilechooser.h \ - effects/internal/fillleftrighteffect.h \ - effects/internal/voideffect.h \ - dialogs/texteditdialog.h \ - dialogs/debugdialog.h \ - ui/renderthread.h \ - ui/renderfunctions.h \ - ui/viewerwindow.h \ - project/projectfilter.h \ - effects/internal/frei0reffect.h \ - project/effectloaders.h \ - io/crossplatformlib.h \ - effects/internal/vsthost.h \ - ui/flowlayout.h \ - dialogs/proxydialog.h \ - io/proxygenerator.h - -FORMS += - -TRANSLATIONS += \ - ts/olive_de.ts \ - ts/olive_es.ts \ - ts/olive_fr.ts \ - ts/olive_it.ts \ - ts/olive_cs.ts \ - ts/olive_ru.ts - -win32 { - RC_FILE = packaging/windows/resources.rc - LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -lopengl32 -luser32 -} - -mac { - LIBS += -L/usr/local/lib -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -framework CoreFoundation - ICON = packaging/macos/olive.icns - INCLUDEPATH = /usr/local/include -} - -unix:!mac { - CONFIG += link_pkgconfig - PKGCONFIG += libavutil libavformat libavcodec libavfilter libswscale libswresample - LIBS += -ldl -} - -RESOURCES += \ - icons/icons.qrc \ - effects/internal/internalshaders.qrc - -unix:!mac:isEmpty(PREFIX) { - PREFIX = /usr/local -} - -unix:!mac:target.path = $$PREFIX/bin - -effects.files = $$PWD/effects/*.frag $$PWD/effects/*.xml $$PWD/effects/*.vert -unix:!mac:effects.path = $$PREFIX/share/olive-editor/effects - -translations.files = $$PWD/ts/*.qm -unix:!mac:translations.path = $$PREFIX/share/olive-editor/ts - -unix:!mac { - metainfo.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.appdata.xml - metainfo.path = $$PREFIX/share/metainfo - desktop.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.desktop - desktop.path = $$PREFIX/share/applications - mime.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.xml - mime.path = $$PREFIX/share/mime/packages - icon16.files = $$PWD/packaging/linux/icons/16x16/org.olivevideoeditor.Olive.png - icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps - icon32.files = $$PWD/packaging/linux/icons/32x32/org.olivevideoeditor.Olive.png - icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps - icon48.files = $$PWD/packaging/linux/icons/48x48/org.olivevideoeditor.Olive.png - icon48.path = $$PREFIX/share/icons/hicolor/48x48/apps - icon64.files = $$PWD/packaging/linux/icons/64x64/org.olivevideoeditor.Olive.png - icon64.path = $$PREFIX/share/icons/hicolor/64x64/apps - icon128.files = $$PWD/packaging/linux/icons/128x128/org.olivevideoeditor.Olive.png - icon128.path = $$PREFIX/share/icons/hicolor/128x128/apps - icon256.files = $$PWD/packaging/linux/icons/256x256/org.olivevideoeditor.Olive.png - icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps - icon512.files = $$PWD/packaging/linux/icons/512x512/org.olivevideoeditor.Olive.png - icon512.path = $$PREFIX/share/icons/hicolor/512x512/apps - icon1024.files = $$PWD/packaging/linux/icons/1024x1024/org.olivevideoeditor.Olive.png - icon1024.path = $$PREFIX/share/icons/hicolor/1024x1024/apps - INSTALLS += target effects translations metainfo desktop mime icon16 icon32 icon48 icon64 icon128 icon256 icon512 icon1024 -} +#------------------------------------------------- +# +# Project created by QtCreator 2018-05-11T10:31:59 +# +#------------------------------------------------- + +QT += core gui multimedia opengl + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +mac { + TARGET = Olive +} +!mac { + TARGET = olive-editor +} +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +# Tries to get the current Git short hash +system("which git") { + GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h) + DEFINES += GITHASH=\\"\"$$GITHASHVAR\\"\" +} + +CONFIG += c++11 + +CONFIG(debug, debug|release) { + CONFIG += console +} + +SOURCES += \ + main.cpp \ + mainwindow.cpp \ + panels/project.cpp \ + panels/effectcontrols.cpp \ + panels/viewer.cpp \ + panels/timeline.cpp \ + ui/sourcetable.cpp \ + dialogs/aboutdialog.cpp \ + ui/timelinewidget.cpp \ + project/media.cpp \ + project/footage.cpp \ + project/sequence.cpp \ + project/clip.cpp \ + playback/playback.cpp \ + playback/audio.cpp \ + io/config.cpp \ + dialogs/newsequencedialog.cpp \ + ui/viewerwidget.cpp \ + ui/viewercontainer.cpp \ + dialogs/exportdialog.cpp \ + ui/collapsiblewidget.cpp \ + panels/panels.cpp \ + playback/cacher.cpp \ + io/exportthread.cpp \ + ui/timelineheader.cpp \ + io/previewgenerator.cpp \ + ui/labelslider.cpp \ + dialogs/preferencesdialog.cpp \ + ui/audiomonitor.cpp \ + project/undo.cpp \ + ui/scrollarea.cpp \ + ui/comboboxex.cpp \ + ui/colorbutton.cpp \ + dialogs/replaceclipmediadialog.cpp \ + ui/fontcombobox.cpp \ + ui/checkboxex.cpp \ + ui/keyframeview.cpp \ + ui/texteditex.cpp \ + dialogs/demonotice.cpp \ + project/marker.cpp \ + dialogs/speeddialog.cpp \ + dialogs/mediapropertiesdialog.cpp \ + io/crc32.cpp \ + project/projectmodel.cpp \ + io/loadthread.cpp \ + dialogs/loaddialog.cpp \ + debug.cpp \ + io/path.cpp \ + effects/internal/linearfadetransition.cpp \ + effects/internal/transformeffect.cpp \ + effects/internal/solideffect.cpp \ + effects/internal/texteffect.cpp \ + effects/internal/timecodeeffect.cpp \ + effects/internal/audionoiseeffect.cpp \ + effects/internal/paneffect.cpp \ + effects/internal/toneeffect.cpp \ + effects/internal/volumeeffect.cpp \ + effects/internal/crossdissolvetransition.cpp \ + effects/internal/shakeeffect.cpp \ + effects/internal/exponentialfadetransition.cpp \ + effects/internal/logarithmicfadetransition.cpp \ + effects/internal/cornerpineffect.cpp \ + io/math.cpp \ + io/qpainterwrapper.cpp \ + project/effect.cpp \ + project/transition.cpp \ + project/effectrow.cpp \ + project/effectfield.cpp \ + effects/internal/cubetransition.cpp \ + project/effectgizmo.cpp \ + io/clipboard.cpp \ + dialogs/stabilizerdialog.cpp \ + io/avtogl.cpp \ + ui/resizablescrollbar.cpp \ + ui/sourceiconview.cpp \ + project/sourcescommon.cpp \ + ui/keyframenavigator.cpp \ + panels/grapheditor.cpp \ + ui/graphview.cpp \ + ui/keyframedrawing.cpp \ + ui/clickablelabel.cpp \ + project/keyframe.cpp \ + ui/rectangleselect.cpp \ + dialogs/actionsearch.cpp \ + ui/embeddedfilechooser.cpp \ + effects/internal/fillleftrighteffect.cpp \ + effects/internal/voideffect.cpp \ + dialogs/texteditdialog.cpp \ + dialogs/debugdialog.cpp \ + ui/renderthread.cpp \ + ui/renderfunctions.cpp \ + ui/viewerwindow.cpp \ + project/projectfilter.cpp \ + effects/internal/frei0reffect.cpp \ + project/effectloaders.cpp \ + io/crossplatformlib.cpp \ + effects/internal/vsthost.cpp \ + ui/flowlayout.cpp \ + dialogs/proxydialog.cpp \ + io/proxygenerator.cpp \ + ui/cursors.cpp + +HEADERS += \ + mainwindow.h \ + panels/project.h \ + panels/effectcontrols.h \ + panels/viewer.h \ + panels/timeline.h \ + ui/sourcetable.h \ + dialogs/aboutdialog.h \ + ui/timelinewidget.h \ + project/media.h \ + project/footage.h \ + project/sequence.h \ + project/clip.h \ + playback/playback.h \ + playback/audio.h \ + io/config.h \ + dialogs/newsequencedialog.h \ + ui/viewerwidget.h \ + ui/viewercontainer.h \ + dialogs/exportdialog.h \ + ui/collapsiblewidget.h \ + panels/panels.h \ + playback/cacher.h \ + io/exportthread.h \ + ui/timelinetools.h \ + ui/timelineheader.h \ + io/previewgenerator.h \ + ui/labelslider.h \ + dialogs/preferencesdialog.h \ + ui/audiomonitor.h \ + project/undo.h \ + ui/scrollarea.h \ + ui/comboboxex.h \ + ui/colorbutton.h \ + dialogs/replaceclipmediadialog.h \ + ui/fontcombobox.h \ + ui/checkboxex.h \ + ui/keyframeview.h \ + ui/texteditex.h \ + dialogs/demonotice.h \ + project/marker.h \ + project/selection.h \ + dialogs/speeddialog.h \ + dialogs/mediapropertiesdialog.h \ + io/crc32.h \ + project/projectmodel.h \ + io/loadthread.h \ + dialogs/loaddialog.h \ + debug.h \ + io/path.h \ + effects/internal/transformeffect.h \ + effects/internal/solideffect.h \ + effects/internal/texteffect.h \ + effects/internal/timecodeeffect.h \ + effects/internal/audionoiseeffect.h \ + effects/internal/paneffect.h \ + effects/internal/toneeffect.h \ + effects/internal/volumeeffect.h \ + effects/internal/shakeeffect.h \ + effects/internal/linearfadetransition.h \ + effects/internal/crossdissolvetransition.h \ + effects/internal/exponentialfadetransition.h \ + effects/internal/logarithmicfadetransition.h \ + effects/internal/cornerpineffect.h \ + io/math.h \ + io/qpainterwrapper.h \ + project/effect.h \ + project/transition.h \ + project/effectrow.h \ + project/effectfield.h \ + effects/internal/cubetransition.h \ + project/effectgizmo.h \ + io/clipboard.h \ + dialogs/stabilizerdialog.h \ + io/avtogl.h \ + ui/resizablescrollbar.h \ + ui/sourceiconview.h \ + project/sourcescommon.h \ + ui/keyframenavigator.h \ + panels/grapheditor.h \ + ui/graphview.h \ + ui/keyframedrawing.h \ + ui/clickablelabel.h \ + project/keyframe.h \ + ui/rectangleselect.h \ + dialogs/actionsearch.h \ + ui/embeddedfilechooser.h \ + effects/internal/fillleftrighteffect.h \ + effects/internal/voideffect.h \ + dialogs/texteditdialog.h \ + dialogs/debugdialog.h \ + ui/renderthread.h \ + ui/renderfunctions.h \ + ui/viewerwindow.h \ + project/projectfilter.h \ + effects/internal/frei0reffect.h \ + project/effectloaders.h \ + io/crossplatformlib.h \ + effects/internal/vsthost.h \ + ui/flowlayout.h \ + dialogs/proxydialog.h \ + io/proxygenerator.h \ + ui/cursors.h + +FORMS += + +TRANSLATIONS += \ + ts/olive_de.ts \ + ts/olive_es.ts \ + ts/olive_fr.ts \ + ts/olive_it.ts \ + ts/olive_cs.ts \ + ts/olive_ru.ts + +win32 { + RC_FILE = packaging/windows/resources.rc + LIBS += -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -lopengl32 -luser32 +} + +mac { + LIBS += -L/usr/local/lib -lavutil -lavformat -lavcodec -lavfilter -lswscale -lswresample -framework CoreFoundation + ICON = packaging/macos/olive.icns + INCLUDEPATH = /usr/local/include +} + +unix:!mac { + CONFIG += link_pkgconfig + PKGCONFIG += libavutil libavformat libavcodec libavfilter libswscale libswresample + LIBS += -ldl +} + +RESOURCES += \ + icons/icons.qrc \ + effects/internal/internalshaders.qrc \ + cursors/cursors.qrc + +unix:!mac:isEmpty(PREFIX) { + PREFIX = /usr/local +} + +unix:!mac:target.path = $$PREFIX/bin + +effects.files = $$PWD/effects/*.frag $$PWD/effects/*.xml $$PWD/effects/*.vert +unix:!mac:effects.path = $$PREFIX/share/olive-editor/effects + +translations.files = $$PWD/ts/*.qm +unix:!mac:translations.path = $$PREFIX/share/olive-editor/ts + +unix:!mac { + metainfo.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.appdata.xml + metainfo.path = $$PREFIX/share/metainfo + desktop.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.desktop + desktop.path = $$PREFIX/share/applications + mime.files = $$PWD/packaging/linux/org.olivevideoeditor.Olive.xml + mime.path = $$PREFIX/share/mime/packages + icon16.files = $$PWD/packaging/linux/icons/16x16/org.olivevideoeditor.Olive.png + icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps + icon32.files = $$PWD/packaging/linux/icons/32x32/org.olivevideoeditor.Olive.png + icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps + icon48.files = $$PWD/packaging/linux/icons/48x48/org.olivevideoeditor.Olive.png + icon48.path = $$PREFIX/share/icons/hicolor/48x48/apps + icon64.files = $$PWD/packaging/linux/icons/64x64/org.olivevideoeditor.Olive.png + icon64.path = $$PREFIX/share/icons/hicolor/64x64/apps + icon128.files = $$PWD/packaging/linux/icons/128x128/org.olivevideoeditor.Olive.png + icon128.path = $$PREFIX/share/icons/hicolor/128x128/apps + icon256.files = $$PWD/packaging/linux/icons/256x256/org.olivevideoeditor.Olive.png + icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps + icon512.files = $$PWD/packaging/linux/icons/512x512/org.olivevideoeditor.Olive.png + icon512.path = $$PREFIX/share/icons/hicolor/512x512/apps + icon1024.files = $$PWD/packaging/linux/icons/1024x1024/org.olivevideoeditor.Olive.png + icon1024.path = $$PREFIX/share/icons/hicolor/1024x1024/apps + INSTALLS += target effects translations metainfo desktop mime icon16 icon32 icon48 icon64 icon128 icon256 icon512 icon1024 +} diff --git a/ui/cursors.cpp b/ui/cursors.cpp new file mode 100644 index 000000000..86e89a9ac --- /dev/null +++ b/ui/cursors.cpp @@ -0,0 +1,22 @@ +#include "cursors.h" + +#include +#include + +#include + +QCursor OLIVE_CURSORS::left_arrow; +QCursor OLIVE_CURSORS::right_arrow; + +QCursor load_cursor(QString file, const int hotX, const int hotY, const bool right_aligend){ + int hotoutX; + QPixmap temp = QPixmap(file); + right_aligend? hotoutX = temp.width() : hotoutX = hotX; + return QCursor(temp,hotoutX,hotY); +} + +void initCustomCursors(){ + qInfo() << "Loading Custom Cursors"; + OLIVE_CURSORS::left_arrow = load_cursor(":/cursors/Cursor_Left_Arrow.png", 0,-1, false); + OLIVE_CURSORS::right_arrow = load_cursor(":/cursors/Cursor_Right_Arrow.png", 0,-1, true); +} diff --git a/ui/cursors.h b/ui/cursors.h new file mode 100644 index 000000000..53f1cb9fa --- /dev/null +++ b/ui/cursors.h @@ -0,0 +1,13 @@ +#ifndef CURSORS_H +#define CURSORS_H + +#include + +void initCustomCursors(); + +namespace OLIVE_CURSORS{ + extern QCursor left_arrow; + extern QCursor right_arrow; +} + +#endif // CURSORS_H diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index 2f81dc070..8e6e55b9d 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -23,6 +23,7 @@ #include "mainwindow.h" #include "ui/rectangleselect.h" #include "playback/playback.h" +#include "ui/cursors.h" #include "debug.h" #include "project/effect.h" @@ -1986,6 +1987,8 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { long mouse_frame_lower = panel_timeline->getTimelineFrameFromScreenPoint(pos.x()-lim)-1; long mouse_frame_upper = panel_timeline->getTimelineFrameFromScreenPoint(pos.x()+lim)+1; bool found = false; + bool left_arrow_cursor = false; + bool right_arrow_cursor = false; bool cursor_contains_clip = false; int closeness = INT_MAX; int min_track = INT_MAX; @@ -2017,6 +2020,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { panel_timeline->trim_in_point = true; closeness = nc; found = true; + left_arrow_cursor = true; } } if (c->timeline_out > mouse_frame_lower && c->timeline_out < mouse_frame_upper) { @@ -2026,6 +2030,7 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { panel_timeline->trim_in_point = false; closeness = nc; found = true; + right_arrow_cursor = true; } } if (panel_timeline->tool == TIMELINE_TOOL_POINTER) { @@ -2064,6 +2069,11 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { QToolTip::showText(mapToGlobal(event->pos()), "HOVER OVER CLIP"); }*/ if (found) { + if (right_arrow_cursor && !panel_timeline->trim_in_point){ + setCursor(OLIVE_CURSORS::right_arrow); + }else if (left_arrow_cursor && panel_timeline->trim_in_point){ + setCursor(OLIVE_CURSORS::left_arrow); + }else setCursor(Qt::SizeHorCursor); } else { panel_timeline->trim_target = -1; From 8faa4db15cae99bb14ac48dd753d01ce87291985 Mon Sep 17 00:00:00 2001 From: alexmitchell Date: Fri, 8 Feb 2019 13:42:46 +1030 Subject: [PATCH 2/2] Correct mistakes, rename left_arrow to left_side, make lowercase, change namespace to Olive --- cursors/cursors.qrc | 4 ++-- .../{Cursor_Left_Arrow.png => left_side.png} | Bin .../{Cursor_Right_Arrow.png => right_side.png} | Bin ui/cursors.cpp | 16 ++++++++-------- ui/cursors.h | 6 +++--- ui/timelinewidget.cpp | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename cursors/{Cursor_Left_Arrow.png => left_side.png} (100%) rename cursors/{Cursor_Right_Arrow.png => right_side.png} (100%) diff --git a/cursors/cursors.qrc b/cursors/cursors.qrc index 96dc6728a..0d40e1940 100644 --- a/cursors/cursors.qrc +++ b/cursors/cursors.qrc @@ -1,6 +1,6 @@ - Cursor_Left_Arrow.png - Cursor_Right_Arrow.png + left_side.png + right_side.png diff --git a/cursors/Cursor_Left_Arrow.png b/cursors/left_side.png similarity index 100% rename from cursors/Cursor_Left_Arrow.png rename to cursors/left_side.png diff --git a/cursors/Cursor_Right_Arrow.png b/cursors/right_side.png similarity index 100% rename from cursors/Cursor_Right_Arrow.png rename to cursors/right_side.png diff --git a/ui/cursors.cpp b/ui/cursors.cpp index 86e89a9ac..65bb01f88 100644 --- a/ui/cursors.cpp +++ b/ui/cursors.cpp @@ -5,18 +5,18 @@ #include -QCursor OLIVE_CURSORS::left_arrow; -QCursor OLIVE_CURSORS::right_arrow; +QCursor Olive::left_side; +QCursor Olive::right_side; -QCursor load_cursor(QString file, const int hotX, const int hotY, const bool right_aligend){ - int hotoutX; +QCursor load_cursor(QString file, const int hotX, const int hotY, const bool right_aligned){ + int hotX_out; QPixmap temp = QPixmap(file); - right_aligend? hotoutX = temp.width() : hotoutX = hotX; - return QCursor(temp,hotoutX,hotY); + right_aligned? hotX_out = temp.width() : hotX_out = hotX; + return QCursor(temp,hotX_out,hotY); } void initCustomCursors(){ qInfo() << "Loading Custom Cursors"; - OLIVE_CURSORS::left_arrow = load_cursor(":/cursors/Cursor_Left_Arrow.png", 0,-1, false); - OLIVE_CURSORS::right_arrow = load_cursor(":/cursors/Cursor_Right_Arrow.png", 0,-1, true); + Olive::left_side = load_cursor(":/cursors/left_side.png", 0,-1, false); + Olive::right_side = load_cursor(":/cursors/right_side.png", 0,-1, true); } diff --git a/ui/cursors.h b/ui/cursors.h index 53f1cb9fa..cec2bb514 100644 --- a/ui/cursors.h +++ b/ui/cursors.h @@ -5,9 +5,9 @@ void initCustomCursors(); -namespace OLIVE_CURSORS{ - extern QCursor left_arrow; - extern QCursor right_arrow; +namespace Olive{ + extern QCursor left_side; + extern QCursor right_side; } #endif // CURSORS_H diff --git a/ui/timelinewidget.cpp b/ui/timelinewidget.cpp index 8e6e55b9d..5aa17e26f 100644 --- a/ui/timelinewidget.cpp +++ b/ui/timelinewidget.cpp @@ -2070,9 +2070,9 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) { }*/ if (found) { if (right_arrow_cursor && !panel_timeline->trim_in_point){ - setCursor(OLIVE_CURSORS::right_arrow); + setCursor(Olive::right_side); }else if (left_arrow_cursor && panel_timeline->trim_in_point){ - setCursor(OLIVE_CURSORS::left_arrow); + setCursor(Olive::left_side); }else setCursor(Qt::SizeHorCursor); } else {