Skip to content

Commit

Permalink
#5127: TextureBrowser is notified on favourite changes
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 4, 2021
1 parent 16f8cdf commit d2f55f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions radiant/ui/texturebrowser/TextureBrowser.cpp
Expand Up @@ -344,6 +344,9 @@ TextureBrowser::TextureBrowser(wxWindow* parent) :
}

updateScroll();

GlobalFavouritesManager().getSignalForType(decl::Type::Material).connect(
sigc::mem_fun(this, &TextureBrowser::onFavouritesChanged));
}

TextureBrowser::~TextureBrowser()
Expand Down Expand Up @@ -423,6 +426,11 @@ void TextureBrowser::keyChanged()
_originInvalid = true;
}

void TextureBrowser::onFavouritesChanged()
{
_updateNeeded = true;
}

// Return the display width of a texture in the texture browser
int TextureBrowser::getTextureWidth(const Texture& tex) const
{
Expand Down
3 changes: 3 additions & 0 deletions radiant/ui/texturebrowser/TextureBrowser.h
@@ -1,5 +1,6 @@
#pragma once

#include <sigc++/connection.h>
#include "iregistry.h"
#include "icommandsystem.h"
#include "wxutil/FreezePointer.h"
Expand Down Expand Up @@ -176,6 +177,8 @@ class TextureBrowser :
void observeKey(const std::string& key);
void keyChanged();

void onFavouritesChanged();

/** greebo: The actual drawing method invoking the GL calls.
*/
void draw();
Expand Down

0 comments on commit d2f55f4

Please sign in to comment.