Make the width of Tracks names adjustable

When reducing the tracks height below a certain size, the track name and the track head icons are displayed on the same line, which leaves very little space for a custom name (only 4 or 5 characters). On audio tracks you need to increase the tracks height a lot to have the name and icons on separate lines.

Would it be feasible to make the width of the Name area of the tracks heads adjustable?

I’m thinking of something like this maybe:
timeline_head_width

5 Likes

I Agree with this suggestion. Personally, I edit the ui file in Shotcut with a size of 200 (140 by default), but the ability to drag would be great.

1 Like

The full track name is in a tooltip.

I used to be able to do that too in older versions. Do you remember what file you edit?

I thought it would be that one:
\share\shotcut\qml\views\timeline > TrackHead.qml
But I don’t see that default 140 width in there…

EDIT: Ok I think I found it in:
\share\shotcut\qml\views\timeline > timeline.qml

EDIT 2

1 Like

Moi aussi, je soutiens cette suggestion.
Je pense qu’il y aurait une solution qui convienne aux développeurs et aux utilisateurs avertis, très facile à coder et qui ne change rien aux fonctions actuelles de Shotcut.

Il suffit d’ajouter une ligne “onWheel” dans le fichier timeline.qml après la ligne 189, ce qui donne

MouseArea {
    anchors.fill: parent
    acceptedButtons: Qt.LeftButton | Qt.RightButton
    onClicked: mouse => {
        timeline.selectMultitrack();
        if (mouse.button == Qt.RightButton)
            root.timelineRightClicked();
        }

    onWheel: headerWidth = Math.max(140, Math.min(250, headerWidth + wheel.angleDelta.y / 15))
}

I also support this suggestion.
I think there would be a solution that would be suitable for both developers and advanced users, very easy to code, and that doesn’t change anything about Shotcut’s current functionality.

Simply add an “onWheel” line to the timeline.qml file after line 189, which gives

MouseArea {
    anchors.fill: parent
    acceptedButtons: Qt.LeftButton | Qt.RightButton
    onClicked: mouse => {
        timeline.selectMultitrack();
        if (mouse.button == Qt.RightButton)
            root.timelineRightClicked();
        }

    onWheel: headerWidth = Math.max(140, Math.min(250, headerWidth + wheel.angleDelta.y / 15))
}

Result

2 Likes

I’m no programmer, but this looks a lot more simple than the grab/drag thing I suggested.

And it works great!
Good work. :+1:

Thanks, but the dividing line should be draggable for better user experience. Mouse wheel is not obvious and unusual.

I have implemented the draggable version for the next version. Should it be saved to configuration or project?

6 Likes

Thanks!
I’d say Project since track names will most likely be different from project to project, and often making the heads wider won’t be needed.

3 Likes

Bump on the suggestion

That will be a really useful addition, @shotcut. Thank you.

I think project but not entirely sure.

1 Like

Merci pour cette amélioration.
Personnellement, je ne suis pas convaincu qu’il faille sauver la largeur définie, on est amenés à la modifier plusieurs fois au cours du projet.
Mais tant qu’à choisir, la sauvegarde dans le projet est plus logique.

Thanks for this improvement.
Personally, I’m not convinced that saving the defined width is necessary, we’ll likely change it several times throughout the project.
But if we have to choose, saving it in the project makes more sense.

1 Like

Thanks @Shotcut for implementing this really useful improvement. Thanks to @Namna for this. :+1:

1 Like

Considering the only reason people want to adjust this is to see the track name fully, wouldn’t it be better to just automatically resize them all to fit the longest name when it’s changed? And only saved to project file if manually resized?

No

saved to project file if manually resized

Done

1 Like

@shotcut
“Adjustable timeline header width” from the nightly version works very well but there is a small issue:

When a clip is located at the very start of the Timeline, it is no more possible to grab + drag its first frame to the right (for trimming). The left edge of the clip turns green, but it’s the header that gets dragged.

@Namna worked on a way to solve the issue. But I think I’ll let him submit his changes himself.

1 Like

Voici la modification du code effectuée pour décaler sur la gauche la zone de sélection de la ligne de séparation afin qu’elle ne soit pas superposée à celle du bord gauche du clip.
J’ai ajouté en plus une modification de la couleur de la ligne (Blanc → Rouge) pour permettre à l’utilisateur de bien distinguer quelle zone est sélectionnée.

Here’s the code modification I made to shift the selection area of ​​the dividing line to the left so that it doesn’t overlap with the selection area of the left edge of the clip.
I also added a color change for the line (White → Red) to allow the user to clearly see which area is selected.

Rectangle {
    // thin dividing line between headers and tracks
    color: (headerWidth_MA.containsMouse || headerWidth_MA.pressed)? "red" : activePalette.windowText
    width: 1
    x: parent.x + parent.width
    anchors.top: parent.top
    anchors.bottom: parent.bottom
                    
    MouseArea {
        id: headerWidth_MA
        anchors.fill: parent
        anchors.leftMargin: -5
        acceptedButtons: Qt.LeftButton
        hoverEnabled: true
        drag.target: parent
        drag.axis: Drag.XAxis
        drag.minimumX: 140
        drag.maximumX: 500
        cursorShape: Qt.SizeHorCursor
        onPositionChanged: multitrack.trackHeaderWidth = Math.max(drag.minimumX, Math.min(drag.maximumX, parent.x))
    }
}
3 Likes

I tested the modification proposed by @Namna. No more issue. It works perfectly and instinctively. Great. :+1:

J’ai testé la modification proposée par @Namna. Plus de problème. Cela fonctionne parfaitement et intuitivement. Super.

1 Like

Hi @namna, I just tried your modified code in the Nightly build 250406 - works fine. Looking good!

Shotcut timeline 01

I applied the code change to fix the problem, but red is an appropriate color to use for this. That color is about selection in Shotcut and danger in general. But the color treatment for moving panel dividers will not work here because it blends in too much with video clips starting at 0. No special hover color is needed. It has a mouse cursor.

2 Likes