QPointer<Ui::IconButton> AbstractBox::addTopButton(const style::IconButton &st, Fn<void()> clickCallback) { _topButton = base::make_unique_q<Ui::IconButton>(this, st); auto result = QPointer<Ui::IconButton>(_topButton.get()); result->setClickedCallback(std::move(clickCallback)); result->show(); updateButtonsPositions(); return result; }
QPointer<Ui::RoundButton> AbstractBox::addLeftButton(Fn<QString()> textFactory, Fn<void()> clickCallback, const style::RoundButton &st) { _leftButton = object_ptr<Ui::RoundButton>(this, std::move(textFactory), st); auto result = QPointer<Ui::RoundButton>(_leftButton); result->setClickedCallback(std::move(clickCallback)); result->show(); updateButtonsPositions(); return result; }
LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p) : LLButton(p), // use combobox params to steal images mColumn(p.column), mHasResizableElement(FALSE) { setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this, _2)); // resize handles on left and right const S32 RESIZE_BAR_THICKNESS = 3; LLResizeBar::Params resize_bar_p; resize_bar_p.resizing_view(this); resize_bar_p.rect(LLRect(getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0)); resize_bar_p.min_size(MIN_COLUMN_WIDTH); resize_bar_p.side(LLResizeBar::RIGHT); resize_bar_p.enabled(false); mResizeBar = LLUICtrlFactory::create<LLResizeBar>(resize_bar_p); addChild(mResizeBar); }
TitleButton::TitleButton(QWidget *parent) : Button(parent) , _layout(std_::make_unique<PlayButtonLayout>(st::mediaPlayerTitleButton, [this] { update(); })) { setAttribute(Qt::WA_OpaquePaintEvent); resize(st::mediaPlayerTitleButtonSize); setClickedCallback([this]() { if (exists()) { instance()->playPauseCancelClicked(); } }); if (exists()) { subscribe(instance()->updatedNotifier(), [this](const UpdatedEvent &e) { updatePauseState(); }); updatePauseState(); _layout->finishTransform(); } }
void LLButton::setHelpURLCallback(const std::string &help_url) { mHelpURL = help_url; setClickedCallback(clicked_help,this); }
// *TODO: Deprecate (for backwards compatability only) boost::signals2::connection LLButton::setClickedCallback( button_callback_t cb, void* data ) { return setClickedCallback(boost::bind(cb, data)); }
boost::signals2::connection LLButton::setClickedCallback(const CommitCallbackParam& cb) { return setClickedCallback(initCommitCallback(cb)); }