Beispiel #1
0
void MainWindow::activateTool(Tool * tool)
{
    bool first_time = (currentTool == 0);

    if (tool == 0)
        tool = static_cast<Tool*>(sender());

    if (currentTool)
        currentTool->deactivate();

    sidebarContents->setCurrentWidget(tool);
    sidebar->setWindowTitle(tool->windowTitle());

    currentTool = tool;
    tool->activate();

    if (sidebar->isVisible())
        tool->action()->setChecked(true);

    // Save current tool in settings

    QSettings settings;
    prepare_settings(settings, model());

    QString toolName = (sidebar->isVisible() || first_time) ?
        tool->objectName() : "none";
    settings.setValue("current_tool", toolName);
}
CloudTextureLayer::CloudTextureLayer() : ParentClass(_("Cloud Texture"), true, ImageFile::CONTRAST_CURVE)
{
    SettingsWidget* settings  = new SettingsWidget;
    prepare_settings("cloud-texture", settings);
    settings->append_imagefile_widget("cloud-texture-file", "File", "The File the Texture is created from", get_imagefile());

    cloud_gradient = Gradient::create(Gradient::PRESENT_FULL_WHITE);
    \
    signal_cloud_gradient_changed().connect(sigc::mem_fun(signal_something_changed(), &sigc::signal<void>::emit));
    \
    settings->append_gradient_widget("night-texture-cloud_gradient", _("CloudGradient"), _("Describes, the Color/Transparency depending on the diffuse lightment"), cloud_gradient);
}