Skip to content

Commit

Permalink
Removed "Add Folder to Project" button from the startup page
Browse files Browse the repository at this point in the history
This button is no longer very useful to show on this page and is now
even somewhat confusing. When creating a new project, its root folder is
added automatically after all.

The button also wasn't properly disabled when no project was loaded,
making it possible to add a folder before creating a project.
  • Loading branch information
bjorn committed Mar 24, 2023
1 parent ffdc3ac commit cae1d65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Fixed tile stamp getting messed up on staggered maps in some cases (#3431)
* JSON plugin: Fixed loading of empty tilesets created by script (#3542)
* Improved Terrain Brush for Hexagonal (Staggered) maps with side length 0 (#3617)
* Removed "Add Folder to Project" button from the startup page
* Qt 6: Increased the image allocation limit from 128 MB to 1 GB (#3616)
* Qt 6 / Linux: Fixed long startup time for some icon themes
* snap: Updated from core20 to core22 (now uses Qt 5.15)
Expand Down
5 changes: 2 additions & 3 deletions src/tiled/noeditorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "mainwindow.h"
#include "stylehelper.h"
#include "tiledproxystyle.h"
#include "utils.h"

#include <QAction>
#include <QApplication>
Expand All @@ -41,14 +40,15 @@ NoEditorWidget::NoEditorWidget(QWidget *parent) :
{
ui->setupUi(this);

ui->logo->setPixmap(QPixmap(QString::fromUtf8(":/images/about-tiled-logo.png")));

auto opacityEffect = new QGraphicsOpacityEffect(this);
opacityEffect->setOpacity(0.25);
ui->logo->setGraphicsEffect(opacityEffect);

ui->versionLabel->setText(QStringLiteral("%1 %2").arg(QGuiApplication::applicationDisplayName(), QGuiApplication::applicationVersion()));

connect(ui->newProjectButton, &QToolButton::clicked, ActionManager::action("NewProject"), &QAction::trigger);
connect(ui->addFolderToProjectButton, &QToolButton::clicked, ActionManager::action("AddFolderToProject"), &QAction::trigger);

connect(ui->newMapButton, &QToolButton::clicked, this, &NoEditorWidget::newMap);
connect(ui->newTilesetButton, &QToolButton::clicked, this, &NoEditorWidget::newTileset);
Expand Down Expand Up @@ -100,7 +100,6 @@ void NoEditorWidget::openFile()
void NoEditorWidget::retranslateUi()
{
ui->newProjectButton->setText(ActionManager::action("NewProject")->text());
ui->addFolderToProjectButton->setText(ActionManager::action("AddFolderToProject")->text());
ui->openFileButton->setText(ActionManager::action("Open")->text());
}

Expand Down
34 changes: 1 addition & 33 deletions src/tiled/noeditorwidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -102,33 +102,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QToolButton" name="addFolderToProjectButton">
<property name="text">
<string notr="true">Add Folder to Project...</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>88</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
Expand Down Expand Up @@ -244,9 +217,6 @@
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="tiled.qrc">:/images/about-tiled-logo.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
Expand All @@ -256,8 +226,6 @@
</item>
</layout>
</widget>
<resources>
<include location="tiled.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

0 comments on commit cae1d65

Please sign in to comment.