From 93214a2fb041769e2c9f783ec3d187b3d74d3f7c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 11 Jul 2018 18:30:56 +0200 Subject: disable actions and make them accesible --- gui/designwidget.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 7785513a..ce0220dd 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -68,6 +68,11 @@ class DesignWidget : public QWidget QMap idToProperty; QTreeWidgetItem *nets_root; QTreeWidgetItem *cells_root; + + QAction *actionFirst; + QAction *actionPrev; + QAction *actionNext; + QAction *actionLast; }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 0b1ae3ce8da9fb3a3b4eaf337d6bf0b7f6aaab1e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Jul 2018 17:50:06 +0200 Subject: use itemSelectionChanged, keyboard selection works --- gui/designwidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index ce0220dd..843fbb72 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -46,7 +46,7 @@ class DesignWidget : public QWidget private Q_SLOTS: void prepareMenu(const QPoint &pos); - void onItemClicked(QTreeWidgetItem *item, int); + void onItemSelectionChanged(); void selectObject(); public Q_SLOTS: void newContext(Context *ctx); -- cgit v1.2.3 From 8d1996cae99ff80a2d9390b94db54217ed1d8726 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Jul 2018 19:44:37 +0200 Subject: display selected object from tree --- gui/designwidget.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 843fbb72..618c7bbf 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -43,6 +43,7 @@ class DesignWidget : public QWidget Q_SIGNALS: void info(std::string text); + void selected(std::vector decal); private Q_SLOTS: void prepareMenu(const QPoint &pos); -- cgit v1.2.3 From bce235fad582dbb727354a7917e4d25a6529c650 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 09:49:19 +0200 Subject: show selected item from property window as well, cleanup --- gui/designwidget.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 618c7bbf..a4940213 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -21,6 +21,7 @@ #define DESIGNWIDGET_H #include +#include #include "nextpnr.h" #include "qtgroupboxpropertybrowser.h" #include "qtpropertymanager.h" @@ -29,6 +30,16 @@ NEXTPNR_NAMESPACE_BEGIN +enum class ElementType +{ + NONE, + BEL, + WIRE, + PIP, + NET, + CELL +}; + class DesignWidget : public QWidget { Q_OBJECT @@ -38,9 +49,13 @@ class DesignWidget : public QWidget ~DesignWidget(); private: - void addProperty(QtProperty *property, const QString &id); void clearProperties(); - + QtProperty *addTopLevelProperty(const QString &id); + QtProperty *addSubGroup(QtProperty *topItem, const QString &name); + void addProperty(QtProperty *topItem, int propertyType, const QString &name, QVariant value, + const ElementType &type = ElementType::NONE); + QString getElementTypeName(ElementType type); + ElementType getElementTypeByName(QString type); Q_SIGNALS: void info(std::string text); void selected(std::vector decal); @@ -49,6 +64,7 @@ class DesignWidget : public QWidget void prepareMenu(const QPoint &pos); void onItemSelectionChanged(); void selectObject(); + void onCurrentPropertyChanged(QtBrowserItem *_item); public Q_SLOTS: void newContext(Context *ctx); void updateTree(); -- cgit v1.2.3 From bf0b1d2db3e071f5606e117d5fc5f2213b948997 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 12:39:19 +0200 Subject: add select on property pane, and action to double click --- gui/designwidget.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index a4940213..50f00bbe 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -61,10 +61,10 @@ class DesignWidget : public QWidget void selected(std::vector decal); private Q_SLOTS: - void prepareMenu(const QPoint &pos); + void prepareMenuProperty(const QPoint &pos); void onItemSelectionChanged(); - void selectObject(); - void onCurrentPropertyChanged(QtBrowserItem *_item); + void onItemDoubleClicked(QTreeWidgetItem *item, int column); + void onCurrentPropertySelected(QtBrowserItem *_item); public Q_SLOTS: void newContext(Context *ctx); void updateTree(); -- cgit v1.2.3 From 3eb34bf38b8e2da66b3852bf35927a0b540a3cff Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 15:12:31 +0200 Subject: make linked items clickable --- gui/designwidget.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 50f00bbe..8f2fa375 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -56,6 +56,7 @@ class DesignWidget : public QWidget const ElementType &type = ElementType::NONE); QString getElementTypeName(ElementType type); ElementType getElementTypeByName(QString type); + int getElementIndex(ElementType type); Q_SIGNALS: void info(std::string text); void selected(std::vector decal); @@ -83,6 +84,9 @@ class DesignWidget : public QWidget QMap propertyToId; QMap idToProperty; + + QMap nameToItem[6]; + QTreeWidgetItem *nets_root; QTreeWidgetItem *cells_root; -- cgit v1.2.3 From 82c9fef3de1017d39a15b5c23be84a8f3c8bebc0 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 16:20:35 +0200 Subject: added browsing history --- gui/designwidget.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 8f2fa375..2733e6cf 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -57,6 +57,8 @@ class DesignWidget : public QWidget QString getElementTypeName(ElementType type); ElementType getElementTypeByName(QString type); int getElementIndex(ElementType type); + void updateButtons(); + void addToHistory(QTreeWidgetItem *item); Q_SIGNALS: void info(std::string text); void selected(std::vector decal); @@ -86,6 +88,9 @@ class DesignWidget : public QWidget QMap idToProperty; QMap nameToItem[6]; + std::vector history; + int history_index; + bool history_ignore; QTreeWidgetItem *nets_root; QTreeWidgetItem *cells_root; -- cgit v1.2.3 From ecc4c3fa7bdf1726377cd5cf2199b3cabd233427 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 17:50:58 +0200 Subject: added highlight groups --- gui/designwidget.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 2733e6cf..269e32fa 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -59,15 +59,18 @@ class DesignWidget : public QWidget int getElementIndex(ElementType type); void updateButtons(); void addToHistory(QTreeWidgetItem *item); + std::vector getDecals(ElementType type, IdString value); + void updateHighlightGroup(QTreeWidgetItem *item, int group); Q_SIGNALS: void info(std::string text); void selected(std::vector decal); + void highlight(std::vector decal, int group); private Q_SLOTS: void prepareMenuProperty(const QPoint &pos); + void prepareMenuTree(const QPoint &pos); void onItemSelectionChanged(); void onItemDoubleClicked(QTreeWidgetItem *item, int column); - void onCurrentPropertySelected(QtBrowserItem *_item); public Q_SLOTS: void newContext(Context *ctx); void updateTree(); @@ -99,6 +102,9 @@ class DesignWidget : public QWidget QAction *actionPrev; QAction *actionNext; QAction *actionLast; + + QColor highlightColors[8]; + QMap highlightSelected; }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 8e12ae2cfed728ee1ecab4e5f60f0435bf2d58b8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Jul 2018 20:31:42 +0200 Subject: Added splash screen info while loading --- gui/designwidget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 269e32fa..1afe817d 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -65,6 +65,8 @@ class DesignWidget : public QWidget void info(std::string text); void selected(std::vector decal); void highlight(std::vector decal, int group); + void finishContextLoad(); + void contextLoadStatus(std::string text); private Q_SLOTS: void prepareMenuProperty(const QPoint &pos); -- cgit v1.2.3