fix totally incorrect use of GdkCursor; use standard cursors in canvas piano roll header
This commit is contained in:
parent
d2a3450e2f
commit
b9b3e75b5c
@ -37,6 +37,7 @@
|
|||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "midi_view.h"
|
#include "midi_view.h"
|
||||||
#include "midi_view_background.h"
|
#include "midi_view_background.h"
|
||||||
|
#include "mouse_cursors.h"
|
||||||
#include "prh.h"
|
#include "prh.h"
|
||||||
#include "editing_context.h"
|
#include "editing_context.h"
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
@ -630,21 +631,19 @@ PianoRollHeader::motion_handler (GdkEventMotion* ev)
|
|||||||
|
|
||||||
if (!_scroomer_drag && ev->x < _scroomer_size){
|
if (!_scroomer_drag && ev->x < _scroomer_size){
|
||||||
|
|
||||||
Gdk::Cursor m_Cursor;
|
double scroomer_top = max (1.0, (1.0 - ((_adj.get_value()+_adj.get_page_size()) / 127.0)) * get().height());
|
||||||
double scroomer_top = max(1.0, (1.0 - ((_adj.get_value()+_adj.get_page_size()) / 127.0)) * get().height());
|
|
||||||
double scroomer_bottom = (1.0 - (_adj.get_value () / 127.0)) * get().height();
|
double scroomer_bottom = (1.0 - (_adj.get_value () / 127.0)) * get().height();
|
||||||
|
double edge = 5. * UIConfiguration::instance().get_ui_scale();
|
||||||
|
|
||||||
if (evd.y > scroomer_top - 5 && evd.y < scroomer_top + 5){
|
if (evd.y > scroomer_top - 5 && evd.y < scroomer_top + edge){
|
||||||
m_Cursor = Gdk::Cursor (Gdk::TOP_SIDE);
|
_view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_top);
|
||||||
_view->editing_context().push_canvas_cursor (&m_Cursor);
|
|
||||||
_scroomer_state = TOP;
|
_scroomer_state = TOP;
|
||||||
} else if (evd.y > scroomer_bottom - 5 && evd.y < scroomer_bottom + 5){
|
} else if (evd.y > scroomer_bottom - edge && evd.y < scroomer_bottom + edge){
|
||||||
m_Cursor = Gdk::Cursor (Gdk::BOTTOM_SIDE);
|
_view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->resize_bottom);
|
||||||
_view->editing_context().push_canvas_cursor (&m_Cursor);
|
|
||||||
_scroomer_state = BOTTOM;
|
_scroomer_state = BOTTOM;
|
||||||
} else {
|
} else {
|
||||||
|
_view->editing_context().push_canvas_cursor (_view->editing_context().cursors()->grabber);
|
||||||
_scroomer_state = MOVE;
|
_scroomer_state = MOVE;
|
||||||
_view->editing_context().pop_canvas_cursor ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user