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

Limit the automation-editor scaled-level tooltip to the grid #4308

Merged
merged 6 commits into from
Apr 26, 2018
Merged

Limit the automation-editor scaled-level tooltip to the grid #4308

merged 6 commits into from
Apr 26, 2018

Conversation

husamalhomsi
Copy link
Member

Fixes #3746.

@zonkmachine
Copy link
Member

Here is another issue that sounds AutomationEditor::drawCross() related: #2714

@@ -173,6 +173,7 @@ protected slots:

// some constants...
static const int SCROLLBAR_SIZE = 12;
static const int LEFT_MARGIN = 63;
Copy link
Member

Choose a reason for hiding this comment

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

I guess you can calculate the left margin using VALUES_WIDTH.

Copy link
Member Author

Choose a reason for hiding this comment

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

As in using VALUES_WIDTH instead of LEFT_MARGIN in drawCross()?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, though it doesn't need to be simple replacing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 19b0342.

QToolTip::showText( tt_pos, QString::number( scaledLevel ), this );

// Limit the scaled-level tooltip to the grid
if( mouse_pos.x() > LEFT_MARGIN &&
Copy link
Member

Choose a reason for hiding this comment

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

Why did you put a tab inside parentheses instead of a space?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mistake. Fixed in d1dfe32.

@@ -1099,8 +1098,8 @@ inline void AutomationEditor::drawCross( QPainter & p )
float scaledLevel = m_pattern->firstObject()->scaledValue( level );

// Limit the scaled-level tooltip to the grid
if( mouse_pos.x() > LEFT_MARGIN &&
mouse_pos.x() < right_margin &&
if( mouse_pos.x() > VALUES_WIDTH - 1 && // left_margin
Copy link
Member

Choose a reason for hiding this comment

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

I think VALUES_WIDTH would be better, because it matches the limit area to where you can edit points.

Copy link
Member Author

Choose a reason for hiding this comment

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

At VALUES_WIDTH - 1, the cross' vertical line is visible, so the scaled-level tooltip should show there.

@husamalhomsi
Copy link
Member Author

Here is another issue that sounds AutomationEditor::drawCross() related: #2714

It is. It can be fixed with similar checks, so I will do it here.

@husamalhomsi
Copy link
Member Author

@zonkmachine After some thinking, I don't think d127517 is the best way to fix #2714. It feels clunky, and it's somewhat out of scope. I will try to fix it in a different way, but not here.
That being said, I will finish this tomorrow.

@husamalhomsi husamalhomsi merged commit 386c471 into LMMS:stable-1.2 Apr 26, 2018
@husamalhomsi husamalhomsi deleted the fix/AE-drawCross branch June 8, 2018 22:09
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
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.

3 participants