void
OptionsWidget::dpiChanged(std::set<PageId> const& pages, Dpi const& dpi)
{
	BOOST_FOREACH(PageId const& page_id, pages) {
		m_ptrSettings->setDpi(page_id, dpi);
		emit invalidateThumbnail(page_id);
	}
void
OptionsWidget::manualContentRectSet(QRectF const& content_rect)
{
	m_uiData.setContentRect(content_rect);
	m_uiData.setMode(MODE_MANUAL);
	updateModeIndication(MODE_MANUAL);
	commitCurrentParams();
	
	emit invalidateThumbnail(m_pageId);
}
Exemple #3
0
void
ImageView::unremoveRightPage()
{
	PageInfo page_info(
		m_ptrPages->unremovePage(PageId(m_imageId, PageId::RIGHT_PAGE))
	);
	m_rightUnremoveButton.unlink();
	m_rightPageRemoved = false;
	
	update();
	
	// We need invalidateThumbnail(PageInfo) rather than (PageId),
	// as we are updating page removal status.
	page_info.setId(PageId(m_imageId, PageId::SINGLE_PAGE));
	emit invalidateThumbnail(page_info);
}
void
OptionsWidget::applySelection(std::set<PageId> const& pages)
{
	if (pages.empty()) {
		return;
	}
	
	Params const params(
		m_uiData.contentRect(), m_uiData.contentSizeMM(),
		m_uiData.dependencies(), m_uiData.mode()
	);

	BOOST_FOREACH(PageId const& page_id, pages) {
		m_ptrSettings->setPageParams(page_id, params);
		emit invalidateThumbnail(page_id);
	}
void
OptionsWidget::bwThresholdChanged()
{
	int const value = thresholdSlider->value();
	QString const tooltip_text(QString::number(value));
	thresholdSlider->setToolTip(tooltip_text);
	
	thresholLabel->setText(QString::number(value));
	
	if (m_ignoreThresholdChanges) {
		return;
	}
	
	// Show the tooltip immediately.
	QPoint const center(thresholdSlider->rect().center());
	QPoint tooltip_pos(thresholdSlider->mapFromGlobal(QCursor::pos()));
	tooltip_pos.setY(center.y());
	tooltip_pos.setX(qBound(0, tooltip_pos.x(), thresholdSlider->width()));
	tooltip_pos = thresholdSlider->mapToGlobal(tooltip_pos);
	QToolTip::showText(tooltip_pos, tooltip_text, thresholdSlider);
	
	if (thresholdSlider->isSliderDown()) {
		// Wait for it to be released.
		// We could have just disabled tracking, but in that case we wouldn't
		// be able to show tooltips with a precise value.
		return;
	}

	BlackWhiteOptions opt(m_colorParams.blackWhiteOptions());
	if (opt.thresholdAdjustment() == value) {
		// Didn't change.
		return;
	}

	opt.setThresholdAdjustment(value);
	m_colorParams.setBlackWhiteOptions(opt);
	m_ptrSettings->setColorParams(m_pageId, m_colorParams);
	emit reloadRequested();
	
	emit invalidateThumbnail(m_pageId);
}