More flexible timeline themes

Bug #499860 reported by Gašper Sedej
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenShot Video Editor
Fix Released
Wishlist
Unassigned

Bug Description

Hi!

I must say that Timeline in Openshot is really nice. But I think that is too fat. To much space between timelines, too fat time ruler.

I would be very helpful, if there would be more thumbnails for each clip - user could see which part of clip is where

Tags: patch

Related branches

Revision history for this message
markba (mark-baaijens) wrote :

This is slightly related to this bug: https://bugs.launchpad.net/openshot/+bug/440929
What connects them, is that OS uses to much screen space for static elements. If this is reduced, more space is available for dynamic elements, where the 'work' actually takes place.

Andy Finch (fincha)
Changed in openshot:
importance: Undecided → Wishlist
Revision history for this message
Jonathan Tan (yondalf) wrote :

I would like to help work on this bug by reducing the vertical space requirements of the whole timeline widget. I've attached my work in progress so far, but would like some more discussion (and/or approval from the lead developers) before continuing.

Revision history for this message
Jonathan Tan (yondalf) wrote :

A new theme (very incomplete, derived from the "elementary" theme) with single-pixel borders that I've made. Together with the earlier patch, I think we could shrink things further (by removing margins etc.).

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

I think the best approach for this is to make the various elements dynamic based on the height of the "theme" images. For example, some themes might want big fat clips and a skinny timeline ruler, while others want a fat timeline ruler and skinny clips/tracks, etc...

There is a bit of hard-coding on the heights of the ruler, track, and clips. I would suggest we get the height of each Theme image (ruler, play-head, track, and clip), and dynamically size the interface elements based on those heights. There are many hard-coded sizes hidden around the code, so this will not be easy. =)

Revision history for this message
Jonathan Thomas (jonoomph) wrote :

One more thought: While we are changing the way the timeline is drawn, we might want to introduce a simple XML config file for each theme, that would control the following timeline-related things:

1) fonts - size/face/color/bold
2) spacing - between tracks
3) transitions color
4) etc...

Revision history for this message
hva (francesco-hermanitosverdes) wrote :

I agree :)

Revision history for this message
Jonathan Tan (yondalf) wrote :

For the XML, I notice that OpenShot currently uses xml.dom.minidom for all its XML parsing needs. Is it OK if I use xml.etree.ElementTree? It's a new module that comes with Python 2.5 (and above). The version of Python included with Ubuntu 8.04 (which is your earliest supported version of Ubuntu?) is Python 2.5, so I don't think this will incur any additional dependencies.

The advantage of ElementTree is that it has a (partial) implementation of XPath, which allows me to do
tree.find("body/p") # (from the sample)
rather than
tree.getElementsByTagName("body")[0].getElementsByTagName("p")[0] # (not sure of exact API, typing this from what I remember of DOM)

I'll get started anyway. Yup the current metrics are hardcoded, but it seems like they are all in clip.py (and the relevant files that draw the ruler and the whole timeline) so hopefully this won't be an insurmountable task.

Changed in openshot:
assignee: nobody → Jonathan Tan (yondalf)
status: New → In Progress
Revision history for this message
Jonathan Thomas (jonoomph) wrote : Re: [Openshot.developers] [Bug 499860] Re: Timeline too fat

Sure, xml.etree.ElementTree should be fine. The settings are in more
than just the clip.py file. Here is a list off the top of my head:

MainGTK.glade: heights and widths of scrolled-windows (used as the
container for the ruler, timeline, and track titles.
MainGTK.py: heights and widths of the goocanvas objects, used to draw everything
Sequences.py: code to draw the ruler
Track.py: code to draw the track backgrounds and track titles
Clip.py: code to render a clip
Transition.py: code to render a transition

Thanks,
-Jonathan

On Mon, Feb 22, 2010 at 8:52 PM, Jonathan Tan <email address hidden> wrote:
> For the XML, I notice that OpenShot currently uses xml.dom.minidom for
> all its XML parsing needs. Is it OK if I use xml.etree.ElementTree? It's
> a new module that comes with Python 2.5 (and above). The version of
> Python included with Ubuntu 8.04 (which is your earliest supported
> version of Ubuntu?) is Python 2.5, so I don't think this will incur any
> additional dependencies.
>
> The advantage of ElementTree is that it has a (partial) implementation of XPath, which allows me to do
> tree.find("body/p") # (from the sample)
> rather than
> tree.getElementsByTagName("body")[0].getElementsByTagName("p")[0] # (not sure of exact API, typing this from what I remember of DOM)
>
> I'll get started anyway. Yup the current metrics are hardcoded, but it
> seems like they are all in clip.py (and the relevant files that draw the
> ruler and the whole timeline) so hopefully this won't be an
> insurmountable task.
>
>
> ** Changed in: openshot
>     Assignee: (unassigned) => Jonathan Tan (yondalf)
>
> ** Changed in: openshot
>       Status: New => In Progress
>
> --
> Timeline too fat
> https://bugs.launchpad.net/bugs/499860
> You received this bug notification because you are a member of OpenShot
> Developers, which is subscribed to OpenShot Video Editor.
>
> Status in OpenShot Video Editor: In Progress
>
> Bug description:
> Hi!
>
> I must say that Timeline in Openshot is really nice. But I think that is too fat. To much space between timelines, too fat  time ruler.
>
> I would be very helpful, if there would be more thumbnails for each clip - user could see which part of clip is where
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openshot.developers
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~openshot.developers
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Jonathan Tan (yondalf) wrote : Re: Timeline too fat

Thanks.

I'll probably not change the main widget dimensions in MainGTK.{glade,py}, but I'll definitely look at the rest.

Revision history for this message
Jonathan Tan (yondalf) wrote :

My current work. (This patch is ready for review.)

- Refactored and changed clip rendering to take coordinates from XML.
- Changed track rendering to take coordinates from XML.
- Added XML configuration to all existing themes.

Hopefully this will give theme authors more flexibility.

Revision history for this message
Jonathan Tan (yondalf) wrote :

A screenshot of what's possible with the new theme capabilities. (Also, it reduces the vertical space consumed by the timeline.)

Revision history for this message
Jonathan Tan (yondalf) wrote :

And the new theme that is on the right side of the above screenshot (this is not included in the patch). (In Launchpad, you can only have one attachment per comment?)

Extract this to the themes/ folder if you want to try it out (but patch openshot first with the above patch).

Revision history for this message
Olivier Girard (eolinwen) wrote :

Hi Jonathan

Launchpad is not done for this genre of things. You could post and speak too of your work on the OpenshotUsers Community here: http://openshotusers.com/
And you have in the forum (at left), a special section called Themes (here the link : http://openshotusers.com/forum/viewforum.php?f=23) specially made for that. You 'll see that your theme will be not alone.
Thanks
Olivier

Revision history for this message
Jonathan Tan (yondalf) wrote : Re: [Bug 499860] Re: Timeline too fat

Oh...I was contributing a patch that would reduce the vertical space
taken up by the timeline (see a few messages up) by allowing theme
authors to change the locations of the UI components by an XML file.
The theme was just to show an example of what a "slim" theme would
look like (if such configuration is supported, so the patch has to be
applied).

Revision history for this message
Olivier Girard (eolinwen) wrote : Re: Timeline too fat

oh sorry for the patch it is here effectively, that's right. I was believing that you don't know where to put the theme. In all cases, now we know both.

Revision history for this message
Jonathan Thomas (jonoomph) wrote : Re: [Openshot.developers] [Bug 499860] Re: Timeline too fat

Thanks! I'll take a look and review this soon.

On Sat, Feb 27, 2010 at 7:56 AM, cenwen <email address hidden> wrote:

> oh sorry for the patch it is here effectively, that's right. I was
> believing that you don't know where to put the theme. In all cases, now
> we know both.
>
> --
> Timeline too fat
> https://bugs.launchpad.net/bugs/499860
> You received this bug notification because you are a member of OpenShot
> Developers, which is subscribed to OpenShot Video Editor.
>
> Status in OpenShot Video Editor: In Progress
>
> Bug description:
> Hi!
>
> I must say that Timeline in Openshot is really nice. But I think that is
> too fat. To much space between timelines, too fat time ruler.
>
> I would be very helpful, if there would be more thumbnails for each clip -
> user could see which part of clip is where
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openshot.developers<https://launchpad.net/%7Eopenshot.developers>
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openshot.developers<https://launchpad.net/%7Eopenshot.developers>
> More help : https://help.launchpad.net/ListHelp
>

moimael (moimael)
Changed in openshot:
milestone: none → 1.2.0
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

I have finished work on the new theme system, which was based on the patch from Jonathan Tan. Although I ended up rewriting most of the patch, I used the patch as my inspiration. =) I took the idea a bit further than the original patch, and refactored much of the settings code.

Basically, everything that is drawn on the timeline can now be adjusted in the "theme.xml" file, which is located in each theme's folder. Fonts, colors, borders, padding, and even the height of the ruler can be adjusted... as well as the width of the track names. It will be fun to see what kind of themes are created around this feature. =)

I will attach an example of what can be changed in the new theme.xml file.

summary: - Timeline too fat
+ More flexible timeline themes
Changed in openshot:
assignee: Jonathan Tan (yondalf) → nobody
status: In Progress → Fix Committed
Revision history for this message
Jonathan Thomas (jonoomph) wrote :

Here is what the "theme.xml" file evolved into.

Revision history for this message
Jonathan Tan (yondalf) wrote : Re: [Bug 499860] Re: More flexible timeline themes

Looks good :-) Yeah, I kind of expected the patch to be rewritten to
match the project's coding style. But the improvements are nice.

Andy Finch (fincha)
Changed in openshot:
status: Fix Committed → Fix Released
tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.