From: Manuel Nickschas Date: Thu, 11 Aug 2011 21:16:29 +0000 (+0200) Subject: Move the qml subdir into qmlui X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=52a3675c38345145cfcd5237a2cbe81b31c17d79 Move the qml subdir into qmlui Makes more sense to place the qml files under qmlui. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8eba7abd..2efc7620 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -421,5 +421,4 @@ add_subdirectory(data) add_subdirectory(icons) add_subdirectory(pics) add_subdirectory(po) -add_subdirectory(qml) add_subdirectory(src) diff --git a/qml/CMakeLists.txt b/qml/CMakeLists.txt deleted file mode 100644 index 08a90fe0..00000000 --- a/qml/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -if(HAVE_QML) - set(CLIENT_RCS ${CLIENT_RCS} ../qml/qml.qrc PARENT_SCOPE) -endif(HAVE_QML) diff --git a/qml/ChatView.qml b/qml/ChatView.qml deleted file mode 100644 index 141ccd63..00000000 --- a/qml/ChatView.qml +++ /dev/null @@ -1,35 +0,0 @@ -import QtQuick 1.1 -// import Qt.components 1.0 - - -ListView { - id: flickable - anchors.fill: parent - - Component { - id: msgDelegate - Item { - Row { - id: chatline - Text { text: timestamp; wrapMode: Text.NoWrap; width: 100 } - Text { text: sender; wrapMode: Text.NoWrap; width: 100 } - Text { text: contents; wrapMode: Text.Wrap; width: flickable.width-200} - } - height: chatline.height - ListView.onAdd: positionViewAtEnd() - } - } - - model: msgModel - - delegate: msgDelegate - - Rectangle { - id: scrollbar - anchors.right: flickable.right - y: flickable.visibleArea.yPosition * flickable.height - width: 10 - height: flickable.visibleArea.heightRatio * flickable.height - color: "black" - } -} diff --git a/src/qmlui/CMakeLists.txt b/src/qmlui/CMakeLists.txt index 7261277d..ab6808cd 100644 --- a/src/qmlui/CMakeLists.txt +++ b/src/qmlui/CMakeLists.txt @@ -36,5 +36,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/uisupport ${CMAKE_CURRENT_BINARY_DIR}) +set(CLIENT_RCS ${CLIENT_RCS} qmlui/qml/qml.qrc PARENT_SCOPE) + add_library(mod_qmlui STATIC ${SOURCES} ${SPSRC} ${MOC} ${DBUS} ${UI} ${HEADERS}) add_dependencies(mod_qmlui mod_common mod_client mod_uisupport) diff --git a/src/qmlui/qml/ChatView.qml b/src/qmlui/qml/ChatView.qml new file mode 100644 index 00000000..69968732 --- /dev/null +++ b/src/qmlui/qml/ChatView.qml @@ -0,0 +1,44 @@ +import QtQuick 1.0 +// import Qt.components 1.0 + +Rectangle { + id: container + + Component { + id: msgDelegate + Item { + id: msgDelegateItem + Row { + id: chatline + Text { text: timestamp; wrapMode: Text.NoWrap; width: 100 } + Text { text: sender; wrapMode: Text.NoWrap; width: 100 } + Text { text: contents; wrapMode: Text.Wrap; width: flickable.width-200} + } + height: chatline.height + } + } + + ListView { + id: flickable + anchors.fill: parent + + + model: msgModel + + delegate: msgDelegate + + Connections { + target: msgModel + onRowsInserted: flickable.positionViewAtEnd(); + } + + Rectangle { + id: scrollbar + anchors.right: flickable.right + y: flickable.visibleArea.yPosition * flickable.height + width: 10 + height: flickable.visibleArea.heightRatio * flickable.height + color: "black" + } + } +} diff --git a/qml/qml.qrc b/src/qmlui/qml/qml.qrc similarity index 100% rename from qml/qml.qrc rename to src/qmlui/qml/qml.qrc