diff options
-rw-r--r-- | muse2/ChangeLog | 1 | ||||
-rw-r--r-- | muse2/muse/master/masteredit.cpp | 12 | ||||
-rw-r--r-- | muse2/muse/master/tscale.cpp | 12 |
3 files changed, 20 insertions, 5 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 562361c7..32d65061 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -2,6 +2,7 @@ - More drawing fixes, improved accuracy (grids, timescales, edges, markers guaranteed to align now). (Tim p4.0.30) Much drawing changed to device (pixel) space instead of virtual space, for accuracy. - Fixed display of audio automation graphs. (But not editing). (Tim) + - Fixed unreadable Master Edit tempo scale (on left side), and added toolbar saving and restoring. (Tim p4.0.31) 15.08.2011: - Remodel the Meter and the VerticalMeter (Orcan) 13.08.2011: diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 9053f3a8..fafa3b4f 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -31,6 +31,7 @@ #include <QLabel> #include <QToolBar> #include <QToolButton> +#include <QSettings> int MasterEdit::_rasterInit = 0; int MasterEdit::_widthInit = 600; @@ -43,6 +44,10 @@ QByteArray MasterEdit::_toolbarInit; void MasterEdit::closeEvent(QCloseEvent* e) { + QSettings settings("MusE", "MusE-qt"); + //settings.setValue("MasterEdit/geometry", saveGeometry()); + settings.setValue("MasterEdit/windowState", saveState()); + emit deleted((unsigned long)this); e->accept(); } @@ -94,12 +99,14 @@ MasterEdit::MasterEdit() //---------ToolBar---------------------------------- tools = addToolBar(tr("Master tools")); + tools->setObjectName("Master tools"); tools->addActions(undoRedo->actions()); EditToolBar* tools2 = new EditToolBar(this, PointerTool | PencilTool | RubberTool); addToolBar(tools2); QToolBar* enableMaster = addToolBar(tr("Enable master")); + enableMaster->setObjectName("Enable master"); enableButton = new QToolButton(); enableButton->setCheckable(true); enableButton->setText(tr("Enable")); @@ -109,6 +116,7 @@ MasterEdit::MasterEdit() connect(enableButton, SIGNAL(toggled(bool)), song, SLOT(setMasterFlag(bool))); QToolBar* info = addToolBar(tr("Info")); + info->setObjectName("Info"); QLabel* label = new QLabel(tr("Cursor")); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); @@ -235,6 +243,10 @@ MasterEdit::MasterEdit() if (!_toolbarInit.isEmpty()) restoreState(_toolbarInit); + + QSettings settings("MusE", "MusE-qt"); + //restoreGeometry(settings.value("MasterEdit/geometry").toByteArray()); + restoreState(settings.value("MasterEdit/windowState").toByteArray()); } //--------------------------------------------------------- diff --git a/muse2/muse/master/tscale.cpp b/muse2/muse/master/tscale.cpp index d37d5924..9ea34fba 100644 --- a/muse2/muse/master/tscale.cpp +++ b/muse2/muse/master/tscale.cpp @@ -20,8 +20,9 @@ TScale::TScale(QWidget* parent, int ymag) : View(parent, 1, ymag) { - setFont(config.fonts[3]); - int w = 4 * QFontMetrics(config.fonts[4]).width('0'); + setFont(config.fonts[4]); + //int w = 4 * QFontMetrics(config.fonts[4]).width('0'); + int w = 4 * fontMetrics().width('0'); setFixedWidth(w); setMouseTracking(true); } @@ -34,7 +35,7 @@ void TScale::pdraw(QPainter& p, const QRect& r) { int y = r.y(); int h = r.height(); - p.setFont(config.fonts[4]); + //p.setFont(config.fonts[4]); QString s; for (int i = 30000; i <= 250000; i += 10000) { int yy = mapy(280000 - i); @@ -44,8 +45,9 @@ void TScale::pdraw(QPainter& p, const QRect& r) continue; p.drawLine(0, yy, width(), yy); s.setNum(i/1000); - QFontMetrics fm(config.fonts[4]); - p.drawText(width() - fm.width(s) - 1, yy-2, s); + //QFontMetrics fm(config.fonts[4]); + //p.drawText(width() - fm.width(s) - 1, yy-2, s); + p.drawText(width() - fontMetrics().width(s) - 1, yy-2, s); // Use the window font. Tim p4.0.31 } } |