Skip to content

Commit

Permalink
WIP: swatch textured fill
Browse files Browse the repository at this point in the history
Closes #74.
  • Loading branch information
mitchcurtis committed Sep 28, 2019
1 parent 400b6de commit 9388d29
Show file tree
Hide file tree
Showing 24 changed files with 531 additions and 159 deletions.
2 changes: 1 addition & 1 deletion app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Application::Application(int &argc, char **argv, const QString &applicationName)
qmlRegisterUncreatableType<Project>("App", 1, 0, "Project", QLatin1String("Cannot create objects of type Project"));
qmlRegisterUncreatableType<LayeredImageProject>("App", 1, 0, "LayeredImageProject",
QLatin1String("Cannot create objects of type LayeredImageProject"));
qmlRegisterUncreatableType<TexturedFillParameter>("App", 1, 0, "TexturedFillParameter",
qmlRegisterUncreatableType<TexturedFillVarianceParameter>("App", 1, 0, "TexturedFillParameter",
QLatin1String("Cannot create objects of type TexturedFillParameter"));
qmlRegisterUncreatableType<TexturedFillParameters>("App", 1, 0, "TexturedFillParameters",
QLatin1String("Cannot create objects of type TexturedFillParameters"));
Expand Down
9 changes: 7 additions & 2 deletions app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,19 @@ ApplicationWindow {
property alias windowVisibility: window.visibility
}

Connections {
target: projectManager
onCreationFailed: errorPopup.showError(errorMessage)
}

Connections {
target: projectManager.project ? projectManager.project : null
onErrorOccurred: errorPopup.showError(errorMessage)
}

Connections {
target: projectManager
onCreationFailed: errorPopup.showError(errorMessage)
target: canvas
onErrorOccurred: errorPopup.showError(errorMessage)
}

Ui.UiStateSerialisation {
Expand Down
1 change: 1 addition & 0 deletions app/qml/qml.qbs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Group {
"ui/UiStateSerialisation.qml",
"ui/UiConstants.qml",
"ui/VerticalSeparator.qml",
"ui/ViewBorder.qml",
"ui/ZoomIndicator.qml"
]

Expand Down
1 change: 1 addition & 0 deletions app/qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<file>ui/UiStateSerialisation.qml</file>
<file>ui/UiConstants.qml</file>
<file>ui/VerticalSeparator.qml</file>
<file>ui/ViewBorder.qml</file>
<file>ui/ZoomIndicator.qml</file>
<file>ui/qmldir</file>
<file>ui/+imagine/Theme.qml</file>
Expand Down
7 changes: 7 additions & 0 deletions app/qml/ui/+nativemenubar/MenuBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ Item {

Platform.MenuSeparator {}

Platform.MenuItem {
objectName: "addSelectedColoursToTexturedFillSwatchMenuItem"
text: qsTr("Add to Textured Fill Swatch")
onTriggered: canvas.addSelectedColoursToTexturedFillSwatch()
enabled: isImageProjectType && canvas && canvas.hasSelection
}

Platform.MenuItem {
objectName: "texturedFillSettingsMenuItem"
//: Opens a dialog that allows the user to change the settings for the Textured Fill tool.
Expand Down
7 changes: 7 additions & 0 deletions app/qml/ui/MenuBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ Controls.MenuBar {

MenuSeparator {}

MenuItem {
objectName: "addSelectedColoursToTexturedFillSwatchMenuItem"
text: qsTr("Add to Textured Fill Swatch")
onTriggered: canvas.addSelectedColoursToTexturedFillSwatch()
enabled: isImageProjectType && canvas && canvas.hasSelection
}

MenuItem {
objectName: "texturedFillSettingsMenuItem"
//: Opens a dialog that allows the user to change the settings for the Textured Fill tool.
Expand Down
10 changes: 2 additions & 8 deletions app/qml/ui/OptionsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,12 @@ Dialog {
anchors.bottom: parent.bottom
}

Rectangle {
width: parent.width
height: 1
ViewBorder {
anchors.top: parent.top
color: "#1a000000"
}

Rectangle {
width: parent.width
height: 1
ViewBorder {
anchors.bottom: parent.bottom
color: "#1a000000"
}

model: ObjectModel {
Expand Down
19 changes: 19 additions & 0 deletions app/qml/ui/SwatchContextMenu.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2019, Mitch Curtis
This file is part of Slate.
Slate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Slate is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Slate. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.12
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.12
Expand Down
19 changes: 19 additions & 0 deletions app/qml/ui/SwatchGridView.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright 2019, Mitch Curtis
This file is part of Slate.
Slate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Slate is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Slate. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.3
Expand Down
3 changes: 2 additions & 1 deletion app/qml/ui/SwatchPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ Panel {
}

model: SwatchModel {
project: root.project
objectName: "swatchModel"
swatch: root.project ? root.project.swatch : null
}
}
}
Expand Down
Loading

0 comments on commit 9388d29

Please sign in to comment.