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

Theme Refactoring (including WIP Theme) #5487

Open
wants to merge 62 commits into
base: develop
Choose a base branch
from
Open

Conversation

jonoomph
Copy link
Member

@jonoomph jonoomph commented Mar 27, 2024

In an effort to update the user-interface for OpenShot, first our theme engine needs some major refactoring.

Theme Engine

The current theme engine for OpenShot is really just a few lines of hard-coded stylesheet that is very difficult to work with. We need to refactor this into Classes, which can inherit some base theme properties, etc... We want new themes to be very easy to switch between, and we want real-time theme switching.

Timeline Refactor

We currently support 2 different webview-based timeline widgets (QWebKit and QWebEngine), and we will eventually replace both of these with a QWidget-based timeline widget. In the meantime, we need to refactor the timeline code to support a 3rd widget (experimental placeholder currently), and clean-up the timeline-related code as much as possible. This will be a gradual change-over, since much work remains on the new QWidget timeline widget. This will eventually be a huge simplification on how our timeline works, improved performance when editing projects, huge reduction in our download size, and a more feature-full timeline widget, which of course is also theme-able (due to this new theme engine).

New Theme

Part of this PR includes some initial work on a new UI theme for OpenShot. This is very early and should not be used by normal users yet. We have very detailed mock-ups and work-flows that we are moving towards, but it will be an iterative process before we switch the default theme.

- ThemeName ENUM (with all theme names)
- ThemeManager Singleton
- Theme Base class (to reset theme)
- Theme classes for each unique UI theme: No Theme, Humanity, Humanity: Dark, and Cosmic Dusk (out new theme)
- Cosmic Dusk theme still needs lots of work
- Known Issue: When changing themes on the Preferences window, some widget styles do not refresh until the window is closed/re-opened
- Renaming some dock widgets in the *.ui file
- Updating translation system to support Theme names
- Apply video widget background from current palette and not a hard-coded color
…onal testing of a non-webview timeline widget. For now though, it's a blank QWidget.
… Pixel size. Attempting to make font clearer on Windows.
… compatible with the existing TimelineView loading logic. So, whether a webview or qwidget backend is used, it is initialized mostly the same.
…lify the top of the timeline view file. Also, optimizing imports (removing unused imports)
…qwidget instead, for testing the new timeline widget backend.
# Conflicts:
#	src/language/OpenShot/OpenShot.pot
#	src/windows/views/timeline.py
…lar controller to top of document (so dynamic style tags are possible). Updating light theme and cosmic themes to better integrate web-view based timeline widgets.
@jonoomph
Copy link
Member Author

…enu theming, web-view timeline scrollbar colors
…d corners and border color. Fixed some QMenu padding issues. Styled QTreeView and QListView in Cosmic Dust theme.
…ion, which can completly remove margins from a specific dock (i.e. timeline).

- Refactored audio waveform display on timeline (simpler, cleaner, easier to debug, aligned with bottom of clip).
- Added keyframe icons to Cosmic Dust theme
- More Cosmic Dust theme improvements (no margin timeline, smaller tracks / clips, improved clip CSS)
- Note: webkit rendering is broken in Cosmic Dust theme.
…tly show thumbnail and waveform without padding or resizing)
…tLocation function. Dragging files onto timeline now works in all themes, and works with better "diff" calculations for nearest track to drop the clip on.
…ues with track snapping when dragging + scrollbar changes.

- Shrinking transitions style for Cosmic Dust theme to fit on track.
- Update track Y coordinates after a theme change, to make sure different size tracks from different themes still function correctly.
- Improved snapping to prevent multi-layer selections from moving past the bottom of the timeline.
…move playhead when dragging one of these items (or resizing them). For example, if you start to drag a clip, and while dragging move your mouse up onto the timeline ruler.
…ving a redundant method. Fixing small regression in clip.js (missing variable).
…ight keyframe icons to be more visible (blue). Fixed transition render artifacts.
- Styled export and file properties tabs and toolboxes
…track snapping (feels better)

- Fixed regression on Track location for dropping Effects
- Added Track height to layers at runtime, for accurate track detection from different themes
- Default to "Humanity Dark" if theme name not found
- Updated video widget to use correct background color per theme
- If old theme not found, update settings to Humanity: Dark
- Renamed "Humanity" to "Fresh" (might rename it again though)
- Replaced marker and playhead on Fresh and Humanity themes (red thicker line, easier to see markers under it)
- Added marker tools and new icons for Cosmic Dusk theme
- Made markers clickable (seeks to marker)
- Removed dynamic marker src loading (we don't use it)
- Reverting Key Point language back to Marker (for consistency)
- Added 3 marker tool buttons to Cosmic Dusk theme
…n themes

- Update color of marker for old themes (humanity and fresh)
- Replace video playback icons in Cosmic theme
- Update method to swap icons when play/puse is clicked
…n resolution (if possible). Smaller pics can be scaled more, Larger pics can be scaled less (to prevent crashes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant