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

Track operations fixes and other stuff. #3878

Merged
merged 4 commits into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions data/themes/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,28 +320,26 @@ TrackOperationsWidget > QPushButton {
min-height: 26px;
min-width: 26px;
background: none;
border:none;
border: none;
}

TrackOperationsWidget > QPushButton::menu-indicator {
image: url(resources:trackop.png);
subcontrol-origin: padding;
subcontrol-position: center;
position: relative;
top: 2px;
top: 1px;
}

TrackOperationsWidget > QPushButton::menu-indicator:hover {
image: url(resources:trackop_h.png);
}


TrackOperationsWidget > QPushButton::menu-indicator:pressed,
TrackOperationsWidget > QPushButton::menu-indicator:checked
{
TrackOperationsWidget > QPushButton::menu-indicator:checked {
image: url(resources:trackop_c.png);
position: relative;
top: 3px;
top: 2px;
}

/* actually has no effect yet so disabled */
Expand Down
14 changes: 4 additions & 10 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,14 @@ TrackOperationsWidget > QPushButton::menu-indicator {
subcontrol-origin: padding;
subcontrol-position: center;
position: relative;
top: 2px;
}

TrackOperationsWidget > QPushButton::menu-indicator:hover {
image: url(resources:trackop_h.png);
top: 1px;
}


TrackOperationsWidget > QPushButton::menu-indicator:pressed,
TrackOperationsWidget > QPushButton::menu-indicator:checked
{
image: url(resources:trackop_c.png);
TrackOperationsWidget > QPushButton::menu-indicator:checked {
image: url(resources:trackop.png);
position: relative;
top: 3px;
top: 2px;
}

/* font sizes */
Expand Down
Binary file added data/themes/default/track_op_grip_c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed data/themes/default/trackop_c.png
Binary file not shown.
Binary file removed data/themes/default/trackop_h.png
Binary file not shown.
25 changes: 14 additions & 11 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,12 +1667,6 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
QWidget( parent ), /*!< The parent widget */
m_trackView( parent ) /*!< The parent track view */
{
if( s_grip == NULL )
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip" ) );
}

ToolTip::add( this, tr( "Press <%1> while clicking on move-grip "
"to begin a new drag'n'drop-action." ).arg(
#ifdef LMMS_BUILD_APPLE
Expand Down Expand Up @@ -1795,14 +1789,17 @@ void TrackOperationsWidget::paintEvent( QPaintEvent * pe )

if( m_trackView->isMovingTrack() == false )
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip" ) );

p.drawPixmap( 2, 2, *s_grip );
m_trackOps->show();
m_muteBtn->show();
}
else
{
m_trackOps->hide();
m_muteBtn->hide();
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip_c" ) );

p.drawPixmap( 2, 2, *s_grip );
}
}

Expand Down Expand Up @@ -2713,6 +2710,12 @@ void TrackView::dropEvent( QDropEvent * de )
*/
void TrackView::mousePressEvent( QMouseEvent * me )
{
if( me->x()>10 ) // 10 = The width of the grip + 2 pixels to the left and right.
Copy link
Member

Choose a reason for hiding this comment

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

This breaks horizontal track resizing. I think this check should be moved to below.

{
QWidget::mousePressEvent( me );
return;
}

// If previously dragged too small, restore on shift-leftclick
if( height() < DEFAULT_TRACK_HEIGHT &&
me->modifiers() & Qt::ShiftModifier &&
Expand Down Expand Up @@ -2745,7 +2748,7 @@ void TrackView::mousePressEvent( QMouseEvent * me )
{
m_action = MoveTrack;
Copy link
Member

Choose a reason for hiding this comment

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

To here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested. Fixes the issue as expected.

Copy link
Member Author

Choose a reason for hiding this comment

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

Direct commit or PR?

Copy link
Member

Choose a reason for hiding this comment

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

Direct commit looks fine.

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 via e8debf9. 👍


QCursor c( Qt::SizeAllCursor );
QCursor c( Qt::SizeVerCursor );
QApplication::setOverrideCursor( c );
// update because in move-mode, all elements in
// track-op-widgets are hidden as a visual feedback
Expand Down