-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): Created new page for
CommunityPermissionsRow
compo…
…nent - Updated permissions related models. - Created new page for new component `CommunityPermissionsRow`
- Loading branch information
Showing
5 changed files
with
362 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
import QtQuick 2.14 | ||
import QtQuick.Controls 2.14 | ||
import QtQuick.Layouts 1.14 | ||
|
||
import Storybook 1.0 | ||
import Models 1.0 | ||
|
||
import AppLayouts.Chat.controls.community 1.0 | ||
|
||
SplitView { | ||
id: root | ||
|
||
property var assetsModel: AssetsModel {} | ||
property var collectiblesModel: CollectiblesModel {} | ||
|
||
Item { | ||
SplitView.fillWidth: true | ||
SplitView.fillHeight: true | ||
|
||
ColumnLayout { | ||
anchors.centerIn: parent | ||
spacing: 16 | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "1 permission:" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.shortPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
} | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "2 short permissions:" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.twoShortPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
} | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "2 long permissions:" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.twoLongPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
} | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "Three short permissions:" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.threeShortPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
} | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "More than 2 permissions with short 1st and 2nd ones:" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.moreThanTwoInitialShortPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
} | ||
|
||
Label { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
|
||
text: "5 permissions - long ones" | ||
} | ||
|
||
CommunityPermissionsRow { | ||
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter | ||
Layout.preferredHeight: heighSliderEditor.value | ||
Layout.bottomMargin: spacing | ||
|
||
assetsModel: root.assetsModel | ||
collectiblesModel: root.collectiblesModel | ||
model: PermissionsModel.longPermissionsModel | ||
requirementsMet: permissionsMetCheckEditor.checked | ||
|
||
spacing: spacingSliderEditor.value | ||
padding: paddingSliderEditor.value | ||
fontPixelSize: 13 | ||
overlapping: overlappingSliderEditor.value | ||
overlappingBorder: overlappingBorderSliderEditor.value | ||
backgroundRadius: 10 | ||
} | ||
} | ||
} | ||
|
||
Pane { | ||
SplitView.minimumWidth: 300 | ||
SplitView.preferredWidth: 300 | ||
|
||
ColumnLayout { | ||
CheckBox { | ||
id: permissionsMetCheckEditor | ||
|
||
text: "Are permissions met?" | ||
} | ||
|
||
Label { | ||
text: "Row heigh:" | ||
} | ||
|
||
Slider { | ||
id: heighSliderEditor | ||
|
||
value: 32 | ||
from: 24 | ||
to: 64 | ||
} | ||
|
||
Label { | ||
text: "Overlapping:" | ||
} | ||
|
||
Slider { | ||
id: overlappingSliderEditor | ||
|
||
value: 8 | ||
from: 0 | ||
to: 16 | ||
} | ||
|
||
Label { | ||
text: "Overlapping border:" | ||
} | ||
|
||
Slider { | ||
id: overlappingBorderSliderEditor | ||
|
||
value: 2 | ||
from: 0 | ||
to: 8 | ||
} | ||
|
||
Label { | ||
text: "Spacing:" | ||
} | ||
|
||
Slider { | ||
id: spacingSliderEditor | ||
|
||
value: 4 | ||
from: 0 | ||
to: 16 | ||
} | ||
|
||
Label { | ||
text: "Padding:" | ||
} | ||
|
||
Slider { | ||
id: paddingSliderEditor | ||
|
||
value: 2 | ||
from: 0 | ||
to: 8 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.