Skip to content

Commit

Permalink
PlayerEvaluate: Show a hint image when evaluate is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jan 17, 2023
1 parent 580f6fe commit 3b48d66
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions resources/xml/fragment/player_evaluate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
</brls:Box>
</brls:ScrollingFrame>

<brls:Image
id="img/empty"
height="300"
positionType="absolute"
positionTop="50"
positionLeft="100"
visibility="gone"
image="@res/pictures/empty.png"/>

<ButtonClose
positionType="absolute"
positionTop="10"
Expand Down
1 change: 1 addition & 0 deletions wiliwili/include/fragment/player_evaluate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ class PlayerEvaluate : public brls::Box {

private:
BRLS_BIND(brls::Label, label, "evaluate/content");
BRLS_BIND(brls::Image, empty, "img/empty");
};
6 changes: 5 additions & 1 deletion wiliwili/source/fragment/player_evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ PlayerEvaluate::PlayerEvaluate() {
}

void PlayerEvaluate::setContent(const std::string& value) {
this->label->setText(value);
if (value.empty()) {
empty->setVisibility(brls::Visibility::VISIBLE);
} else {
this->label->setText(value);
}
}

PlayerEvaluate::~PlayerEvaluate() {
Expand Down

0 comments on commit 3b48d66

Please sign in to comment.