Skip to content

Commit

Permalink
chore(CommunityPermissions): Simplify InDropdown popup (selecting onl…
Browse files Browse the repository at this point in the history
…y channels, no add channel button)
  • Loading branch information
micieslak committed Jan 26, 2023
1 parent e2dadeb commit ecf999e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions storybook/pages/InDropdownPage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14

import AppLayouts.Chat.controls.community 1.0

Expand All @@ -23,6 +24,9 @@ SplitView {
parent: pane
anchors.centerIn: parent

allowChoosingEntireCommunity: allowChoosingEntireCommunityCheckBox.checked
showAddChannelButton: showAddChannelButtonCheckBox.checked

communityName: "Socks"
communityImage: ModelsData.icons.socks
communityColor: "red"
Expand Down Expand Up @@ -53,5 +57,18 @@ SplitView {
SplitView.preferredHeight: 200

logsView.logText: logs.logText

ColumnLayout {
CheckBox {
id: allowChoosingEntireCommunityCheckBox

text: "Allow choosing entire community"
}
CheckBox {
id: showAddChannelButtonCheckBox

text: "Show \"Add channel\" button"
}
}
}
}
10 changes: 10 additions & 0 deletions ui/app/AppLayouts/Chat/controls/community/InDropdown.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import SortFilterProxyModel 0.2
StatusDropdown {
id: root

property bool allowChoosingEntireCommunity: false
property bool showAddChannelButton: false

property string communityName
property string communityImage
property color communityColor
Expand Down Expand Up @@ -100,6 +103,7 @@ StatusDropdown {
Layout.topMargin: 9
Layout.preferredHeight: 44

visible: root.allowChoosingEntireCommunity

title: root.communityName
subTitle: qsTr("Community")
Expand Down Expand Up @@ -147,13 +151,17 @@ StatusDropdown {
Layout.fillWidth: true
Layout.topMargin: 4 - implicitHeight / 2
Layout.bottomMargin: 4 - implicitHeight / 2

visible: root.allowChoosingEntireCommunity
}

StatusScrollView {
id: scrollView

Layout.fillWidth: true
Layout.bottomMargin: 9
Layout.topMargin:
!root.allowChoosingEntireCommunity && !root.allowChoosingEntireCommunity ? 9 : 0

padding: 0

Expand All @@ -166,6 +174,8 @@ StatusDropdown {
StatusIconTextButton {
Layout.preferredHeight: 36

visible: root.showAddChannelButton

leftPadding: 8
spacing: 8
statusIcon: "add"
Expand Down

0 comments on commit ecf999e

Please sign in to comment.