Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5537: Move more preview-related code to the SkinSelector widget.
- Loading branch information
1 parent
ac26f79
commit af96a3f
Showing
6 changed files
with
105 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "ui/ideclpreview.h" | ||
#include "ModelPreview.h" | ||
|
||
namespace wxutil | ||
{ | ||
|
||
class SkinPreview : | ||
public ModelPreview, | ||
public ui::IDeclarationPreview | ||
{ | ||
private: | ||
std::string _model; | ||
|
||
public: | ||
SkinPreview(wxWindow* parent, const std::string& model) : | ||
ModelPreview(parent), | ||
_model(model) | ||
{} | ||
|
||
// Returns the widget that can be packed into the selector container | ||
wxWindow* GetPreviewWidget() override | ||
{ | ||
return _mainPanel; | ||
} | ||
|
||
void ClearPreview() override | ||
{ | ||
setModel({}); | ||
setSkin({}); | ||
} | ||
|
||
void SetPreviewDeclName(const std::string& declName) override | ||
{ | ||
setModel(_model); | ||
setSkin(declName); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters