Forums
Hi Rui, if you want to incorporate it it seems to work fine.
I just had to add the setCursor to your implementation.
Attached is qtractorMidiEditorForm.cpp
___Note:
I have also implemented the click animation (2px cursor offset). Curiously, the cursor size had to be increased for it to work. It doesn't work with native icons but it does with the theme icons. This is certainly a minor thing, and also a bit of a mystery.
___
line 717
if (!pOptions->bMidiEditMode) { m_ui.editModeOffAction->setChecked(true); m_pMidiEditor->unsetCursor(); } else { if (!pOptions->bMidiEditModeDraw) { m_ui.editModeOnAction->setChecked(true); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeOn").pixmap(32), 3, 20)); } else { m_ui.editModeDrawAction->setChecked(true); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeDraw").pixmap(32), 3, 20)); } }
line 1579
// Toggle edit-mode on. void qtractorMidiEditorForm::editModeOn ( bool bOn ) { // m_pMidiEditor->setEditModeDraw(false); if (bOn && m_pMidiEditor->isEditMode() && !m_pMidiEditor->isEditModeDraw()) { m_ui.editModeOffAction->setChecked(true); m_pEditModeToolButton->setDefaultAction( m_pEditModeActionGroup->checkedAction()); m_pMidiEditor->setEditMode(false); m_pMidiEditor->unsetCursor(); } else { m_pMidiEditor->setEditModeDraw(!bOn); m_pMidiEditor->setEditMode(bOn); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeOn").pixmap(32), 3, 20)); } m_pMidiEditor->updateContents(); stabilizeForm(); } // Toggle edit-mode off. void qtractorMidiEditorForm::editModeOff ( bool bOn ) { // m_pMidiEditor->setEditModeDraw(false); if (bOn && !m_pMidiEditor->isEditMode()) { if (m_pMidiEditor->isEditModeDraw()) { m_ui.editModeDrawAction->setChecked(true); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeDraw").pixmap(32), 3, 20)); } else { m_ui.editModeOnAction->setChecked(true); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeOn").pixmap(32), 3, 20)); } m_pEditModeToolButton->setDefaultAction( m_pEditModeActionGroup->checkedAction()); m_pMidiEditor->setEditMode(true); } else { m_pMidiEditor->setEditMode(!bOn); m_pMidiEditor->unsetCursor(); } m_pMidiEditor->updateContents(); stabilizeForm(); } // Toggle draw-mode (notes) void qtractorMidiEditorForm::editModeDraw ( bool bOn ) { // m_pMidiEditor->setEditModeDraw(bOn); if (bOn && m_pMidiEditor->isEditMode() && m_pMidiEditor->isEditModeDraw()) { m_ui.editModeOnAction->setChecked(true); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeOn").pixmap(32), 3, 20)); m_pEditModeToolButton->setDefaultAction( m_pEditModeActionGroup->checkedAction()); m_pMidiEditor->setEditModeDraw(false); } else { m_pMidiEditor->setEditModeDraw(bOn); m_pMidiEditor->setCursor(QCursor(QIcon::fromTheme("editModeDraw").pixmap(32), 3, 20)); m_pMidiEditor->setEditMode(bOn); } m_pMidiEditor->updateContents(); stabilizeForm(); }
File attachments
New Drupal bug detected
The new drupal does not show attachments in the topic header. I attached qtractorMidiEditorForm it in this comment.
re. New Drupal bug detected...
yeah, but they show up when editing the topic though, or doesn't it?
hmm...
EDIT: fixed now (see above). thanks
re. Cursor on tool selection implemented...
hi, thanks
one thing, you'll need to test as well, is how the cursor behaves in presence to keyboard modifiers like [Shift] and/or [Ctrl] and whether it resets to correct shape when entering or leaving the modified mode, view panes, windows and what not...
IIRC. it used to get stuck on some erroneous cursor shape at random, which is far worse than the current status quo. :)
cheers
UPDATE: in a slightly different approach, yet applicable when hovering the proper view-ports only, please check qtractor >= 1.5.2.11git.74ae6e [develop]. thanks
Add new comment