feat: add MdTextButton to View APIs (#15328)

* view: make button focusable by default

* view: add MdTextButton

* view: add common methods to LabelButton
This commit is contained in:
Cheng Zhao 2018-10-23 23:57:13 +09:00 committed by John Kleinschmidt
parent 43a8b6039e
commit 260778e0fb
10 changed files with 157 additions and 2 deletions

View file

@ -8,6 +8,7 @@
#include <string>
#include "atom/browser/api/views/atom_api_button.h"
#include "ui/views/controls/button/label_button.h"
namespace atom {
@ -21,10 +22,20 @@ class LabelButton : public Button {
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
const base::string16& GetText() const;
void SetText(const base::string16& text);
bool IsDefault() const;
void SetIsDefault(bool is_default);
protected:
explicit LabelButton(views::LabelButton* impl);
explicit LabelButton(const std::string& text);
~LabelButton() override;
views::LabelButton* label_button() const {
return static_cast<views::LabelButton*>(view());
}
private:
DISALLOW_COPY_AND_ASSIGN(LabelButton);
};