Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c68ee3dbe4 | ||
|
|
bcb1e1cd97 | ||
|
|
d5bd64b742 | ||
|
|
c63cbedebf | ||
|
|
8ca20bc70a | ||
|
|
983b9cbce9 |
+4
-3
@@ -567,8 +567,9 @@ Rectangle {
|
||||
chatInfoButton.type: StatusChatInfoButton.Type.CommunityChat
|
||||
onSearchButtonClicked: {
|
||||
searchButton.highlighted = !searchButton.highlighted;
|
||||
searchPopup.searchSelectionButton.primaryText = demoCommunityDetailModal.header.title;
|
||||
searchPopup.searchSelectionButton.image.source = demoCommunityDetailModal.header.image.source;
|
||||
searchPopup.setSearchSelection(demoCommunityDetailModal.header.title,
|
||||
"",
|
||||
demoCommunityDetailModal.header.image.source);
|
||||
searchPopup.open();
|
||||
}
|
||||
membersButton.onClicked: membersButton.highlighted = !membersButton.highlighted
|
||||
@@ -618,7 +619,7 @@ Rectangle {
|
||||
StatusSearchLocationMenu {
|
||||
id: searchPopupMenu
|
||||
searchPopup: searchPopup
|
||||
locatioModel: models.optionsModel
|
||||
locationModel: models.optionsModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+30
-19
@@ -196,46 +196,48 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
|
||||
//dummy search popup models
|
||||
property var searchResultsA: ListModel {
|
||||
ListElement { name: "@Flea"; sectionName: "Messages"; time: "18:55 AM"; content: "lorem ipsum <font color='#4360DF'>@Nick</font> dolor sit amet";
|
||||
ListElement { itemId: "i1"; titleId: "t1"; title: "@Flea"; sectionName: "Messages"; time: "18:55 AM"; content: "lorem ipsum <font color='#4360DF'>@Nick</font> dolor sit amet";
|
||||
badgeImage: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg";
|
||||
badgePrimaryText: "CryptoKities";
|
||||
badgeSecondaryText: "";
|
||||
badgeIdenticonColor: "";
|
||||
isLetterIdenticon: false }
|
||||
ListElement { name: "core"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "communities-phase3"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "core-ui"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "desktop"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "Crocodile Vanilla Bird"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "carmen eth"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "CryptoKitties"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "MyCommunity"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "Foo"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i2"; titleId: "t2"; title: "core"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i3"; titleId: "t3"; title: "communities-phase3"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i4"; titleId: "t4"; title: "core-ui"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i5"; titleId: "t5"; title: "desktop"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i6"; titleId: "t6"; title: "Crocodile Vanilla Bird"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i7"; titleId: "t7"; title: "carmen eth"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i8"; titleId: "t8"; title: "CryptoKitties"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i9"; titleId: "t9"; title: "MyCommunity"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i10"; titleId: "t10"; title: "Foo"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
}
|
||||
property var searchResultsB: ListModel {
|
||||
ListElement { name: "@Ant"; sectionName: "Messages"; time: "11:43 AM"; content: "<font color='#4360DF'>@John</font>, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum ";
|
||||
ListElement { itemId: "i1"; titleId: "t1"; title: "@Ant"; sectionName: "Messages"; time: "11:43 AM"; content: "<font color='#4360DF'>@John</font>, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum ";
|
||||
badgeImage: "";
|
||||
badgePrimaryText: "CryptoKities";
|
||||
badgeSecondaryText: "#design";
|
||||
badgeIdenticonColor: "pink"; isLetterIdenticon: true }
|
||||
ListElement { name: "support"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "desktop-ui"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "climate-change"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "food"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: "pink"; isLetterIdenticon: true }
|
||||
ListElement { name: "CryptoKitties"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "CryptoRangers"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { name: "Foo"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: "orange"; isLetterIdenticon: true }
|
||||
ListElement { itemId: "i2"; titleId: "t2"; title: "support"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i3"; titleId: "t3"; title: "desktop-ui"; sectionName: "Channels"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i4"; titleId: "t4"; title: "climate-change"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i5"; titleId: "t5"; title: "food"; sectionName: "Chat"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: "pink"; isLetterIdenticon: true }
|
||||
ListElement { itemId: "i6"; titleId: "t6"; title: "CryptoKitties"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i7"; titleId: "t7"; title: "CryptoRangers"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: ""; isLetterIdenticon: false }
|
||||
ListElement { itemId: "i8"; titleId: "t8"; title: "Foo"; sectionName: "Communities"; time: ""; content: ""; badgeImage: ""; badgePrimaryText: ""; badgeSecondaryText: ""; badgeIdenticonColor: "orange"; isLetterIdenticon: true }
|
||||
}
|
||||
|
||||
property ListModel optionsModel: ListModel {
|
||||
ListElement {
|
||||
title: "Item with icon";
|
||||
value: "item_1"
|
||||
title: "Item with icon"
|
||||
imageSource: ""
|
||||
iconName: "chat"
|
||||
iconColor: ""
|
||||
isIdenticon: false
|
||||
subItems: [
|
||||
ListElement {
|
||||
value: "sub_item_1_1"
|
||||
text: "Profile image item"
|
||||
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
||||
iconName: ""
|
||||
@@ -243,6 +245,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
},
|
||||
ListElement {
|
||||
value: "sub_item_1_2"
|
||||
text: "identicon item"
|
||||
imageSource: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
|
||||
iconName: ""
|
||||
@@ -250,6 +253,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: true
|
||||
}]}
|
||||
ListElement {
|
||||
value: "item_2"
|
||||
title: "Community item";
|
||||
imageSource: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
||||
iconName: ""
|
||||
@@ -257,6 +261,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
subItems: [
|
||||
ListElement {
|
||||
value: "sub_item_2_1"
|
||||
text: "welcome"
|
||||
imageSource: ""
|
||||
iconName: "channel"
|
||||
@@ -264,6 +269,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
},
|
||||
ListElement {
|
||||
value: "sub_item_2_2"
|
||||
text: "support"
|
||||
imageSource: ""
|
||||
iconName: "channel"
|
||||
@@ -271,6 +277,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
},
|
||||
ListElement {
|
||||
value: "sub_item_2_3"
|
||||
text: "news"
|
||||
imageSource: ""
|
||||
iconName: "channel"
|
||||
@@ -278,6 +285,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
}]}
|
||||
ListElement {
|
||||
value: "item_3"
|
||||
title: "Other";
|
||||
imageSource: "";
|
||||
iconName: "info"
|
||||
@@ -285,6 +293,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
subItems: [
|
||||
ListElement {
|
||||
value: "sub_item_3_1"
|
||||
text: "news"
|
||||
imageSource: ""
|
||||
iconName: "channel"
|
||||
@@ -292,6 +301,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
}]}
|
||||
ListElement {
|
||||
value: "item_4"
|
||||
title: "Letter identicon";
|
||||
imageSource: "";
|
||||
iconName: ""
|
||||
@@ -299,6 +309,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
|
||||
isIdenticon: false
|
||||
subItems: [
|
||||
ListElement {
|
||||
value: "sub_item_4_1"
|
||||
text: "news"
|
||||
imageSource: ""
|
||||
iconName: "channel"
|
||||
|
||||
@@ -23,15 +23,12 @@ StatusListItem {
|
||||
property alias menuButton: menuButton
|
||||
property alias toggleButton: toggleButton
|
||||
|
||||
signal clicked(var mouse)
|
||||
signal addButtonClicked(var mouse)
|
||||
signal menuButtonClicked(var mouse)
|
||||
signal toggleButtonClicked(var mouse)
|
||||
|
||||
color: sensor.containsMouse || highlighted ? Theme.palette.baseColor2 : "transparent"
|
||||
|
||||
sensor.onClicked: statusChatListCategoryItem.clicked(mouse)
|
||||
|
||||
statusListItemTitle.color: Theme.palette.directColor4
|
||||
statusListItemTitle.font.weight: Font.Medium
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ Rectangle {
|
||||
|
||||
radius: 8
|
||||
|
||||
property string itemId: ""
|
||||
property string titleId: ""
|
||||
|
||||
property string title: ""
|
||||
property string titleAsideText: ""
|
||||
property string subTitle: ""
|
||||
@@ -83,6 +86,9 @@ Rectangle {
|
||||
|
||||
property list<Item> components
|
||||
|
||||
signal clicked(string itemId)
|
||||
signal titleClicked(string titleId)
|
||||
|
||||
onComponentsChanged: {
|
||||
if (components.length) {
|
||||
for (let idx in components) {
|
||||
@@ -100,6 +106,10 @@ Rectangle {
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
hoverEnabled: true
|
||||
|
||||
onClicked: {
|
||||
statusListItem.clicked(statusListItem.itemId)
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: iconOrImage
|
||||
anchors.left: parent.left
|
||||
@@ -187,6 +197,15 @@ Rectangle {
|
||||
return Theme.palette.dangerColor1
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: containsMouse? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
statusListItem.titleClicked(statusListItem.titleId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusBaseText {
|
||||
|
||||
@@ -9,30 +9,27 @@ StatusPopupMenu {
|
||||
id: root
|
||||
|
||||
property var searchPopup
|
||||
property var locatioModel
|
||||
property var locationModel
|
||||
|
||||
signal subMenuClicked()
|
||||
signal subMenuItemClicked()
|
||||
signal anywhereItemClicked()
|
||||
signal menuItemNoSubMenuClicked()
|
||||
signal itemClicked(string firstLevelItemValue, string secondLevelItemValue)
|
||||
|
||||
StatusMenuItem {
|
||||
text: "Anywhere"
|
||||
onTriggered: {
|
||||
searchPopup.resetSelectionBadge();
|
||||
searchPopup.searchSelectionButton.primaryText = text;
|
||||
root.anywhereItemClicked();
|
||||
searchPopup.resetSearchSelection();
|
||||
root.itemClicked("", "");
|
||||
}
|
||||
}
|
||||
StatusMenuSeparator { }
|
||||
//Dummy item to keep seperator in right position
|
||||
MenuItem { implicitHeight: 0.00001 }
|
||||
Instantiator {
|
||||
model: root.locatioModel
|
||||
model: root.locationModel
|
||||
delegate: Loader {
|
||||
sourceComponent: (!!model.subItems && model.subItems.count > 0) ? subMenus : subMenuItemComponent
|
||||
onLoaded: {
|
||||
if (!!model.subItems && model.subItems.count > 0) {
|
||||
item.parentValue = model.value
|
||||
item.title = model.title;
|
||||
item.subItemsModel = model.subItems;
|
||||
item.parentIconName = model.iconName;
|
||||
@@ -48,6 +45,7 @@ StatusPopupMenu {
|
||||
});
|
||||
root.insertMenu(index+2, item);
|
||||
} else {
|
||||
item.value = model.value
|
||||
item.text = model.title;
|
||||
item.iconSettings.name = model.iconName;
|
||||
item.iconSettings.color = model.iconColor;
|
||||
@@ -65,14 +63,14 @@ StatusPopupMenu {
|
||||
id: subMenuItemComponent
|
||||
StatusSearchPopupMenuItem {
|
||||
onClicked: {
|
||||
searchPopup.resetSelectionBadge()
|
||||
searchPopup.searchSelectionButton.primaryText = text;
|
||||
searchPopup.searchSelectionButton.image.source = image.source;
|
||||
searchPopup.searchSelectionButton.image.isIdenticon = image.isIdenticon;
|
||||
searchPopup.searchSelectionButton.iconSettings.name = iconSettings.name;
|
||||
searchPopup.searchSelectionButton.iconSettings.color = !!iconSettings.color ? iconSettings.color : Theme.palette.primaryColor1
|
||||
searchPopup.searchSelectionButton.iconSettings.isLetterIdenticon = !iconSettings.name && !image.source
|
||||
root.menuItemNoSubMenuClicked();
|
||||
searchPopup.resetSearchSelection()
|
||||
searchPopup.setSearchSelection(text,
|
||||
"",
|
||||
image.source,
|
||||
image.isIdenticon,
|
||||
iconSettings.name,
|
||||
iconSettings.color)
|
||||
root.itemClicked(value, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,6 +80,7 @@ StatusPopupMenu {
|
||||
StatusPopupMenu {
|
||||
id: menu
|
||||
property var subItemsModel
|
||||
property string parentValue
|
||||
property string parentIconName
|
||||
property string parentImageSource
|
||||
property string parentIdenticonColor
|
||||
@@ -89,6 +88,7 @@ StatusPopupMenu {
|
||||
Repeater {
|
||||
id: menuLoader
|
||||
model: menu.subItemsModel
|
||||
property string parentValue: menu.parentValue
|
||||
property string parentTitleText: menu.title
|
||||
property string parentIconName: menu.parentIconName
|
||||
property string parentImageSource: menu.parentImageSource
|
||||
@@ -97,31 +97,31 @@ StatusPopupMenu {
|
||||
Loader {
|
||||
id: subMenuLoader
|
||||
sourceComponent: StatusSearchPopupMenuItem {
|
||||
value: model.value
|
||||
text: model.text
|
||||
image.source: model.imageSource
|
||||
iconSettings.name: model.iconName
|
||||
iconSettings.color: model.iconColor
|
||||
image.isIdenticon: model.isIdenticon
|
||||
onTriggered: {
|
||||
searchPopup.resetSelectionBadge();
|
||||
searchPopup.resetSearchSelection()
|
||||
if (menuLoader.parentTitleText === "Chat") {
|
||||
searchPopup.searchSelectionButton.primaryText = model.text;
|
||||
searchPopup.searchSelectionButton.image.source = model.imageSource;
|
||||
searchPopup.searchSelectionButton.image.isIdenticon = model.isIdenticon;
|
||||
searchPopup.searchSelectionButton.iconSettings.name = model.iconName;
|
||||
searchPopup.searchSelectionButton.iconSettings.color = !!model.iconColor ? model.iconColor : Theme.palette.primaryColor1;
|
||||
searchPopup.searchSelectionButton.iconSettings.isLetterIdenticon = !model.iconName && !model.imageSource
|
||||
searchPopup.setSearchSelection(model.text,
|
||||
"",
|
||||
model.imageSource,
|
||||
model.isIdenticon,
|
||||
model.iconName,
|
||||
model.iconColor)
|
||||
} else {
|
||||
searchPopup.searchSelectionButton.primaryText = menuLoader.parentTitleText;
|
||||
searchPopup.searchSelectionButton.secondaryText = model.text;
|
||||
searchPopup.searchSelectionButton.image.source = menuLoader.parentImageSource;
|
||||
searchPopup.searchSelectionButton.image.isIdenticon = menuLoader.parentIsIdenticon;
|
||||
searchPopup.searchSelectionButton.iconSettings.name = menuLoader.parentIconName;
|
||||
searchPopup.searchSelectionButton.iconSettings.color = !!menuLoader.parentIdenticonColor ? menuLoader.parentIdenticonColor : Theme.palette.primaryColor1;
|
||||
searchPopup.searchSelectionButton.iconSettings.isLetterIdenticon = !menuLoader.parentIconName && !menuLoader.parentImageSource
|
||||
searchPopup.setSearchSelection(menuLoader.parentTitleText,
|
||||
model.text,
|
||||
menuLoader.parentImageSource,
|
||||
menuLoader.parentIsIdenticon,
|
||||
menuLoader.parentIconName,
|
||||
menuLoader.parentIdenticonColor)
|
||||
}
|
||||
root.subMenuItemClicked();
|
||||
root.dismiss();
|
||||
root.itemClicked(menuLoader.parentValue, value)
|
||||
root.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,16 +129,16 @@ StatusPopupMenu {
|
||||
}
|
||||
}
|
||||
onMenuItemClicked: {
|
||||
searchPopup.resetSelectionBadge();
|
||||
searchPopup.resetSearchSelection()
|
||||
let menuItem = root.menuAt(root.currentIndex)
|
||||
searchPopup.searchSelectionButton.primaryText = menuItem.title;
|
||||
searchPopup.searchSelectionButton.image.source = menuItem.parentImageSource;
|
||||
searchPopup.searchSelectionButton.image.isIdenticon = menuItem.parentIsIdenticon;
|
||||
searchPopup.searchSelectionButton.iconSettings.name = menuItem.parentIconName;
|
||||
searchPopup.searchSelectionButton.iconSettings.color = menuItem.parentIdenticonColor;
|
||||
searchPopup.searchSelectionButton.iconSettings.isLetterIdenticon = !menuItem.parentIconName && !menuItem.parentImageSource
|
||||
root.subMenuClicked();
|
||||
searchPopup.setSearchSelection(menuItem.title,
|
||||
"",
|
||||
menuItem.parentImageSource,
|
||||
menuItem.parentIsIdenticon,
|
||||
menuItem.parentIconName,
|
||||
menuItem.parentIdenticonColor)
|
||||
root.itemClicked(menuItem.parentValue, "")
|
||||
//TODO fix error "QML StatusPopupMenu: cannot find any window to open popup in."
|
||||
root.dismiss();
|
||||
root.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,18 +19,32 @@ StatusModal {
|
||||
|
||||
property string searchText: contentComponent.searchText
|
||||
property string noResultsLabel: "No results"
|
||||
property string defaultSearchLocationText: "Anywhere"
|
||||
property bool loading
|
||||
property Menu searchOptionsPopupMenu: Menu { }
|
||||
property var searchResults: [ ]
|
||||
property var searchSelectionButton
|
||||
function resetSelectionBadge() {
|
||||
searchSelectionButton.iconSettings.name = ""
|
||||
searchSelectionButton.iconSettings.isLetterIdenticon = false
|
||||
searchSelectionButton.iconSettings.color = "transparent"
|
||||
searchSelectionButton.image.source = ""
|
||||
searchSelectionButton.image.isIdenticon = false
|
||||
searchSelectionButton.primaryText = qsTr("Anywhere");
|
||||
searchSelectionButton.secondaryText = "";
|
||||
|
||||
signal resultItemClicked(string itemId)
|
||||
signal resultItemTitleClicked(string titleId)
|
||||
|
||||
function setSearchSelection(text = "",
|
||||
secondaryText = "",
|
||||
imageSource = "",
|
||||
isIdenticon = "",
|
||||
iconName = "",
|
||||
iconColor = "") {
|
||||
searchSelectionButton.primaryText = text
|
||||
searchSelectionButton.secondaryText = secondaryText
|
||||
searchSelectionButton.image.source = imageSource
|
||||
searchSelectionButton.image.isIdenticon = isIdenticon
|
||||
searchSelectionButton.iconSettings.name = iconName
|
||||
searchSelectionButton.iconSettings.color = iconColor !== ""? iconColor : Theme.palette.primaryColor1
|
||||
searchSelectionButton.iconSettings.isLetterIdenticon = !iconName && !imageSource
|
||||
}
|
||||
|
||||
function resetSearchSelection() {
|
||||
setSearchSelection(defaultSearchLocationText, "", "", false, "", "transparent")
|
||||
}
|
||||
|
||||
content: Item {
|
||||
@@ -131,9 +145,10 @@ StatusModal {
|
||||
Loader {
|
||||
Layout.preferredWidth: active ? 16 : 0
|
||||
Layout.preferredHeight: 16
|
||||
active: searchOptionsMenuButton.iconSettings.name ||
|
||||
active: searchOptionsMenuButton.primaryText !== defaultSearchLocationText &&
|
||||
(searchOptionsMenuButton.iconSettings.name ||
|
||||
searchOptionsMenuButton.iconSettings.isLetterIdenticon ||
|
||||
!!searchOptionsMenuButton.image.source.toString()
|
||||
!!searchOptionsMenuButton.image.source.toString())
|
||||
|
||||
sourceComponent: {
|
||||
if (!!searchOptionsMenuButton.image.source.toString()) {
|
||||
@@ -203,10 +218,18 @@ StatusModal {
|
||||
color: Theme.palette.baseColor1
|
||||
icon: "next"
|
||||
}
|
||||
StatusIcon {
|
||||
Layout.preferredWidth: 17.5
|
||||
Layout.preferredHeight: 17.5
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: !!searchOptionsMenuButton.secondaryText
|
||||
color: Theme.palette.directColor1
|
||||
icon: "channel"
|
||||
}
|
||||
StatusBaseText {
|
||||
color: Theme.palette.directColor1
|
||||
visible: !!searchOptionsMenuButton.secondaryText
|
||||
text: "# " + searchOptionsMenuButton.secondaryText
|
||||
text: searchOptionsMenuButton.secondaryText
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
StatusIcon {
|
||||
@@ -228,14 +251,14 @@ StatusModal {
|
||||
anchors.left: searchOptionsMenuButton.right
|
||||
anchors.leftMargin: 4
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
opacity: (searchOptionsMenuButton.primaryText === qsTr("Anywhere")) ? 0.0 : 1.0
|
||||
opacity: (searchOptionsMenuButton.primaryText === defaultSearchLocationText) ? 0.0 : 1.0
|
||||
visible: (opacity > 0.1)
|
||||
type: StatusFlatRoundButton.Type.Secondary
|
||||
icon.name: "close"
|
||||
icon.color: Theme.palette.directColor1
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onClicked: { root.resetSelectionBadge(); }
|
||||
onClicked: { root.resetSearchSelection(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,8 +280,10 @@ StatusModal {
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
delegate: StatusListItem {
|
||||
width: view.width
|
||||
title: model.name
|
||||
statusListItemTitle.color: model.name.startsWith("@") ? Theme.palette.primaryColor1 : Theme.palette.directColor1
|
||||
itemId: model.itemId
|
||||
titleId: model.titleId
|
||||
title: model.title
|
||||
statusListItemTitle.color: model.title.startsWith("@") ? Theme.palette.primaryColor1 : Theme.palette.directColor1
|
||||
subTitle: model.content
|
||||
radius: 0
|
||||
statusListItemSubTitle.height: model.content !== "" ? 20 : 0
|
||||
@@ -272,6 +297,14 @@ StatusModal {
|
||||
badge.image.source: model.badgeImage
|
||||
badge.icon.isLetterIdenticon: model.isLetterIdenticon
|
||||
badge.icon.color: model.badgeIdenticonColor
|
||||
|
||||
onClicked: {
|
||||
root.resultItemClicked(itemId)
|
||||
}
|
||||
|
||||
onTitleClicked: {
|
||||
root.resultItemTitleClicked(titleId)
|
||||
}
|
||||
}
|
||||
section.property: "sectionName"
|
||||
section.criteria: ViewSection.FullString
|
||||
@@ -308,7 +341,7 @@ StatusModal {
|
||||
}
|
||||
}
|
||||
onClosed: {
|
||||
root.resetSelectionBadge();
|
||||
root.resetSearchSelection();
|
||||
root.loading = false;
|
||||
contentComponent.searchText = "";
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ MenuItem {
|
||||
id: root
|
||||
implicitHeight: 38
|
||||
|
||||
property string value: ""
|
||||
|
||||
property StatusImageSettings image: StatusImageSettings {
|
||||
height: 16
|
||||
width: 16
|
||||
@@ -36,7 +38,7 @@ MenuItem {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
visible: !!root.iconSettings.name && !root.image.source.toString()
|
||||
icon: root.iconSettings.name
|
||||
color: root.iconSettings.color
|
||||
color: (icon === "channel")? Theme.palette.directColor1 : root.iconSettings.color
|
||||
}
|
||||
StatusRoundedImage {
|
||||
Layout.preferredWidth: visible ? root.image.width : 0
|
||||
|
||||
Reference in New Issue
Block a user