Fixed repaint issue
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
7d79abb607
commit
bf0a577fb9
@ -312,9 +312,11 @@ void ResourcePage::addResourceToDialog(ModPlatform::IndexedPack& pack, ModPlatfo
|
|||||||
m_parent_dialog->addResource(pack, version);
|
m_parent_dialog->addResource(pack, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcePage::removeResourceFromDialog(const QString& pack_name)
|
void ResourcePage::removeResourceFromDialog(ModPlatform::IndexedPack& pack)
|
||||||
{
|
{
|
||||||
m_parent_dialog->removeResource(pack_name);
|
m_parent_dialog->removeResource(pack.name);
|
||||||
|
for (auto& ver : pack.versions)
|
||||||
|
ver.is_currently_selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack& pack,
|
void ResourcePage::addResourceToPage(ModPlatform::IndexedPack& pack,
|
||||||
@ -340,7 +342,7 @@ void ResourcePage::onResourceSelected()
|
|||||||
|
|
||||||
auto& version = current_pack.versions[m_selected_version_index];
|
auto& version = current_pack.versions[m_selected_version_index];
|
||||||
if (version.is_currently_selected)
|
if (version.is_currently_selected)
|
||||||
removeResourceFromDialog(current_pack.name);
|
removeResourceFromDialog(current_pack);
|
||||||
else
|
else
|
||||||
addResourceToDialog(current_pack, version);
|
addResourceToDialog(current_pack, version);
|
||||||
|
|
||||||
@ -351,7 +353,7 @@ void ResourcePage::onResourceSelected()
|
|||||||
updateSelectionButton();
|
updateSelectionButton();
|
||||||
|
|
||||||
/* Force redraw on the resource list when the selection changes */
|
/* Force redraw on the resource list when the selection changes */
|
||||||
m_ui->packView->adjustSize();
|
m_ui->packView->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResourcePage::openUrl(const QUrl& url)
|
void ResourcePage::openUrl(const QUrl& url)
|
||||||
|
@ -76,7 +76,7 @@ class ResourcePage : public QWidget, public BasePage {
|
|||||||
virtual void updateVersionList();
|
virtual void updateVersionList();
|
||||||
|
|
||||||
void addResourceToDialog(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&);
|
void addResourceToDialog(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&);
|
||||||
void removeResourceFromDialog(const QString& pack_name);
|
void removeResourceFromDialog(ModPlatform::IndexedPack& pack);
|
||||||
virtual void removeResourceFromPage(const QString& name);
|
virtual void removeResourceFromPage(const QString& name);
|
||||||
virtual void addResourceToPage(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&, const std::shared_ptr<ResourceFolderModel>);
|
virtual void addResourceToPage(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&, const std::shared_ptr<ResourceFolderModel>);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user