Added a custom window splitter for Qt Tas editor to better control sizing of right panel.
This commit is contained in:
parent
ede8c5fc7e
commit
0badec6124
|
@ -193,7 +193,7 @@ TasEditorWindow::TasEditorWindow(QWidget *parent)
|
|||
resize(512, 512);
|
||||
|
||||
mainLayout = new QVBoxLayout();
|
||||
mainHBox = new QSplitter( Qt::Horizontal );
|
||||
mainHBox = new TasEditorSplitter();
|
||||
|
||||
initPatterns();
|
||||
buildPianoRollDisplay();
|
||||
|
@ -7348,3 +7348,50 @@ bool markerDragPopup::eventFilter( QObject *obj, QEvent *event)
|
|||
return false;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
//---- TAS Window Main Horizontal Splitter
|
||||
//----------------------------------------------------------------------------
|
||||
TasEditorSplitter::TasEditorSplitter( QWidget *parent )
|
||||
: QSplitter( Qt::Horizontal, parent )
|
||||
{
|
||||
panelInitDone = false;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
TasEditorSplitter::~TasEditorSplitter(void)
|
||||
{
|
||||
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void TasEditorSplitter::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
int minWidth;
|
||||
//int widthDelta;
|
||||
QList<int> panelWidth;
|
||||
|
||||
//printf("Panel Resize\n");
|
||||
if ( !panelInitDone )
|
||||
{
|
||||
QSplitter::resizeEvent(event);
|
||||
panelInitDone = true;
|
||||
return;
|
||||
}
|
||||
//widthDelta = event->size().width() - event->oldSize().width();
|
||||
|
||||
panelWidth = sizes();
|
||||
|
||||
|
||||
//for (int i=0; i<panelWidth.count(); i++)
|
||||
//{
|
||||
// printf("Panel %i: %i\n", i, panelWidth[i] );
|
||||
//}
|
||||
panelWidth[0] = event->size().width() - panelWidth[1] - handleWidth();
|
||||
//panelWidth[0] += widthDelta;
|
||||
|
||||
minWidth = widget(0)->minimumWidth();
|
||||
|
||||
if ( panelWidth[0] < minWidth )
|
||||
{
|
||||
panelWidth[0] = minWidth;
|
||||
}
|
||||
setSizes( panelWidth );
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -373,6 +373,20 @@ class TasFindNoteWindow : public QDialog
|
|||
void searchPatternChanged(const QString &);
|
||||
};
|
||||
|
||||
class TasEditorSplitter : public QSplitter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TasEditorSplitter(QWidget *parent = 0);
|
||||
~TasEditorSplitter(void);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
|
||||
bool panelInitDone;
|
||||
};
|
||||
|
||||
class TasEditorWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -445,7 +459,7 @@ class TasEditorWindow : public QDialog
|
|||
QAction *showToolTipsAct;
|
||||
QAction *autoLuaAct;
|
||||
|
||||
QSplitter *mainHBox;
|
||||
TasEditorSplitter *mainHBox;
|
||||
QFrame *pianoRollFrame;
|
||||
QWidget *pianoRollContainerWidget;
|
||||
QWidget *controlPanelContainerWidget;
|
||||
|
|
Loading…
Reference in New Issue