-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add close button to daily forecast dialog
Refs: #16
- Loading branch information
Showing
6 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,32 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "button.h" | ||
#include "icons.h" | ||
|
||
namespace taranis { | ||
|
||
class CloseButton : public Button { | ||
public: | ||
CloseButton(int icon_size, std::shared_ptr<Icons> icons) | ||
: Button{icon_size, icons->get("close")} {} | ||
|
||
typedef std::function<void()> ClickHandler; | ||
|
||
void set_click_handler(ClickHandler handler) { | ||
this->click_handler = handler; | ||
} | ||
|
||
protected: | ||
void on_clicked() override { | ||
if (!this->click_handler) { | ||
return; | ||
} | ||
this->click_handler(); | ||
} | ||
|
||
private: | ||
ClickHandler click_handler; | ||
}; | ||
} // namespace taranis |
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