Skip to content

rename tracks directly on TrackLableButton in a QLineEdit - #2916

Merged
jasp00 merged 1 commit into
LMMS:masterfrom
BaraMGB:renameLineEdit
Jul 21, 2016
Merged

rename tracks directly on TrackLableButton in a QLineEdit#2916
jasp00 merged 1 commit into
LMMS:masterfrom
BaraMGB:renameLineEdit

Conversation

@BaraMGB

@BaraMGB BaraMGB commented Jul 14, 2016

Copy link
Copy Markdown
Contributor

renametrack

With this one we can edit the track name directly in the track. This avoids a dialog window.

@tresf

tresf commented Jul 14, 2016

Copy link
Copy Markdown
Member

👍 👍

@BaraMGB

BaraMGB commented Jul 14, 2016

Copy link
Copy Markdown
Contributor Author

I cleaned up the code a little bit.

@jasp00

jasp00 commented Jul 15, 2016

Copy link
Copy Markdown
Member

I get these errors when using compact track buttons:

QWidget::setMinimumSize: (/QLineEdit) Negative sizes (-1,0) are not possible
QWidget::setMaximumSize: (/QLineEdit) Negative sizes (-1,16777215) are not possible

@BaraMGB

BaraMGB commented Jul 16, 2016

Copy link
Copy Markdown
Contributor Author

@jasp00 Thank you for revisiting this PR. I have exclude the resize in case of compact track buttons now.

Comment thread src/gui/widgets/TrackLabelButton.cpp Outdated
setFixedSize( 160, 29 );
m_renameLineEdit = new QLineEdit(this);
m_renameLineEdit->move( 30, (height() / 2) - ( m_renameLineEdit->sizeHint().height() / 2 ) );
m_renameLineEdit->setFixedWidth( this->width() - 33 );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this->width() instead of width()?

@BaraMGB

BaraMGB commented Jul 20, 2016

Copy link
Copy Markdown
Contributor Author

Why this->width() instead of width()?

Updated

@jasp00
jasp00 merged commit 7a98b3e into LMMS:master Jul 21, 2016
@Umcaruje

Copy link
Copy Markdown
Member

@BaraMGB Should this also get reworked to use a disabled QLineEdit like #2918?

@BaraMGB

BaraMGB commented Jul 24, 2016

Copy link
Copy Markdown
Contributor Author

@Umcaruje no, the button is labeled with setText(). That's no QLabel or PaintEvent.

@tresf

tresf commented Jul 24, 2016

Copy link
Copy Markdown
Member

^ right. The difference here is we have a button object already that we're working from, which would make the task much more difficult. In the case of the Mixer, it was just a label, making the consolidation a no-brainer.

One could argue to abolish the button altogether, but then the button-press behavior would have to be painted, we'd essentially find ourselves making a new button-like class and the underlying logic would look very much like what's been done already.

@Umcaruje I had thought of that too when I made the recommendation on the Mixer and then realized it's a button paint (or in this case a setText(...)) and not much we could do. 👍

@midi-pascal

Copy link
Copy Markdown
Contributor

Just to let you know: if a track or a fx is renamed Lmms does not consider the project as modified.
You can quit with no question about saving...

sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
rename tracks directly on TrackLableButton in a QLineEdit
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.

5 participants