quick: Use the original kddw indicators instead of yellow rectangles
looks nicer
This commit is contained in:
@@ -4,4 +4,4 @@ set(SRCS main.cpp controller.cpp multisplitter.cpp)
|
||||
|
||||
qt5_add_resources(RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/resources.qrc)
|
||||
add_executable(kdmultisplitter_example_quick ${SRCS} ${RESOURCES})
|
||||
target_link_libraries(kdmultisplitter_example_quick kddockwidgets_multisplitter Qt5::Quick)
|
||||
target_link_libraries(kdmultisplitter_example_quick kddockwidgets kddockwidgets_multisplitter Qt5::Quick) # Linking to kddockwidgets just so we get the indicators png
|
||||
|
||||
@@ -1,17 +1,34 @@
|
||||
import QtQuick 2.6
|
||||
import com.kdab.kddockwidgets.multisplitter 1.0;
|
||||
|
||||
Rectangle {
|
||||
Image {
|
||||
id: root
|
||||
property int location: KDMultiSplitter.Location_None;
|
||||
property QtObject relativeTo: null
|
||||
|
||||
color: "yellow"
|
||||
width: 35
|
||||
height: 35
|
||||
radius: 4
|
||||
border.color: "black"
|
||||
border.width: 2
|
||||
width: 48
|
||||
height: 48
|
||||
|
||||
function locationToStr() {
|
||||
switch (root.location) {
|
||||
case KDMultiSplitter.Location_OnLeft:
|
||||
return "left";
|
||||
case KDMultiSplitter.Location_OnRight:
|
||||
return "right";
|
||||
case KDMultiSplitter.Location_OnTop:
|
||||
return "top";
|
||||
case KDMultiSplitter.Location_OnBottom:
|
||||
return "bottom";
|
||||
}
|
||||
}
|
||||
|
||||
function imageFileName() {
|
||||
if (relativeTo)
|
||||
return "inner_%1.png".arg(locationToStr())
|
||||
return "outter_%1.png".arg(locationToStr())
|
||||
}
|
||||
|
||||
source: "qrc:///img/classic_indicators/" + imageFileName()
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
QSize minSize() const override
|
||||
{
|
||||
return QSize(100, 100);
|
||||
return QSize(150, 150);
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
|
||||
Reference in New Issue
Block a user