Skip to content

Commit

Permalink
Track operations fixes and other stuff. (#3878)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussam Eddin Alhomsi authored and tresf committed Nov 15, 2017
1 parent 77b4985 commit 6f305a6
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 27 deletions.
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 @@ -1702,12 +1702,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 @@ -1830,14 +1824,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 @@ -2748,6 +2745,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.
{
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 @@ -2780,7 +2783,7 @@ void TrackView::mousePressEvent( QMouseEvent * me )
{
m_action = MoveTrack;

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

0 comments on commit 6f305a6

Please sign in to comment.