Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few small timeline fixes #3709

Merged
merged 4 commits into from
Oct 14, 2020
Merged

A few small timeline fixes #3709

merged 4 commits into from
Oct 14, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Sep 7, 2020

This PR contains a few small tweaks to things that affect how OpenShot operates very minimally, if at all.

  • Added one more that does technically change functionality, though the change should be invisible to users. (And I've been wanting to do it for a while now.) By styling the div.playhead-top element that holds the playhead "handle" with a margin-left: -12px, and tweaking some of the other playhead component positioning to match, the playhead's "anchor" point is moved to its center, instead of being at its left edge. This means that all of the $scope.playheadOffset adjustments the code makes become completely unnecessary. So, this PR applies that negative margin change, and removes $scope.playheadOffset from all of the calculations where it was being used (as well as removing the variable from the scope itself), making for slightly simpler, cleaner code.
  • A small fix to the WebKit backend, which has been injecting the Qt MainWindow object into the JavaScript environment (as mainWindow). That's a lot of data to inject, because main_window.py creates a big, heavy object full of bindings and local storage.
    But then mainWindow is never once used for anything on the JS side, making it totally unnecessary. Gone now.
  • A few references to src/images/AudioThumbnail.png were all changed to reference src/images/AudioThumbnail.svg, as the PNG version now only exists in the resource file. This mostly only affects the Timeline debug mode when it's running in a web browser, though technically most of the references appeared in the Python code. I'm reasonably sure those were only used as fallback/legacy paths, though, from before the thumbnail server.
  • I removed several files from src/timeline/media/images/ that aren't used for anything. (For the most part, they never really were. These were early development versions, dating back to 2014 with no changes since, of things that went in a different direction. Like a first-draft set of effect icons, before that design morphed into the HTML-based "Skittles" we use today.)

- The .png file only exists in the Qt resource file, since the
  image resources were moved out of the packaged tree.
  The SVG version is still present in src/images/.
@ferdnyc ferdnyc changed the title WebKit: Don't inject mainWindow into JS (not used) A few small timeline fixes Sep 8, 2020
- By styling the playhead_top div with `margin-left: -12px` and
  adjusting the position of the other playhead components accordingly,
  the need for a `playheadOffset` scope variable can be completely
  eliminated. All of its positioning code becomes slightly simpler.
@ferdnyc ferdnyc added the timeline An issue or PR involving the HTML/JS/CSS timeline implementation label Sep 8, 2020
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Oct 14, 2020

Merging, as these are all nice-to-haves and should hopefully be pretty unobjectionable.

@ferdnyc ferdnyc merged commit 3d8d2bc into OpenShot:develop Oct 14, 2020
@ferdnyc ferdnyc deleted the no-js-mainwin branch October 14, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
timeline An issue or PR involving the HTML/JS/CSS timeline implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant