Track: allow smaller height

Here's one way to cram more stuff onto small screens, or otherwise help
reducing visual clutter: Allow tracks to be shift-dragged all the way
down to 8 px height.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Raine M. Ekman
2012-11-01 21:35:17 +01:00
committed by Tobias Doerffel
parent e7605ea045
commit 69947a624b
3 changed files with 46 additions and 16 deletions

View File

@@ -59,6 +59,13 @@ const int TRACK_OP_WIDTH = 78;
const int DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT = 96;
const int TRACK_OP_WIDTH_COMPACT = 60;
/*! The minimum track height in pixels
*
* Tracks can be resized by shift-dragging anywhere inside the track
* display. This sets the minimum size in pixels for a track.
*/
const Uint16 MINIMAL_TRACK_HEIGHT = 8;
const Uint16 DEFAULT_TRACK_HEIGHT = 32;
const int TCO_BORDER_WIDTH = 1;
@@ -435,6 +442,13 @@ public:
using Model::dataChanged;
inline int getHeight() {
return ( m_height >= MINIMAL_TRACK_HEIGHT ? m_height : DEFAULT_TRACK_HEIGHT );
}
inline void setHeight( int _height ) {
m_height = _height;
}
public slots:
virtual void setName( const QString & _new_name )
@@ -450,6 +464,7 @@ private:
trackContainer * m_trackContainer;
TrackTypes m_type;
QString m_name;
int m_height;
BoolModel m_mutedModel;
BoolModel m_soloModel;