Gluon/Creator: Difference between revisions

From KDE Community Wiki
(Created page with "== Overlay-based semi-interactive introductory tour == Inspired by the N9's tour. Provide an interactive tour of all the important elements of Creator. Code for a transparent QM...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Overlay-based semi-interactive introductory tour ==
==Tasks==
Inspired by the N9's tour. Provide an interactive tour of all the important elements of Creator.
;Ignore prefixed dynamic properties
: For static properties we have an easy way to hide them - use the DESIGNABLE attribute. This is however not usable for dynamic properties. It would be useful to have some way to mark internal properties. For example, the material system is heavily based on dynamic properties, yet things like the model/view/projection matrices really shouldn't be exposed in Creator.
:
: Current thinking is to filter out all properties with some kind of prefix - _property or _gluon_property or _gluon_internal_property or similar. This should be standardised and used in all places.


Code for a transparent QML overlay (added to main.cpp line 58)
;Specialised Katepart-based File Editors
: There are some Gluon-specific file formats used. These currently are opened in Katepart or similar. While there are plans to have a proper extensive node-based editor for these files, an intermediate step would be to create a simple editor based on Katepart for these files. For example, materials are contained in a single file, but it would be nicer for actual editing to use a split editor that separates vertex and fragment shader source.


<syntaxhighlight lang="cpp-qt">
==Ideas==
QDeclarativeView* view = new QDeclarativeView( QUrl::fromLocalFile( KGlobal::dirs()->locate( "appdata", "introduction.qml" ) ), window );
;Overlay-based semi-interactive introductory tour
view->setStyleSheet("background: transparent");
: <strike>Inspired by the N9's tour. Provide an interactive tour of all the important elements of Creator.</strike>
view->setResizeMode( QDeclarativeView::SizeRootObjectToView );
: Implemented as part of GSoC in branch creator-qmlintro-shreya.
view->setGeometry( window->rect() );
view->rootContext()->setContextProperty( "targetRect", window->findChild<QWidget*>( "ComponentsDock" )->frameGeometry() );
view->show();
</syntaxhighlight>
 
Contents of introduction.qml:
 
<syntaxhighlight lang="javascript">
import QtQuick 1.0
 
Item {
    Rectangle {
        id: topOverlay;
       
        anchors.top: parent.top;
        anchors.left: parent.left;
        anchors.right: parent.right;
        anchors.bottom: viewport.top;
       
        opacity: 0.5;
        color: "black";
    }
 
    Rectangle {
        id: leftOverlay;
       
        anchors.top: topOverlay.bottom;
        anchors.left: parent.left;
        anchors.right: viewport.left;
        anchors.bottom: bottomOverlay.top;
       
        opacity: 0.5;
        color: "black";
    }
    Rectangle {
        id: rightOverlay;
       
        anchors.top: topOverlay.bottom;
        anchors.left: viewport.right;
        anchors.right: parent.right;
        anchors.bottom: bottomOverlay.top;
       
        opacity: 0.5;
        color: "black";
    }
    Rectangle {
        id: bottomOverlay;
       
        anchors.top: viewport.bottom;
        anchors.left: parent.left;
        anchors.right: parent.right;
        anchors.bottom: parent.bottom;
       
        opacity: 0.5;
        color: "black";
    }
   
    Item {
        id: viewport;
       
        width: parent.width / 2;
        height: parent.height / 2;
        x: parent.width / 4;
        y: parent.height / 4;
       
        Behavior on width { NumberAnimation { duration: 500; } }
        Behavior on height { NumberAnimation { duration: 500; } }
        Behavior on x { NumberAnimation { duration: 500; } }
        Behavior on y { NumberAnimation { duration: 500; } }
    }
   
    MouseArea {
        anchors.fill: parent;
       
        //drag.target: viewport;
       
        onClicked: {
            viewport.x = targetRect.x;
            viewport.y = targetRect.y;
            viewport.width = targetRect.width;
            viewport.height = targetRect.height;
        }
    }
}
</syntaxhighlight>

Latest revision as of 14:59, 4 December 2012

Tasks

Ignore prefixed dynamic properties
For static properties we have an easy way to hide them - use the DESIGNABLE attribute. This is however not usable for dynamic properties. It would be useful to have some way to mark internal properties. For example, the material system is heavily based on dynamic properties, yet things like the model/view/projection matrices really shouldn't be exposed in Creator.
Current thinking is to filter out all properties with some kind of prefix - _property or _gluon_property or _gluon_internal_property or similar. This should be standardised and used in all places.
Specialised Katepart-based File Editors
There are some Gluon-specific file formats used. These currently are opened in Katepart or similar. While there are plans to have a proper extensive node-based editor for these files, an intermediate step would be to create a simple editor based on Katepart for these files. For example, materials are contained in a single file, but it would be nicer for actual editing to use a split editor that separates vertex and fragment shader source.

Ideas

Overlay-based semi-interactive introductory tour
Inspired by the N9's tour. Provide an interactive tour of all the important elements of Creator.
Implemented as part of GSoC in branch creator-qmlintro-shreya.