Exemplo n.º 1
0
void ActionBar::setVisible(bool bVisible)
{
	if (isVisible() != bVisible)
	{

		if (bVisible)
		{
				Layer::setVisible(bVisible);
		}


		if (!bVisible)
		{
				setButtonVisible(bVisible) ;
				Layer::setVisible(bVisible);
			//doActionMoveOut();
		}

		if (m_table!=nullptr)
		{
			m_table->callUserControl(bVisible) ;
		}
		
	}

}
Exemplo n.º 2
0
KNMusicLyricsDownloadDialog::KNMusicLyricsDownloadDialog(QWidget *parent) :
    KNMusicLyricsDownloadDialogBase(knGlobal->mainWindow()),
    m_downloadWidget(new KNMusicLyricsDownloadWidget(this))
{
    Q_UNUSED(parent)
    //Set properties.
    setContentWidget(m_downloadWidget);
    setTitleText("Lyrics");
    setShowCancelButton(true);
    setShowOkayButton(false);

    //Configure the download widget.
    connect(m_downloadWidget, &KNMusicLyricsDownloadWidget::requireExpand,
            this, &KNMusicLyricsDownloadDialog::onActionExpand);
    connect(m_downloadWidget,
            &KNMusicLyricsDownloadWidget::requireShowOkayButton,
            [=]{setButtonVisible(true, true);});
    connect(m_downloadWidget,
            &KNMusicLyricsDownloadWidget::requireHideOkayButton,
            [=]{setButtonVisible(true, false);});
}
Exemplo n.º 3
0
void ActionBar::doActionMoveOut()
{
	float s_curx ,s_cury;
	s_curx = m_actionbarleft->getPositionX() ;
	s_cury = m_actionbarleft->getPositionY();

	//m_actionbarleft->setPositionY(s_cury-200);
	m_actionbarleft->runAction(MoveTo::create(0.2,Point(s_curx,s_cury-300))) ;

	s_curx = m_actionbaright->getPositionX() ;
	s_cury = m_actionbaright->getPositionY();


	auto funEndCollecting = [this](){this->setVisible(false);setButtonVisible(false) ;}; // 结束后腰设置标志,以便后面的回调比如发公牌

	m_actionbaright->runAction(  Sequence::create(MoveTo::create(0.2,Point(s_curx,s_cury-300)),funEndCollecting,nullptr)) ;

}
FilterLineEdit::FilterLineEdit(QWidget *parent) :
   FancyLineEdit(parent),
   m_lastFilterText(text())
{
    // KDE has custom icons for this. Notice that icon namings are counter intuitive.
    // If these icons are not available we use the freedesktop standard name before
    // falling back to a bundled resource.
    QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ?
                     QLatin1String("edit-clear-locationbar-rtl") :
                     QLatin1String("edit-clear-locationbar-ltr"),
                     QIcon::fromTheme(QLatin1String("edit-clear"), QIcon(QLatin1String(":/core/images/editclear.png"))));

    setButtonPixmap(Right, icon.pixmap(16));
    setButtonVisible(Right, true);
    setPlaceholderText(tr("Filter"));
    setButtonToolTip(Right, tr("Clear text"));
    setAutoHideButton(Right, true);
    connect(this, SIGNAL(rightButtonClicked()), this, SLOT(clear()));
    connect(this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged()));
}
Exemplo n.º 5
0
LLSearchComboBox::LLSearchComboBox(const Params&p)
: LLComboBox(p)
{
	S32 btn_top = p.search_button.top_pad + p.search_button.rect.height;
	S32 btn_right = p.search_button.rect.width + p.search_button.left_pad;
	LLRect search_btn_rect(p.search_button.left_pad, btn_top, btn_right, p.search_button.top_pad);

	LLButton::Params button_params(p.search_button);
	button_params.name(std::string("search_btn"));
	button_params.rect(search_btn_rect) ;
	button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP);
	button_params.tab_stop(false);
	button_params.click_callback.function(boost::bind(&LLSearchComboBox::onSelectionCommit, this));
	mSearchButton = LLUICtrlFactory::create<LLButton>(button_params);
	mTextEntry->addChild(mSearchButton);
	mTextEntry->setPassDelete(TRUE);

	setButtonVisible(p.dropdown_button_visible);
	mTextEntry->setCommitCallback(boost::bind(&LLComboBox::onTextCommit, this, _2));
	mTextEntry->setKeystrokeCallback(boost::bind(&LLComboBox::onTextEntry, this, _1), NULL);
	setCommitCallback(boost::bind(&LLSearchComboBox::onSelectionCommit, this));
	setPrearrangeCallback(boost::bind(&LLSearchComboBox::onSearchPrearrange, this, _2));
	mSearchButton->setCommitCallback(boost::bind(&LLSearchComboBox::onTextCommit, this, _2));
}