mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-29 21:30:18 +02:00
remove search button
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
6d60a6f4e3
commit
469f051e30
@ -58,7 +58,6 @@ namespace ResourceDownload {
|
|||||||
|
|
||||||
ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
ModPage::ModPage(ModDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
||||||
{
|
{
|
||||||
connect(m_ui->searchButton, &QPushButton::clicked, this, &ModPage::triggerSearch);
|
|
||||||
connect(m_ui->resourceFilterButton, &QPushButton::clicked, this, &ModPage::filterMods);
|
connect(m_ui->resourceFilterButton, &QPushButton::clicked, this, &ModPage::filterMods);
|
||||||
connect(m_ui->packView, &QListView::doubleClicked, this, &ModPage::onResourceSelected);
|
connect(m_ui->packView, &QListView::doubleClicked, this, &ModPage::onResourceSelected);
|
||||||
}
|
}
|
||||||
@ -68,16 +67,17 @@ void ModPage::setFilterWidget(unique_qobject_ptr<ModFilterWidget>& widget)
|
|||||||
if (m_filter_widget)
|
if (m_filter_widget)
|
||||||
disconnect(m_filter_widget.get(), nullptr, nullptr, nullptr);
|
disconnect(m_filter_widget.get(), nullptr, nullptr, nullptr);
|
||||||
|
|
||||||
m_ui->splitter->replaceWidget(0, widget.get());
|
auto old = m_ui->splitter->replaceWidget(0, widget.get());
|
||||||
|
// because we replaced the widget we also need to delete it
|
||||||
|
if (old) {
|
||||||
|
delete old;
|
||||||
|
}
|
||||||
|
|
||||||
m_filter_widget.swap(widget);
|
m_filter_widget.swap(widget);
|
||||||
|
|
||||||
m_filter = m_filter_widget->getFilter();
|
m_filter = m_filter_widget->getFilter();
|
||||||
|
|
||||||
connect(m_filter_widget.get(), &ModFilterWidget::filterChanged, this, &ModPage::triggerSearch);
|
connect(m_filter_widget.get(), &ModFilterWidget::filterChanged, this, &ModPage::triggerSearch);
|
||||||
connect(m_filter_widget.get(), &ModFilterWidget::filterChanged, this,
|
|
||||||
[&] { m_ui->searchButton->setStyleSheet("text-decoration: underline"); });
|
|
||||||
connect(m_filter_widget.get(), &ModFilterWidget::filterUnchanged, this,
|
|
||||||
[&] { m_ui->searchButton->setStyleSheet("text-decoration: none"); });
|
|
||||||
prepareProviderCategories();
|
prepareProviderCategories();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@ namespace ResourceDownload {
|
|||||||
|
|
||||||
ResourcePackResourcePage::ResourcePackResourcePage(ResourceDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
ResourcePackResourcePage::ResourcePackResourcePage(ResourceDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
||||||
{
|
{
|
||||||
connect(m_ui->searchButton, &QPushButton::clicked, this, &ResourcePackResourcePage::triggerSearch);
|
|
||||||
connect(m_ui->packView, &QListView::doubleClicked, this, &ResourcePackResourcePage::onResourceSelected);
|
connect(m_ui->packView, &QListView::doubleClicked, this, &ResourcePackResourcePage::onResourceSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,11 +67,18 @@ ResourcePage::ResourcePage(ResourceDownloadDialog* parent, BaseInstance& base_in
|
|||||||
|
|
||||||
connect(&m_search_timer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
|
connect(&m_search_timer, &QTimer::timeout, this, &ResourcePage::triggerSearch);
|
||||||
|
|
||||||
|
// hide both progress bars to prevent weird artifact
|
||||||
|
m_ui->fetchProgress->hide();
|
||||||
|
m_fetch_progress.hide();
|
||||||
m_fetch_progress.hideIfInactive(true);
|
m_fetch_progress.hideIfInactive(true);
|
||||||
m_fetch_progress.setFixedHeight(24);
|
m_fetch_progress.setFixedHeight(24);
|
||||||
m_fetch_progress.progressFormat("");
|
m_fetch_progress.progressFormat("");
|
||||||
|
|
||||||
layout()->replaceWidget(m_ui->fetchProgress, &m_fetch_progress);
|
auto old = layout()->replaceWidget(m_ui->fetchProgress, &m_fetch_progress);
|
||||||
|
// because we replaced the widget we also need to delete it
|
||||||
|
if (old) {
|
||||||
|
delete old;
|
||||||
|
}
|
||||||
|
|
||||||
m_ui->packView->setItemDelegate(new ProjectItemDelegate(this));
|
m_ui->packView->setItemDelegate(new ProjectItemDelegate(this));
|
||||||
m_ui->packView->installEventFilter(this);
|
m_ui->packView->installEventFilter(this);
|
||||||
|
@ -84,7 +84,7 @@ class ResourcePage : public QWidget, public BasePage {
|
|||||||
bool hasSelectedPacks() { return !(m_model->selectedPacks().isEmpty()); }
|
bool hasSelectedPacks() { return !(m_model->selectedPacks().isEmpty()); }
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void triggerSearch() {}
|
virtual void triggerSearch() = 0;
|
||||||
|
|
||||||
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
||||||
void onVersionSelectionChanged(QString data);
|
void onVersionSelectionChanged(QString data);
|
||||||
|
@ -10,15 +10,8 @@
|
|||||||
<height>685</height>
|
<height>685</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item row="2" column="0">
|
<item>
|
||||||
<widget class="ProgressWidget" name="fetchProgress" native="true">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="resourceFilterButton">
|
<widget class="QPushButton" name="resourceFilterButton">
|
||||||
@ -30,19 +23,19 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="searchEdit"/>
|
<widget class="QLineEdit" name="searchEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="searchButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Search</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item>
|
||||||
|
<widget class="ProgressWidget" name="fetchProgress" native="true">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QSplitter" name="splitter">
|
<widget class="QSplitter" name="splitter">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Orientation::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="childrenCollapsible">
|
<property name="childrenCollapsible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -50,7 +43,7 @@
|
|||||||
<widget class="QWidget" name="filterWidget" native="true"/>
|
<widget class="QWidget" name="filterWidget" native="true"/>
|
||||||
<widget class="QListView" name="packView">
|
<widget class="QListView" name="packView">
|
||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -72,7 +65,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0">
|
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,0,0">
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QComboBox" name="versionSelectionBox"/>
|
<widget class="QComboBox" name="versionSelectionBox"/>
|
||||||
@ -83,7 +76,7 @@
|
|||||||
<string>Version selected:</string>
|
<string>Version selected:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -111,7 +104,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>searchButton</tabstop>
|
|
||||||
<tabstop>packView</tabstop>
|
<tabstop>packView</tabstop>
|
||||||
<tabstop>packDescription</tabstop>
|
<tabstop>packDescription</tabstop>
|
||||||
<tabstop>sortByBox</tabstop>
|
<tabstop>sortByBox</tabstop>
|
||||||
|
@ -16,7 +16,6 @@ namespace ResourceDownload {
|
|||||||
|
|
||||||
ShaderPackResourcePage::ShaderPackResourcePage(ShaderPackDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
ShaderPackResourcePage::ShaderPackResourcePage(ShaderPackDownloadDialog* dialog, BaseInstance& instance) : ResourcePage(dialog, instance)
|
||||||
{
|
{
|
||||||
connect(m_ui->searchButton, &QPushButton::clicked, this, &ShaderPackResourcePage::triggerSearch);
|
|
||||||
connect(m_ui->packView, &QListView::doubleClicked, this, &ShaderPackResourcePage::onResourceSelected);
|
connect(m_ui->packView, &QListView::doubleClicked, this, &ShaderPackResourcePage::onResourceSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ class TexturePackResourcePage : public ResourcePackResourcePage {
|
|||||||
protected:
|
protected:
|
||||||
TexturePackResourcePage(TexturePackDownloadDialog* dialog, BaseInstance& instance) : ResourcePackResourcePage(dialog, instance)
|
TexturePackResourcePage(TexturePackDownloadDialog* dialog, BaseInstance& instance) : ResourcePackResourcePage(dialog, instance)
|
||||||
{
|
{
|
||||||
connect(m_ui->searchButton, &QPushButton::clicked, this, &TexturePackResourcePage::triggerSearch);
|
|
||||||
connect(m_ui->packView, &QListView::doubleClicked, this, &TexturePackResourcePage::onResourceSelected);
|
connect(m_ui->packView, &QListView::doubleClicked, this, &TexturePackResourcePage::onResourceSelected);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -122,7 +122,6 @@ ModFilterWidget::ModFilterWidget(MinecraftInstance* instance, bool extended, QWi
|
|||||||
auto ModFilterWidget::getFilter() -> std::shared_ptr<Filter>
|
auto ModFilterWidget::getFilter() -> std::shared_ptr<Filter>
|
||||||
{
|
{
|
||||||
m_filter_changed = false;
|
m_filter_changed = false;
|
||||||
emit filterUnchanged();
|
|
||||||
return m_filter;
|
return m_filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,8 +198,6 @@ void ModFilterWidget::onVersionFilterChanged(int)
|
|||||||
m_filter->versions = current_list;
|
m_filter->versions = current_list;
|
||||||
if (m_filter_changed)
|
if (m_filter_changed)
|
||||||
emit filterChanged();
|
emit filterChanged();
|
||||||
else
|
|
||||||
emit filterUnchanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModFilterWidget::onLoadersFilterChanged()
|
void ModFilterWidget::onLoadersFilterChanged()
|
||||||
@ -218,8 +215,6 @@ void ModFilterWidget::onLoadersFilterChanged()
|
|||||||
m_filter->loaders = loaders;
|
m_filter->loaders = loaders;
|
||||||
if (m_filter_changed)
|
if (m_filter_changed)
|
||||||
emit filterChanged();
|
emit filterChanged();
|
||||||
else
|
|
||||||
emit filterUnchanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModFilterWidget::onSideFilterChanged()
|
void ModFilterWidget::onSideFilterChanged()
|
||||||
@ -240,8 +235,6 @@ void ModFilterWidget::onSideFilterChanged()
|
|||||||
m_filter->side = side;
|
m_filter->side = side;
|
||||||
if (m_filter_changed)
|
if (m_filter_changed)
|
||||||
emit filterChanged();
|
emit filterChanged();
|
||||||
else
|
|
||||||
emit filterUnchanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModFilterWidget::onHideInstalledFilterChanged()
|
void ModFilterWidget::onHideInstalledFilterChanged()
|
||||||
@ -251,8 +244,6 @@ void ModFilterWidget::onHideInstalledFilterChanged()
|
|||||||
m_filter->hideInstalled = hide;
|
m_filter->hideInstalled = hide;
|
||||||
if (m_filter_changed)
|
if (m_filter_changed)
|
||||||
emit filterChanged();
|
emit filterChanged();
|
||||||
else
|
|
||||||
emit filterUnchanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModFilterWidget::onVersionFilterTextChanged(const QString& version)
|
void ModFilterWidget::onVersionFilterTextChanged(const QString& version)
|
||||||
|
@ -81,7 +81,6 @@ class ModFilterWidget : public QTabWidget {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void filterChanged();
|
void filterChanged();
|
||||||
void filterUnchanged();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCategories(const QList<ModPlatform::Category>&);
|
void setCategories(const QList<ModPlatform::Category>&);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user