Clean up settings editor changes

This commit is contained in:
GriffinR
2025-04-23 17:34:15 -04:00
parent 715f53731d
commit 4259e65244
3 changed files with 10 additions and 6 deletions

View File

@@ -21,7 +21,7 @@
<item>
<widget class="QTabWidget" name="mainTabs">
<property name="currentIndex">
<number>4</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_General">
<attribute name="title">

View File

@@ -1665,6 +1665,13 @@ void MainWindow::duplicate() {
void MainWindow::copy() {
auto focused = QApplication::focusWidget();
if (focused) {
// Allow copying text from selectable QLabels.
auto label = dynamic_cast<QLabel*>(focused);
if (label && !label->selectedText().isEmpty()) {
setClipboardData(label->selectedText());
return;
}
QString objectName = focused->objectName();
if (objectName == "graphicsView_currentMetatileSelection") {
// copy the current metatile selection as json data

View File

@@ -650,9 +650,7 @@ void ProjectSettingsEditor::addNewGlobalConstantsFilepath() {
void ProjectSettingsEditor::addGlobalConstantsFilepath(const QString &filepath) {
auto filepathLabel = new QLabel(filepath, this);
filepathLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);
filepathLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); // TODO: This doesn't allow Copy shortcut from the keyboard to work
// TODO: Tool tips
filepathLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
int newRow = ui->gridLayout_GlobalConstantsFiles->rowCount();
ui->gridLayout_GlobalConstantsFiles->addWidget(filepathLabel, newRow, 0);
@@ -693,10 +691,9 @@ void ProjectSettingsEditor::addNewGlobalConstant() {
}
void ProjectSettingsEditor::addGlobalConstant(const QString &name, const QString &expression) {
// TODO: Tool tips
auto nameLabel = new QLabel(name, this);
nameLabel->setFrameStyle(QFrame::Panel | QFrame::Raised);
nameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); // TODO: This doesn't allow Copy shortcut from the keyboard to work
nameLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
auto expressionLineEdit = new QLineEdit(expression, this);