示例#1
0
void MainWindow::actionScale(){
    QAction *action = (QAction*)sender();

    int scaleProperty = action->property("scale").toInt();
    int scaleCurrent = scale();

    switch(scaleProperty){
        case(eZoomIn):
            scaleProperty = scaleCurrent;
            ++scaleProperty;
            break;

        case(eZoomOut):
            scaleProperty = scaleCurrent;
            if(scaleProperty > 1)
                --scaleProperty;
            break;

        case(eFitToWindow):
            int width = scale() * ui.centralWidget->width() / ui.glCanvas->width();
            int height = scale() * ui.centralWidget->height() / ui.glCanvas->height();

            scaleProperty = std::min(width, height);
            break;
    }

    setScale(scaleProperty);

    updateResolution();
}
示例#2
0
void MainWindow::fullScreenWindow(bool fullScreen){
    if(fullScreen)
        this->showFullScreen();
    else
        this->showNormal();
    updateResolution();
}
示例#3
0
void MainWindow::actionResolution(){
    QAction *action = (QAction*)sender();

    setWidth( action->property("width").toInt());
    setHeight(action->property("height").toInt());

    updateResolution();
}
示例#4
0
unsigned int FramebufferImpl::height() const
{
    if (m_resolutionDirty)
    {
        updateResolution();
    }
    return m_height;
}
示例#5
0
unsigned int FramebufferImpl::width() const
{
    if (m_resolutionDirty)
    {
        updateResolution();
    }
    return m_width;
}
示例#6
0
void MainWindow::updateHideMenu(){
    if(hideMenu())
        ui.menuBar->hide();

    else
        ui.menuBar->show();

    updateResolution();
}
示例#7
0
void MainWindow::resizeWindow(int width, int height){
    if(ui.glCanvas->getHardwareOrientation() == eLandscapeLeft || ui.glCanvas->getHardwareOrientation() == eLandscapeRight){
        int temp = width;
        width = height;
        height = temp;
    }
    resize(width, height);
    updateResolution();
}
void LLFacebookPhotoPanel::updateControls()
{
	LLSnapshotLivePreview* previewp = getPreviewView();
	BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
    
	// *TODO: Separate maximum size for Web images from postcards
	LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
    
	updateResolution(FALSE);
}
示例#9
0
void MainWindow::loadSettings(){
    setFullScreen(false);
    setHideMenu(false);

    QSettings settingsNative;

    resize(settingsNative.value("size", QSize(320, 480 + ui.menuBar->height())).toSize());
    move(settingsNative.value("pos",    QPoint(0, 0)).toPoint());

    int red = settingsNative.value("backgroundRed",     240).toInt();
    int green = settingsNative.value("backgroundGreen", 240).toInt();
    int blue = settingsNative.value("backgroundBlue",   240).toInt();
    QColor backgroundColor = QColor(red, green, blue);

    red = settingsNative.value("canvasRed",     255).toInt();
    green = settingsNative.value("canvasGreen", 255).toInt();
    blue = settingsNative.value("canvasBlue",   255).toInt();
    QColor canvasColor = QColor(red, green, blue);

    red = settingsNative.value("infoRed",     0).toInt();
    green = settingsNative.value("infoGreen", 0).toInt();
    blue = settingsNative.value("infoBlue",   0).toInt();
    QColor infoColor = QColor(red, green, blue);

    setBackgroundColor(backgroundColor);
    setCanvasColor(canvasColor);
    setInfoColor(infoColor);

    updateBackgroundColor();
    updateCanvasColor();
    updateInfoColor();

    QSettings settings(Constants::SETTINGS_FOLDER + "/" + Constants::PLAYER_SETTINGS_FILE, QSettings::IniFormat);

    setWidth(settings.value("width",             320).toInt());
    setHeight(settings.value("height",           480).toInt());
    setScale(settings.value("scale",             100).toInt());
    setFps(settings.value("fps",                 60).toInt());
    setOrientation(static_cast<Orientation>(settings.value("orientation", ePortrait).toInt()));
    setDrawInfos(settings.value("drawInfos",     false).toBool());
    setAutoScale(settings.value("autoScale",     false).toBool());
    setAlwaysOnTop(settings.value("alwaysOnTop", false).toBool());

    checkLoadedSettings();

    updateFps();
    updateDrawInfos();
    updateAlwaysOnTop();
    updateAutoScale();
    updateOrientation();
    updateResolution();
}
示例#10
0
void MainWindow::resizeWindow(int width, int height){
    setWidth(width);
    setHeight(height);
    if(orientation() == eLandscapeLeft || orientation() == eLandscapeRight){
        int temp = width;
        width = height;
        height = temp;
    }
    if(!hideMenu())
        height = height + ui.menuBar->height();

    resize(width, height);
    updateResolution();
}
示例#11
0
void KisPDFImportWidget::updateMaxCanvasSize()
{
    m_maxWidthInch = 0., m_maxHeightInch = 0.;
    for (QList<int>::const_iterator it = m_pages.constBegin(); it != m_pages.constEnd(); ++it) {
        Poppler::Page *p = m_pdfDoc->page(*it);
        QSizeF size = p->pageSizeF();
        if (size.width() > m_maxWidthInch) {
            m_maxWidthInch = size.width();
        }
        if (size.height() > m_maxHeightInch) {
            m_maxHeightInch = size.height();
        }
    }
    m_maxWidthInch /= 72.;
    m_maxHeightInch /= 72.;
    dbgFile << m_maxWidthInch << "" << m_maxHeightInch;
    updateResolution();
}
示例#12
0
void MainWindow::updateAutoScale(){
    if(autoScale()){
        ui.centralWidget->setMinimumSize(1, 1);

    }else{
        ui.centralWidget->setMinimumSize(0, 0);

        QAction *action = resolutionGroup_->checkedAction();
        if(action){
            setWidth(action->property("width").toInt());
            setHeight(action->property("height").toInt());
        }
    }

    resolutionGroup_->setEnabled(!autoScale());

    updateResolution();
}
bool Plot3DDialog::updatePlot()
{
	int axis=-1;

	if (generalDialog->currentWidget()==(QWidget*)bars)
	{
		emit updateBars(boxBarsRad->text().toDouble());
	}

	if (generalDialog->currentWidget()==(QWidget*)points)
	{
		if (boxPointStyle->currentItem() == 0)
			emit updatePoints(boxSize->text().toDouble(), boxSmooth->isChecked());
		else if (boxPointStyle->currentItem() == 1)
			emit updateCross(boxCrossRad->text().toDouble(), boxCrossLinewidth->text().toDouble(),
					boxCrossSmooth->isChecked(), boxBoxed->isChecked());
		else if (boxPointStyle->currentItem() == 2)
			emit updateCones(boxConesRad->text().toDouble(), boxQuality->value());
	}

	if (generalDialog->currentWidget()==(QWidget*)title)
	{
		emit updateTitle(boxTitle->text(),titleColor,titleFont);
	}

	if (generalDialog->currentWidget()==(QWidget*)colors)
	{
		emit updateTransparency(boxTransparency->value()*0.01);
		emit updateDataColors(fromColor,toColor);
		emit updateColors(meshColor,axesColor,numColor,labelColor,bgColor,gridColor);
	}

	if (generalDialog->currentWidget()==(QWidget*)general)
	{
		emit showColorLegend(boxLegend->isChecked());
		emit updateMeshLineWidth(boxMeshLineWidth->value());
		emit adjustLabels(boxDistance->value());
		emit updateResolution (boxResolution->value());
		emit showColorLegend(boxLegend->isChecked());
		emit setNumbersFont(numbersFont);
		emit updateZoom(boxZoom->value()*0.01);
		emit updateScaling(boxXScale->value()*0.01,boxYScale->value()*0.01,
				boxZScale->value()*0.01);
	}

	if (generalDialog->currentWidget()==(QWidget*)scale)
	{
		axis=axesList->currentRow();
		QString from=boxFrom->text().toLower();
		QString to=boxTo->text().toLower();
		double start,end;
		bool error=false;
		try
		{
			MyParser parser;
			parser.SetExpr(from.toAscii().constData());
			start=parser.Eval();
		}
		catch(mu::ParserError &e)
		{
			QMessageBox::critical(0,tr("Start limit error"),  QString::fromStdString(e.GetMsg()));
			boxFrom->setFocus();
			error=true;
			return false;
		}
		try
		{
			MyParser parser;
			parser.SetExpr(to.toAscii().constData());
			end=parser.Eval();
		}
		catch(mu::ParserError &e)
		{
			QMessageBox::critical(0,tr("End limit error"), QString::fromStdString(e.GetMsg()));
			boxTo->setFocus();
			error=true;
			return false;
		}

		if (start>=end)
		{
			QMessageBox::critical(0,tr("Input error"),
					tr("Please enter scale limits that satisfy: from < to!"));
			boxTo->setFocus();
			return false;
		}

		if (! error)
			emit updateScale(axis,scaleOptions(axis, start, end,
						boxMajors->text(), boxMinors->text()));
	}

	if (generalDialog->currentWidget()==(QWidget*)axes)
	{
		axis=axesList2->currentRow();
		labels[axis] = boxLabel->text();
		emit updateLabel(axis, boxLabel->text(),axisFont(axis));
		emit updateTickLength(axis,boxMajorLength->text().toDouble(),
				boxMinorLength->text().toDouble());
	}

	return true;
}
示例#14
0
void MainWindow::resizeEvent(QResizeEvent*){    
    if(autoScale())
        updateResolution();
}
示例#15
0
void MainWindow::updateOrientation(){
    ui.glCanvas->setHardwareOrientation(orientation());

    updateResolution();
}