forked from Ivasoft/DSView
fix: draging the dso channel, but the time base be changed
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include "../appcontrol.h"
|
||||
#include "../config/appconfig.h"
|
||||
#include "../ui/fn.h"
|
||||
#include "../log.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -61,6 +62,7 @@ Header::Header(View &parent) :
|
||||
_colorFlag = false;
|
||||
_nameFlag = false;
|
||||
_context_trace = NULL;
|
||||
_mouse_is_down = false;
|
||||
|
||||
nameEdit = new QLineEdit(this);
|
||||
nameEdit->setFixedWidth(100);
|
||||
@@ -173,6 +175,8 @@ void Header::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
assert(event);
|
||||
|
||||
_mouse_is_down = true;
|
||||
|
||||
std::vector<Trace*> traces;
|
||||
_view.get_traces(ALL_VIEW, traces);
|
||||
int action;
|
||||
@@ -235,6 +239,8 @@ void Header::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
assert(event);
|
||||
|
||||
_mouse_is_down = false;
|
||||
|
||||
// judge for color / name / trigger / move
|
||||
int action;
|
||||
const auto mTrace = get_mTrace(action, event->pos());
|
||||
|
||||
@@ -69,6 +69,10 @@ public:
|
||||
int get_nameEditWidth();
|
||||
void header_resize();
|
||||
|
||||
inline bool mouse_is_down(){
|
||||
return _mouse_is_down;
|
||||
}
|
||||
|
||||
private slots:
|
||||
void on_action_set_name_triggered();
|
||||
|
||||
@@ -85,15 +89,12 @@ private:
|
||||
bool _moveFlag;
|
||||
bool _colorFlag;
|
||||
bool _nameFlag;
|
||||
|
||||
QPoint _mouse_point;
|
||||
QPoint _mouse_down_point;
|
||||
|
||||
QLineEdit *nameEdit;
|
||||
|
||||
std::list<std::pair<Trace*, int> > _drag_traces;
|
||||
|
||||
Trace *_context_trace;
|
||||
bool _mouse_is_down;
|
||||
};
|
||||
|
||||
} // namespace view
|
||||
|
||||
@@ -1403,5 +1403,10 @@ std::list<Cursor*>& View::get_cursorList()
|
||||
}
|
||||
}
|
||||
|
||||
bool View::header_is_draging()
|
||||
{
|
||||
return _header->mouse_is_down();
|
||||
}
|
||||
|
||||
} // namespace view
|
||||
} // namespace pv
|
||||
|
||||
@@ -324,8 +324,8 @@ public:
|
||||
|
||||
//IFontForm
|
||||
void update_font() override;
|
||||
|
||||
void check_measure();
|
||||
bool header_is_draging();
|
||||
|
||||
signals:
|
||||
void hover_point_changed();
|
||||
|
||||
@@ -1230,6 +1230,10 @@ void Viewport::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
assert(event);
|
||||
|
||||
if (_view.header_is_draging()){
|
||||
return;
|
||||
}
|
||||
|
||||
int x = 0; //mouse x pos
|
||||
int delta = 0;
|
||||
bool isVertical = true;
|
||||
|
||||
Reference in New Issue
Block a user