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

@Sawuare
Copy link
Member

@Sawuare Sawuare commented Apr 21, 2018

Fixes #3746.

@zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Apr 21, 2018

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

Loading

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

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

@PhysSong PhysSong Apr 22, 2018

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.

Loading

Copy link
Member Author

@Sawuare Sawuare Apr 22, 2018

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()?

Loading

Copy link
Member

@PhysSong PhysSong Apr 22, 2018

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.

Loading

Copy link
Member Author

@Sawuare Sawuare Apr 22, 2018

Choose a reason for hiding this comment

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

Done in 19b0342.

Loading

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

@PhysSong PhysSong Apr 22, 2018

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?

Loading

Copy link
Member Author

@Sawuare Sawuare Apr 22, 2018

Choose a reason for hiding this comment

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

Mistake. Fixed in d1dfe32.

Loading

@@ -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

@PhysSong PhysSong Apr 23, 2018

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.

Loading

Copy link
Member Author

@Sawuare Sawuare Apr 23, 2018

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.

Loading

@Sawuare
Copy link
Member Author

@Sawuare Sawuare commented Apr 24, 2018

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.

Loading

@Sawuare
Copy link
Member Author

@Sawuare Sawuare commented Apr 24, 2018

@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.

Loading

@Sawuare Sawuare merged commit 386c471 into LMMS:stable-1.2 Apr 26, 2018
1 of 2 checks passed
Loading
@Sawuare Sawuare deleted the fix/AE-drawCross branch Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants