aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/widgets
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-04-14 10:52:23 -0300
committerflow <thiagodonato300@gmail.com>2022-04-15 08:49:43 -0300
commit5f15f51610f861521afdb295df0de6d9407ba951 (patch)
tree10b795a120ddff21ad1d2022eb82ba35f6501042 /launcher/ui/widgets
parent277de4120052b2630850a18969a56ee92e8c2c63 (diff)
downloadPrismLauncher-5f15f51610f861521afdb295df0de6d9407ba951.tar.gz
PrismLauncher-5f15f51610f861521afdb295df0de6d9407ba951.tar.bz2
PrismLauncher-5f15f51610f861521afdb295df0de6d9407ba951.zip
ui: underline search button text when changing filters
This hopefully makes it easier to the user to know that their changes will only apply after hitting the search button. I tried setting the background color, but it seems more unreliable on cross-platform than underlining. Also, it could be worse for daltonic people, so I don't know what to do :(
Diffstat (limited to 'launcher/ui/widgets')
-rw-r--r--launcher/ui/widgets/ModFilterWidget.cpp12
-rw-r--r--launcher/ui/widgets/ModFilterWidget.h4
2 files changed, 15 insertions, 1 deletions
diff --git a/launcher/ui/widgets/ModFilterWidget.cpp b/launcher/ui/widgets/ModFilterWidget.cpp
index 339ecb4b..ffc8d05d 100644
--- a/launcher/ui/widgets/ModFilterWidget.cpp
+++ b/launcher/ui/widgets/ModFilterWidget.cpp
@@ -38,6 +38,7 @@ void ModFilterWidget::setInstance(MinecraftInstance* instance)
auto ModFilterWidget::getFilter() -> std::shared_ptr<Filter>
{
m_last_version_id = m_version_id;
+ emit filterUnchanged();
return m_filter;
}
@@ -70,7 +71,11 @@ void ModFilterWidget::onVersionFilterChanged(int id)
int index = 0;
auto cast_id = (VersionButtonID) id;
- m_version_id = cast_id;
+ if (cast_id != m_version_id) {
+ m_version_id = cast_id;
+ } else {
+ return;
+ }
m_filter->versions.clear();
@@ -91,6 +96,11 @@ void ModFilterWidget::onVersionFilterChanged(int id)
// TODO
break;
}
+
+ if(changed())
+ emit filterChanged();
+ else
+ emit filterUnchanged();
}
ModFilterWidget::~ModFilterWidget()
diff --git a/launcher/ui/widgets/ModFilterWidget.h b/launcher/ui/widgets/ModFilterWidget.h
index 5348882f..334fc672 100644
--- a/launcher/ui/widgets/ModFilterWidget.h
+++ b/launcher/ui/widgets/ModFilterWidget.h
@@ -52,6 +52,10 @@ private:
private slots:
void onVersionFilterChanged(int id);
+public: signals:
+ void filterChanged();
+ void filterUnchanged();
+
private:
Ui::ModFilterWidget* ui;