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:
parent
43a8b6039e
commit
260778e0fb
10 changed files with 157 additions and 2 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue