forked from LMMS/lmms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rework PianoRoll paintEvent + some extras * Split out PositionLine class to own file * Refactor PianoRoll Q_PROPERTYs * Reduce code by using Q_PROPERTY's MEMBER function and removing getter/setter functions After looking at the getters and setters, they did nothing different than what direct access would allow. Nothing outside of PianoRoll used the public functions as well. Considering these factors we can reduce the number of functions by 2x the number of Q_PROPERTIES, and go with direct access instead. * Remove need for keyboard pixmaps With the recent change to allow zooming vertically, aligning pixmaps is a PITA. Since we have themes which can take brushes and colors, it would be simpler to take a solid color or a gradient with some extra style properties to resize the keys and text colors. While it will slightly be a downgrade from pixmaps since they can be anything really, this will allow us to customize the piano roll further moving forward. * Added the ability to update margins for TimeLineWidget and StepRecorderWidget These take a X coordinate, which was hardcoded to WHITE_KEY_WIDTH, and never looked back. Now we can adjust on the fly if we need to. Currently this just allows us to shift the left margin to the style-defined white key width. * Fix phantom pixmaps when PianoRoll not focused * Update PositionLine class changes related to LMMS#5543
- Loading branch information
Showing
13 changed files
with
732 additions
and
768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* PositionLine.h - declaration of class PositionLine, a simple widget that | ||
* draws a line, mainly works with TimeLineWidget | ||
* | ||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public | ||
* License along with this program (see COPYING); if not, write to the | ||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA. | ||
* | ||
*/ | ||
|
||
#ifndef POSITION_LINE_H | ||
#define POSITION_LINE_H | ||
|
||
#include <QWidget> | ||
|
||
class PositionLine : public QWidget | ||
{ | ||
Q_OBJECT | ||
Q_PROPERTY(bool tailGradient MEMBER m_hasTailGradient) | ||
Q_PROPERTY(QColor lineColor MEMBER m_lineColor) | ||
public: | ||
PositionLine(QWidget* parent); | ||
|
||
public slots: | ||
void zoomChange(double zoom); | ||
|
||
private: | ||
void paintEvent(QPaintEvent* pe) override; | ||
|
||
bool m_hasTailGradient; | ||
QColor m_lineColor; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.