Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dinusv committed Apr 21, 2021
2 parents f4bd322 + ff647c2 commit fec3186
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 76 deletions.
Binary file modified application/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion application/qml/window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ApplicationWindow{

dirOpenDialog.title = title
dirOpenDialog.callback = callback
fileOpenDialog.folder = ""
dirOpenDialog.folder = ""

dirOpenDialog.open()
}
Expand Down
Binary file modified doc/src/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions lib/lveditqmljs/src/codeqmlhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2799,14 +2799,6 @@ QJSValue CodeQmlHandler::expand(QmlEditFragment *edit, const QJSValue &val){
if ( !paletteLoader )
return QJSValue();

// check if duplicate
for ( auto it = edit->begin(); it != edit->end(); ++it ){
CodePalette* loadedPalette = *it;
if ( loadedPalette->path() == PaletteContainer::palettePath(paletteLoader) ){
return m_engine->engine()->newQObject(loadedPalette);
}
}

if ( edit->bindingPalette() && edit->bindingPalette()->path() == PaletteContainer::palettePath(paletteLoader) ){
edit->addPalette(edit->bindingPalette());
return m_engine->engine()->newQObject(edit->bindingPalette());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ WorkspaceControl{
for ( var pi = 0; pi < palettes.length; ++pi ){

var palette = palettes[pi]
if ( palette.name === 'PathPalette' ){
if ( palette.name === 'FilePathPalette' ){
var coords = palette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
editor.makePositionVisible(coords.y + editorCoords.y + 25 - 80)
Expand Down Expand Up @@ -241,7 +241,7 @@ WorkspaceControl{
highlight.boxX = coords.x + editorCoords.x + 185
highlight.boxY = coords.y + editorCoords.y + 70
highlight.box.width = 40
highlight.box.height = 120
highlight.box.height = 60
highlight.box.border.width = 5
highlight.box.border.color = highlight.box.color
highlight.box.color = 'transparent'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ WorkspaceControl{
"properties": [
{
"name": "path",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
},
{
"name": "args",
Expand All @@ -51,7 +51,7 @@ WorkspaceControl{
},
{
"name": "path",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
},
{
"name": "args",
Expand Down
2 changes: 1 addition & 1 deletion plugins/editqml/qml/ObjectContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Item{
compact = false
if (paletteControls.instructionsShaping) return
paletteControls.openEmptyNestedObjects(root)
// paletteControls.openDefaults(root)
paletteControls.openDefaults(root)

var id = editingFragment.objectId()
var check = (objectContainer.title.indexOf('#') === -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ WorkspaceControl{
highlight = createHighlight(state)

highlight.boxX = viewerCoords.x - 10
highlight.boxY = viewerCoords.y - 10
highlight.boxY = viewerCoords.y + 20
highlight.box.width = 460
highlight.box.height = 35
highlight.box.border.width = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WorkspaceControl{
"properties": [
{
"name": "source",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
}
]
},
Expand Down
7 changes: 4 additions & 3 deletions plugins/lcvcore/samples/drawing/drawing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ This sample shows a processing pipeline for drawing.

* The [first component]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#first-component;livekeys://open/resources/DrawingRemoveHighlight.qml#first-component}) creates a blank white image of size 800x600

* Our second component is a [`Draw` component]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#draw-component;livekeys://open/resources/DrawingRemoveHighlight.qml#draw-component}), allowing you to draw on the blank image.
You can select the brush size by [this icon]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#brush-icon;livekeys://open/resources/DrawingRemoveHighlight.qml#brush-icon}), and the color through the [box just
below]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#color-icon;livekeys://open/resources/DrawingRemoveHighlight.qml#color-icon}).
* Our second component is a [`DrawSurface` component]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#draw-component;livekeys://open/resources/DrawingRemoveHighlight.qml#draw-component}), allowing you to draw on the blank image, or create a gradient.
You can select the brush tool by clicking on [this icon]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#brush-icon;livekeys://open/resources/DrawingRemoveHighlight.qml#brush-icon}). After that, you can change the brush size by clicking [here]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#brush-size;livekeys://open/resources/DrawingRemoveHighlight.qml#brush-size}) and dragging the slider.
The gradient tool can be selected by clicking on [this icon]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#gradient-icon;livekeys://open/resources/DrawingRemoveHighlight.qml#gradient-icon}), and the gradient itself is created by dragging a point across the image shown.
For both tools, you can select the foreground and background colors with the pair of [color pickers]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#color-pickers;livekeys://open/resources/DrawingRemoveHighlight.qml#color-pickers}).

* The [third component]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#histogram-component;livekeys://open/resources/DrawingRemoveHighlight.qml#histogram-component}) is a color histogram of the image, displayed [here]({livekeys-hover:livekeys://open/resources/DrawingHighlight.qml#histogram-view;livekeys://open/resources/DrawingRemoveHighlight.qml#histogram-view}), that
will update in real-time as the image is being drawn on.
Expand Down
158 changes: 108 additions & 50 deletions plugins/lcvcore/samples/drawing/resources/DrawingHighlight.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,38 @@ WorkspaceControl{
return ob
}

function findDrawPalette(){
var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
return

var editor = editorPane.editor
var codeHandler = editor.documentHandler.codeHandler

var editingFragments = codeHandler.editingFragments()

for ( var i = 0; i < editingFragments.length; ++i ){
var gridEdit = editingFragments[i]
if ( gridEdit.type() === 'qml/QtQuick#Grid' ){
var childFragments = gridEdit.getChildFragments()
for ( var j = 0; j < childFragments.length; ++j ){
var drawSurfaceEdit = childFragments[j]
if ( drawSurfaceEdit.type() === 'qml/lcvcore#DrawSurface' ){
var palettes = drawSurfaceEdit.paletteList()
for ( var pi = 0; pi < palettes.length; ++pi ){
var palette = palettes[pi]
if (palette.name === 'DrawPalette'){
return palette
}
}
}
}
}
}

return null
}

run: function(workspace, state, fragment){
var highlight = null
if ( fragment === 'first-component' ){
Expand Down Expand Up @@ -79,7 +111,7 @@ WorkspaceControl{
var childFragments = gridEdit.getChildFragments()
for ( var j = 0; j < childFragments.length; ++j ){
var blankImageEdit = childFragments[j]
if ( blankImageEdit.type() === 'qml/lcvcore#Draw' ){
if ( blankImageEdit.type() === 'qml/lcvcore#DrawSurface' ){
var objectContainer = blankImageEdit.visualParent.parent.parent.parent

var coords = objectContainer.mapToItem(editor, 0, 0)
Expand All @@ -89,79 +121,105 @@ WorkspaceControl{
highlight = createHighlight(state)
highlight.boxX = coords.x + editorCoords.x + 20
highlight.boxY = coords.y + editorCoords.y + 33
highlight.box.width = 110
highlight.box.width = 210
highlight.box.height = 35

}
}
}
}
} else if ( fragment === 'brush-icon' ){
var drawPalette = findDrawPalette()
if (!drawPalette) return

var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
return

var editor = editorPane.editor
var codeHandler = editor.documentHandler.codeHandler
var coords = drawPalette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
var xOffset = -3
var yOffset = 65
editor.makePositionVisible(coords.y + editorCoords.y + yOffset - 80)
coords = drawPalette.item.mapToItem(editor, 0, 0)
highlight = createHighlight(state)

var editingFragments = codeHandler.editingFragments()
highlight.boxX = coords.x + editorCoords.x + xOffset
highlight.boxY = coords.y + editorCoords.y + yOffset
highlight.box.width = 30
highlight.box.height = 30
return highlight
} else if ( fragment === 'brush-size' ){
var drawPalette = findDrawPalette()
if (!drawPalette) return

for ( var i = 0; i < editingFragments.length; ++i ){
var gridEdit = editingFragments[i]
if ( gridEdit.type() === 'qml/QtQuick#Grid' ){
var childFragments = gridEdit.getChildFragments()
for ( var j = 0; j < childFragments.length; ++j ){
var blankImageEdit = childFragments[j]
if ( blankImageEdit.type() === 'qml/lcvcore#Draw' ){
var objectContainer = blankImageEdit.visualParent.parent.parent.parent
var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
return

var coords = objectContainer.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
editor.makePositionVisible(coords.y + editorCoords.y + 115 - 80)
coords = objectContainer.mapToItem(editor, 0, 0)
highlight = createHighlight(state)
highlight.boxX = coords.x + editorCoords.x + 7
highlight.boxY = coords.y + editorCoords.y + 115
highlight.box.width = 35
highlight.box.height = 35
var editor = editorPane.editor
var coords = drawPalette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
var xOffset = 110
var yOffset = 30
editor.makePositionVisible(coords.y + editorCoords.y + yOffset - 80)
coords = drawPalette.item.mapToItem(editor, 0, 0)
highlight = createHighlight(state)

highlight.boxX = coords.x + editorCoords.x + xOffset
highlight.boxY = coords.y + editorCoords.y + yOffset
highlight.box.width = 30
highlight.box.height = 30
return highlight
} else if ( fragment === 'gradient-icon' ){
var drawPalette = findDrawPalette()
if (!drawPalette) return

}
}
}
}
} else if ( fragment === 'color-icon' ){
var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
return

var editor = editorPane.editor
var codeHandler = editor.documentHandler.codeHandler
var coords = drawPalette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
var xOffset = 24
var yOffset = 65
editor.makePositionVisible(coords.y + editorCoords.y + yOffset - 80)
coords = drawPalette.item.mapToItem(editor, 0, 0)
highlight = createHighlight(state)

var editingFragments = codeHandler.editingFragments()
highlight.boxX = coords.x + editorCoords.x + xOffset
highlight.boxY = coords.y + editorCoords.y + yOffset
highlight.box.width = 30
highlight.box.height = 30
return highlight
} else if ( fragment === 'color-pickers' ){
var drawPalette = findDrawPalette()
if (!drawPalette) return

for ( var i = 0; i < editingFragments.length; ++i ){
var gridEdit = editingFragments[i]
if ( gridEdit.type() === 'qml/QtQuick#Grid' ){
var childFragments = gridEdit.getChildFragments()
for ( var j = 0; j < childFragments.length; ++j ){
var blankImageEdit = childFragments[j]
if ( blankImageEdit.type() === 'qml/lcvcore#Draw' ){
var objectContainer = blankImageEdit.visualParent.parent.parent.parent
var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
return

var coords = objectContainer.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
editor.makePositionVisible(coords.y + editorCoords.y + 140 - 80)
coords = objectContainer.mapToItem(editor, 0, 0)
highlight = createHighlight(state)
highlight.boxX = coords.x + editorCoords.x + 7
highlight.boxY = coords.y + editorCoords.y + 140
highlight.box.width = 35
highlight.box.height = 35
var editor = editorPane.editor
var coords = drawPalette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
var xOffset = -10
var yOffset = 180
editor.makePositionVisible(coords.y + editorCoords.y + yOffset - 80)
coords = drawPalette.item.mapToItem(editor, 0, 0)
highlight = createHighlight(state)

highlight.boxX = coords.x + editorCoords.x + xOffset
highlight.boxY = coords.y + editorCoords.y + yOffset
highlight.box.width = 70
highlight.box.height = 70
highlight.box.border.width = 5
highlight.box.border.color = highlight.box.color
highlight.box.color = 'transparent'
return highlight

}
}
}
}
} else if ( fragment === 'histogram-component' ){
var editorPane = lk.layers.workspace.panes.focusPane('editor')
if ( !editorPane )
Expand Down Expand Up @@ -203,7 +261,7 @@ WorkspaceControl{
var coords = viewerPane.mapGlobalPosition()
highlight = createHighlight(state)
highlight.boxX = coords.x - 15
highlight.boxY = coords.y - 15
highlight.boxY = coords.y + 15
highlight.box.width = 330
highlight.box.height = 235
highlight.box.border.width = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ WorkspaceControl{
var palettes = sourceProperty.paletteList()
for ( var pi = 0; pi < palettes.length; ++pi ){
var palette = palettes[pi]
if ( palette.name === 'PathPalette' ){
if ( palette.name === 'FilePathPalette' ){
palette.value = project.path('../../../../samples/_images/buildings_0246.jpg')
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WorkspaceControl{
"properties": [
{
"name": "source",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WorkspaceControl{
"properties": [
{
"name": "file",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ WorkspaceControl{
"properties": [
{
"name": "file",
"palettes": ["PathPalette"]
"palettes": ["FilePathPalette"]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ WorkspaceControl{
highlight.box.width = 100
highlight.box.height = 20
} else if ( fragment === 'play-button' ){
highlight = createTimelineHighlight(state, 31, 31)
highlight = createTimelineHighlight(state, 40, 31)
highlight.box.width = 35
highlight.box.height = 35
} else if ( fragment === 'options-button' ){
Expand Down Expand Up @@ -148,7 +148,7 @@ WorkspaceControl{
var coords = viewerPane.mapGlobalPosition()
highlight = createHighlight(state)
highlight.boxX = coords.x
highlight.boxY = coords.y
highlight.boxY = coords.y + 30
highlight.box.width = 600
highlight.box.height = 400
highlight.box.border.width = 5
Expand Down Expand Up @@ -197,7 +197,7 @@ WorkspaceControl{
for ( var pi = 0; pi < palettes.length; ++pi ){

var palette = palettes[pi]
if ( palette.name === 'PathPalette' ){
if ( palette.name === 'FilePathPalette' ){
var coords = palette.item.mapToItem(editor, 0, 0)
var editorCoords = editorPane.mapGlobalPosition()
editor.makePositionVisible(coords.y + editorCoords.y + 25 - 80)
Expand Down

0 comments on commit fec3186

Please sign in to comment.