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
It works, but it's not perfect
It only updates when you move the mouse. And that can be confusing.
When you activate from keyboard shortcuts you get the feeling that the tool hasn't changed.
Could the new "setEditCursor" method be used from qtractorMidiEditorForm.cpp?
The same thing I've done but using the setEditCursor method instead of the generic setCursor, and so it would update with any changes immediately only in the areas it should.
I've tried it and it doesn't work... Getting it would be the perfect experience.
But if it can't be done, what's already there is a great improvement and I'm grateful :).
Add new comment