Skip to content
Commits on Source (3)
build
build_win
doxygen
pes
.codelite
motifs
external
*.o
\ No newline at end of file
*.o
*.oe
[submodule "external/glfw"]
path = external/glfw
url = https://github.com/glfw/glfw
Subproject commit 999f3556fdd80983b10051746264489f2cb1ef16
......@@ -130,6 +130,7 @@ class OE_display : public QOpenGLWidget, protected QOpenGLFunctions_2_0
bool pan;
int width, height;
OE_displayStyle* style = NULL;
OE_stitchs* higligtedStitch = nullptr;
protected:
......
......@@ -410,7 +410,10 @@ bool OE_display::drawStitch(OE_stitchs* stitch, int curpoint)
unsigned i;
// Points
glPointSize(OE_preferences::stitchPointSize);
if (stitch == higligtedStitch)
glPointSize(OE_preferences::stitchPointSize*2);
else
glPointSize(OE_preferences::stitchPointSize);
glBegin(GL_POINTS);
if (curpoint>0)
......@@ -432,7 +435,10 @@ bool OE_display::drawStitch(OE_stitchs* stitch, int curpoint)
glEnd();
//draw lines
glLineWidth(OE_preferences::stitchLineWidth);
if (stitch == higligtedStitch)
glLineWidth(OE_preferences::stitchLineWidth*2);
else
glLineWidth(OE_preferences::stitchLineWidth);
glBegin(GL_LINE_STRIP);
OE_thread* thread = stitch->getThread();
if (thread)
......@@ -1384,6 +1390,8 @@ bool OE_display::draw()
selectionBounds += (*stitch)->getBound();
stitch++;
}
if(higligtedStitch)
drawStitch(higligtedStitch, 0);
}
if (style->drawCommands)
{
......
......@@ -14,6 +14,8 @@ OE_ui_stitchList::OE_ui_stitchList(MainWindow* window, OE_root* root)
setDropIndicatorShown(true);
setDefaultDropAction(Qt::TargetMoveAction);
setMouseTracking(true);
setMinimumSize(100,0);
setDragDropMode(QAbstractItemView::InternalMove);
......@@ -30,7 +32,7 @@ OE_ui_stitchList::OE_ui_stitchList(MainWindow* window, OE_root* root)
connect(getInterfaceDisplay(), SIGNAL(refreshStitch(OE_stitchs*)), this, SLOT(on_refreshStitch(OE_stitchs*)));
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleSelectionChanged()));
connect(getInterfaceDisplay(), SIGNAL(stitchSelectionChange()), this, SLOT(on_refreshStitchList()));
connect(this,SIGNAL(entered(QModelIndex)),this,SLOT(enteredSlot(QModelIndex)));
showMaximized();
......@@ -180,6 +182,21 @@ void OE_ui_stitchList::keyPressEvent(QKeyEvent *event)
QListView::keyPressEvent(event);
}
void OE_ui_stitchList::leaveEvent(QEvent *event)
{
QListView::leaveEvent(event);
getInterfaceDisplay()->higligtedStitch = nullptr;
}
void OE_ui_stitchList::enteredSlot(QModelIndex index)
{
std::list<OE_stitchs*>::iterator it = getDocument()->stitchs.begin();
std::advance(it, index.row());
getInterfaceDisplay()->higligtedStitch = *it;
getInterfaceDisplay()->update();
}
OE_controller* OE_ui_stitchList::getController()
{
return this->root->interfaceDisplay->getController();
......
......@@ -29,12 +29,14 @@ private:
void addItem(QColor color, QIcon icon, QIcon type, QIcon pattern, int stitchCount);
void addItem(QColor color, int stitchCount);
void keyPressEvent(QKeyEvent *event);
void leaveEvent(QEvent *event);
protected:
void dropEvent(QDropEvent *event);
private slots:
void on_refreshStitchList();
void on_refreshStitch(OE_stitchs* stitch);
void handleSelectionChanged();
void enteredSlot(QModelIndex index);
};
#endif // OE_UI_STITCHLIST_H