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 :(
This commit is contained in:
@ -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()
|
||||
|
@ -52,6 +52,10 @@ private:
|
||||
private slots:
|
||||
void onVersionFilterChanged(int id);
|
||||
|
||||
public: signals:
|
||||
void filterChanged();
|
||||
void filterUnchanged();
|
||||
|
||||
private:
|
||||
Ui::ModFilterWidget* ui;
|
||||
|
||||
|
Reference in New Issue
Block a user