3rdparty/RibbonUI: Update.
This commit is contained in:
parent
491961daf1
commit
1bb01e1e60
|
@ -1 +1 @@
|
||||||
Subproject commit 97c6b7cb0d43c068eba9db14beda88e645df0e2b
|
Subproject commit 79a17c3fb191dfa10a8822d61e907daef7630dcf
|
|
@ -44,7 +44,6 @@ set(
|
||||||
|
|
||||||
set(
|
set(
|
||||||
qml_files qml/Main.qml qml/components/ZigBeeFrame.qml
|
qml_files qml/Main.qml qml/components/ZigBeeFrame.qml
|
||||||
qml/components/RibbonMessageListView.qml qml/components/RibbonMessage.qml
|
|
||||||
qml/components/ZigBeeMessage.qml qml/components/SerialPortAssistant.qml
|
qml/components/ZigBeeMessage.qml qml/components/SerialPortAssistant.qml
|
||||||
qml/components/ZigBeeDataView.qml qml/components/TabBar.qml qml/components/CenterView.qml
|
qml/components/ZigBeeDataView.qml qml/components/TabBar.qml qml/components/CenterView.qml
|
||||||
qml/components/ListTable.qml qml/components/DeviceList.qml qml/components/KeysList.qml
|
qml/components/ListTable.qml qml/components/DeviceList.qml qml/components/KeysList.qml
|
||||||
|
@ -153,6 +152,25 @@ if(RIBBONUI_BUILD_STATIC_LIB)
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
RIBBONUI_BUILD_STATIC_LIB
|
RIBBONUI_BUILD_STATIC_LIB
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
if (MINGW)
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
"${RIBBONUI_QML_PLUGIN_DIRECTORY}/RibbonUI.dll"
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
else()
|
||||||
|
if (NOT RIBBONUI_BUILD_STATIC_LIB)
|
||||||
|
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
set(DEBUG_POSTFIX "d")
|
||||||
|
endif()
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
"${RIBBONUI_QML_PLUGIN_DIRECTORY}/RibbonUI${DEBUG_POSTFIX}.dll"
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import RibbonUI
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
id: bubble
|
|
||||||
color: "transparent"
|
|
||||||
property double padding: 10
|
|
||||||
default property alias content: message_layout.data
|
|
||||||
property var data_model: model
|
|
||||||
property int font_size: 13
|
|
||||||
property string sender_text: "sender"
|
|
||||||
width: ListView.view.width
|
|
||||||
height: bubble_layout.height + padding*2
|
|
||||||
|
|
||||||
ColumnLayout{
|
|
||||||
id: bubble_layout
|
|
||||||
anchors{
|
|
||||||
top: parent.top
|
|
||||||
topMargin: parent.padding
|
|
||||||
}
|
|
||||||
layoutDirection: data_model.recieved ? Qt.LeftToRight : Qt.RightToLeft
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (data_model.recieved)
|
|
||||||
{
|
|
||||||
anchors.left = parent.left
|
|
||||||
anchors.leftMargin = parent.padding
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
anchors.right = parent.right
|
|
||||||
anchors.rightMargin = parent.padding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RibbonText{
|
|
||||||
id: sender_text
|
|
||||||
text: bubble.sender_text
|
|
||||||
padding: bubble.padding
|
|
||||||
color: RibbonTheme.dark_mode ? "white" : "black"
|
|
||||||
}
|
|
||||||
RibbonRectangle{
|
|
||||||
id: bubble_bg
|
|
||||||
color: data_model.recieved ? RibbonTheme.dark_mode ? "#202020" : "#FFFFFF" : RibbonTheme.dark_mode ? "#272727" : "#4397F7"
|
|
||||||
height: message_layout.height + bubble.padding*2
|
|
||||||
width: message_layout.width + bubble.padding*2
|
|
||||||
radius: 10
|
|
||||||
topLeftRadius: data_model.recieved ? 2 : bubble.padding
|
|
||||||
topRightRadius: !data_model.recieved ? 2 : bubble.padding
|
|
||||||
ColumnLayout{
|
|
||||||
id: message_layout
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import RibbonUI
|
|
||||||
|
|
||||||
RibbonView{
|
|
||||||
id: view
|
|
||||||
anchors{
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
property int max_msg_num: 10
|
|
||||||
property bool auto_scroll_to_bottom: false
|
|
||||||
property int animation_time: 200
|
|
||||||
property alias delegate: message_list.delegate
|
|
||||||
property alias message_model: message_model
|
|
||||||
property alias view: message_list
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id: message_model
|
|
||||||
onCountChanged: auto_scroll_btn_timer.restart()
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer{
|
|
||||||
id: auto_scroll_btn_timer
|
|
||||||
interval: animation_time
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
if(view.auto_scroll_to_bottom)
|
|
||||||
view.scroll_to_bottom()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView{
|
|
||||||
id: message_list
|
|
||||||
cacheBuffer: message_list.height * 2
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Layout.preferredHeight: parent.height
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
model: message_model
|
|
||||||
add: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "y"
|
|
||||||
from: message_list.height
|
|
||||||
duration: animation_time
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ScrollBar.vertical: RibbonScrollBar {
|
|
||||||
anchors.right: message_list.right
|
|
||||||
anchors.rightMargin: 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function scroll_to_up(){
|
|
||||||
message_list.positionViewAtBeginning()
|
|
||||||
}
|
|
||||||
|
|
||||||
function scroll_to_bottom(){
|
|
||||||
message_list.positionViewAtEnd()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -103,17 +103,13 @@ Item{
|
||||||
height: parent.height
|
height: parent.height
|
||||||
RibbonMessageListView{
|
RibbonMessageListView{
|
||||||
id: data_view
|
id: data_view
|
||||||
|
anchors.fill: parent
|
||||||
top_padding: control.top_padding + data_title_bar.height + (!RibbonTheme.modern_style ? 10 : 0)
|
top_padding: control.top_padding + data_title_bar.height + (!RibbonTheme.modern_style ? 10 : 0)
|
||||||
bottom_padding: bottom_bar.height
|
bottom_padding: bottom_bar.height
|
||||||
width: parent.width / 2
|
|
||||||
delegate: ZigBeeMessage{
|
delegate: ZigBeeMessage{
|
||||||
show_tooltip: control.show_tooltip
|
show_tooltip: control.show_tooltip
|
||||||
component_width: data_view.width / 2
|
component_width: data_view.width / 2
|
||||||
}
|
}
|
||||||
view.onHeightChanged: {
|
|
||||||
if (control.auto_scroll_to_bottom)
|
|
||||||
scroll_to_bottom()
|
|
||||||
}
|
|
||||||
Event{
|
Event{
|
||||||
id:data_view_event
|
id:data_view_event
|
||||||
type: "zigbee_recv_data_view"
|
type: "zigbee_recv_data_view"
|
||||||
|
|
Loading…
Reference in New Issue