예제 #1
0
Widget::Widget(QWidget *parent, PeerData *peer) : Window::SectionWidget(parent)
, _scroll(this, st::setScroll)
, _inner(this, peer)
, _fixedBar(this, peer)
, _fixedBarShadow(this, st::shadowColor) {
	_fixedBar->move(0, 0);
	_fixedBar->resizeToWidth(width());
	_fixedBar->show();

	_fixedBarShadow->setMode(ToggleableShadow::Mode::HiddenFast);
	_fixedBarShadow->raise();
	updateAdaptiveLayout();
	subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });

	_scroll->setOwnedWidget(_inner);
	_scroll->move(0, _fixedBar->height());
	_scroll->show();

	connect(_scroll, SIGNAL(scrolled()), this, SLOT(onScroll()));
	connect(_inner, SIGNAL(cancelled()), _fixedBar, SLOT(onBack()));
}
예제 #2
0
파일: title.cpp 프로젝트: 2asoft/tdesktop
TitleWidget::TitleWidget(QWidget *parent) : TWidget(parent)
, _cancel(this, lang(lng_cancel), st::titleTextButton)
, _settings(this, lang(lng_menu_settings), st::titleTextButton)
, _contacts(this, lang(lng_menu_contacts), st::titleTextButton)
, _about(this, lang(lng_menu_about), st::titleTextButton)
, _lock(this)
, _update(this)
, _minimize(this)
, _maximize(this)
, _restore(this)
, _close(this)
, _a_update(animation(this, &TitleWidget::step_update))
, lastMaximized(!(parent->windowState() & Qt::WindowMaximized)) {
	setGeometry(0, 0, parent->width(), st::titleHeight);
	setAttribute(Qt::WA_OpaquePaintEvent);

	onWindowStateChanged();
	updateControlsVisibility();

	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked()));
	connect(&_settings, SIGNAL(clicked()), parent, SLOT(showSettings()));
	connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts()));
	connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout()));
	connect(parent->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(onWindowStateChanged(Qt::WindowState)));

#ifndef TDESKTOP_DISABLE_AUTOUPDATE
	Sandbox::connect(SIGNAL(updateReady()), this, SLOT(updateControlsVisibility()));
#endif // !TDESKTOP_DISABLE_AUTOUPDATE

	subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });
	if (Media::Player::exists()) {
		subscribe(Media::Player::instance()->usePanelPlayer(), [this](bool usePanel) {
			updatePlayerButton(usePanel);
		});
	}

    if (cPlatform() != dbipWindows) {
        _minimize.hide();
        _maximize.hide();
        _restore.hide();
        _close.hide();
    }
}
예제 #3
0
TopBarWidget::TopBarWidget(MainWidget *w) : TWidget(w)
, _a_appearance(animation(this, &TopBarWidget::step_appearance))
, _clearSelection(this, lang(lng_selected_clear), st::topBarClearButton)
, _forward(this, lang(lng_selected_forward), st::defaultActiveButton)
, _delete(this, lang(lng_selected_delete), st::defaultActiveButton)
, _info(this, nullptr, st::infoButton)
, _mediaType(this, lang(lng_media_type), st::topBarButton)
, _search(this, st::topBarSearch) {
	_clearSelection->setTextTransform(Ui::RoundButton::TextTransform::ToUpper);
	_forward->setTextTransform(Ui::RoundButton::TextTransform::ToUpper);
	_delete->setTextTransform(Ui::RoundButton::TextTransform::ToUpper);

	connect(_forward, SIGNAL(clicked()), this, SLOT(onForwardSelection()));
	connect(_delete, SIGNAL(clicked()), this, SLOT(onDeleteSelection()));
	connect(_clearSelection, SIGNAL(clicked()), this, SLOT(onClearSelection()));
	connect(_info, SIGNAL(clicked()), this, SLOT(onInfoClicked()));
	connect(_search, SIGNAL(clicked()), this, SLOT(onSearch()));

	subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });

	setCursor(style::cur_pointer);
	showAll();
}