Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add help labels #73

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions src/QuiltiX/quiltix.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,11 @@ def category_exists(self, mx_def):
def setup_ui(self):
self.setWindowTitle("Save Node Definition")

self.l_groupHelp = HelpLabel(self, "The Node Group defines in which menu of the tabmenu the node definition will appear.")
self.l_nodegroup = QLabel("Node Group:")
self.e_nodegroup = QComboBox()
self.e_nodegroup.addItems(self.nodegroups)
self.l_categoryHelp = HelpLabel(self, "The Category defines the name in the tabmenu of the new node definition.")
self.l_category = QLabel("Category:")
self.e_category = QLineEdit(self.node.NODE_NAME)
self.l_path = QLabel("Save Path: ")
Expand All @@ -840,16 +842,18 @@ def setup_ui(self):
self.e_nodegroup.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)

self.lo_main = QGridLayout(self)
self.lo_main.addWidget(self.l_nodegroup, 0, 0)
self.lo_main.addWidget(self.e_nodegroup, 0, 1, 1, 3)
self.lo_main.addWidget(self.l_category, 1, 0)
self.lo_main.addWidget(self.e_category, 1, 1, 1, 3)
self.lo_main.addWidget(self.l_path, 2, 0)
self.lo_main.addWidget(self.e_path, 2, 1, 1, 2)
self.lo_main.addWidget(self.b_path, 2, 3)
self.lo_main.addWidget(self.l_groupHelp, 0, 0)
self.lo_main.addWidget(self.l_nodegroup, 0, 1)
self.lo_main.addWidget(self.e_nodegroup, 0, 2, 1, 3)
self.lo_main.addWidget(self.l_categoryHelp, 1, 0)
self.lo_main.addWidget(self.l_category, 1, 1)
self.lo_main.addWidget(self.e_category, 1, 2, 1, 3)
self.lo_main.addWidget(self.l_path, 2, 1)
self.lo_main.addWidget(self.e_path, 2, 2, 1, 2)
self.lo_main.addWidget(self.b_path, 2, 4)
self.lo_main.setRowStretch(3, 100)
self.lo_main.setColumnStretch(1, 100)
self.lo_main.addWidget(self.bb_main, 4, 2, 1, 2)
self.lo_main.setColumnStretch(2, 100)
self.lo_main.addWidget(self.bb_main, 4, 3, 1, 2)
self.e_category.setFocus()

def explore_save_path_triggered(self):
Expand Down Expand Up @@ -962,6 +966,27 @@ def on_accepted(self):
self.signal_saved_def.emit(outpath)


class HelpLabel(QLabel):

signalEntered = QtCore.Signal(object)

def __init__(self, parent, toolTipStr):
super(HelpLabel, self).__init__()
self.parent = parent
self.toolTipStr = toolTipStr

iconPath = os.path.join(ROOT, "resources", "icons", "help.png")
pixmap = QtGui.QIcon(iconPath).pixmap(20, 20)
self.setPixmap(pixmap)
self.setMouseTracking(True)

def enterEvent(self, event):
self.signalEntered.emit(self)

def mouseMoveEvent(self, event):
QtWidgets.QToolTip.showText(self.mapToGlobal(self.rect().center()), self.toolTipStr)


def launch():
app = QApplication.instance()
if not app:
Expand Down
Binary file added src/QuiltiX/resources/icons/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.