mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-30 03:46:35 -05:00
Clean up settings editor changes
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user