mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-24 17:46:19 -05:00
Add selection highlight to connections list
This commit is contained in:
@@ -33,6 +33,9 @@ public:
|
||||
bool getEditable();
|
||||
void updateHighlight(bool selected);
|
||||
|
||||
private:
|
||||
bool highlighted = false;
|
||||
|
||||
protected:
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent*);
|
||||
@@ -42,6 +45,7 @@ signals:
|
||||
void connectionItemSelected(ConnectionPixmapItem* connectionItem);
|
||||
void connectionItemDoubleClicked(ConnectionPixmapItem* connectionItem);
|
||||
void connectionMoved(MapConnection*);
|
||||
void highlightChanged(bool highlighted);
|
||||
};
|
||||
|
||||
#endif // CONNECTIONPIXMAPITEM_H
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "mapconnection.h"
|
||||
|
||||
#include <QFrame>
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace Ui {
|
||||
class ConnectionsListItem;
|
||||
@@ -22,14 +23,20 @@ public:
|
||||
~ConnectionsListItem();
|
||||
|
||||
void updateUI();
|
||||
void setSelected(bool selected);
|
||||
|
||||
private:
|
||||
Ui::ConnectionsListItem *ui;
|
||||
MapConnection * const connection;
|
||||
bool isSelected = false;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
|
||||
signals:
|
||||
void edited();
|
||||
void deleted();
|
||||
void selected();
|
||||
|
||||
private slots:
|
||||
void on_comboBox_Direction_currentTextChanged(const QString &direction);
|
||||
|
||||
Reference in New Issue
Block a user