Make emoji picker follow theme

This commit is contained in:
Nicolas Werner 2021-07-03 22:45:36 +02:00
parent 683a24d2aa
commit f6f5d2615a
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
5 changed files with 243 additions and 220 deletions

View File

@ -24,7 +24,6 @@ Rectangle {
id: communityListC id: communityListC
visible: Settings.groupView visible: Settings.groupView
minimumWidth: communitiesList.avatarSize * 4 + Nheko.paddingMedium * 2 minimumWidth: communitiesList.avatarSize * 4 + Nheko.paddingMedium * 2
collapsedWidth: communitiesList.avatarSize + 2 * Nheko.paddingMedium collapsedWidth: communitiesList.avatarSize + 2 * Nheko.paddingMedium
preferredWidth: Settings.communityListWidth >= minimumWidth ? Settings.communityListWidth : collapsedWidth preferredWidth: Settings.communityListWidth >= minimumWidth ? Settings.communityListWidth : collapsedWidth

View File

@ -154,6 +154,7 @@ Item {
NoticeMessage { NoticeMessage {
text: qsTr("%1 changed the room avatar").arg(model.data.userName) text: qsTr("%1 changed the room avatar").arg(model.data.userName)
} }
} }
DelegateChoice { DelegateChoice {

View File

@ -59,8 +59,8 @@ Item {
MessageDelegate { MessageDelegate {
id: reply id: reply
enabled: false
enabled: false
width: parent.width width: parent.width
isReply: true isReply: true
} }

View File

@ -35,8 +35,14 @@ Menu {
modal: true modal: true
focus: true focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
//height: columnView.implicitHeight + 4
//width: columnView.implicitWidth
width: 7 * 52 + 20
Rectangle {
color: Nheko.colors.window
height: columnView.implicitHeight + 4 height: columnView.implicitHeight + 4
width: columnView.implicitWidth width: 7 * 52 + 20
ColumnLayout { ColumnLayout {
id: columnView id: columnView
@ -53,9 +59,12 @@ Menu {
TextField { TextField {
id: emojiSearch id: emojiSearch
//width: gridView.width - 6
Layout.topMargin: 3 Layout.topMargin: 3
Layout.preferredWidth: 7 * 52 + 20 - 6 Layout.preferredWidth: 7 * 52 + 20 - 6
palette: Nheko.colors
background: null
placeholderTextColor: Nheko.colors.buttonText
color: Nheko.colors.text
placeholderText: qsTr("Search") placeholderText: qsTr("Search")
selectByMouse: true selectByMouse: true
rightPadding: clearSearch.width rightPadding: clearSearch.width
@ -83,6 +92,8 @@ Menu {
icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.png?" + (clearSearch.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText) icon.source: "image://colorimage/:/icons/icons/ui/round-remove-button.png?" + (clearSearch.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)
focusPolicy: Qt.NoFocus focusPolicy: Qt.NoFocus
onClicked: emojiSearch.clear() onClicked: emojiSearch.clear()
hoverEnabled: true
background: null
anchors { anchors {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
@ -90,7 +101,17 @@ Menu {
} }
// clear the default hover effects. // clear the default hover effects.
background: Item { Image {
height: parent.height - 2 * Nheko.paddingSmall
width: height
source: "image://colorimage/:/icons/icons/ui/round-remove-button.png?" + (clearSearch.hovered ? Nheko.colors.highlight : Nheko.colors.buttonText)
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
margins: Nheko.paddingSmall
}
} }
} }
@ -142,6 +163,7 @@ Menu {
font.family: Settings.emojiFont font.family: Settings.emojiFont
font.pixelSize: 36 font.pixelSize: 36
text: model.unicode text: model.unicode
color: Nheko.colors.text
} }
background: Rectangle { background: Rectangle {
@ -163,7 +185,7 @@ Menu {
visible: emojiSearch.text === '' visible: emojiSearch.text === ''
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 1 Layout.preferredHeight: 1
color: emojiPopup.Nheko.colors.alternateBase color: emojiPopup.Nheko.theme.separator
} }
// Category picker row // Category picker row
@ -283,4 +305,6 @@ Menu {
} }
}
} }

View File

@ -41,8 +41,7 @@ using webrtc::CallType;
using webrtc::State; using webrtc::State;
WebRTCSession::WebRTCSession() WebRTCSession::WebRTCSession()
: QObject() : devices_(CallDevices::instance())
, devices_(CallDevices::instance())
{ {
qRegisterMetaType<webrtc::CallType>(); qRegisterMetaType<webrtc::CallType>();
qmlRegisterUncreatableMetaObject( qmlRegisterUncreatableMetaObject(