Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR test via gh #492

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions examples/qtquick/customtitlebar/Guest.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@

import QtQuick 2.9
import QtQuick.Controls 2.15
import com.kdab.dockwidgets 2.0 as KDDW

Item {
anchors.fill: parent

property alias background: background.source
property alias logo: logo.source
property var background
property var logo

KDDW.LayoutSaver {
id: layoutSaver
}

Image {
id: background
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
Row {
Button {
text: "Save1"
onClicked: layoutSaver.saveToFile("mySavedLayout1.json");
}

Image {
id: logo
Button {
text: "Restore1"
onClicked: layoutSaver.restoreFromFile("mySavedLayout1.json");
}

fillMode: Image.PreserveAspectFit
anchors {
fill: parent
margins: 50
}
}
Button {
text: "Save2"
onClicked: layoutSaver.saveToFile("mySavedLayout2.json");
}

TextField {
placeholderText: "TextField just to test focus"
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
margins: 5
}
Button {
text: "Restore2"
onClicked: layoutSaver.restoreFromFile("mySavedLayout2.json");
}
}
}
8 changes: 4 additions & 4 deletions examples/qtquick/customtitlebar/MyTitleBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ KDDW.TitleBarBase {
}

Rectangle {
id: floatButton
visible: root.floatButtonVisible
id: minimizeButton
visible: root.minimizeButtonVisible
radius: 5
color: isFocused ? "red" : "white"
color: "red"
height: parent.height
width: height

MouseArea {
anchors.fill: parent
onClicked: {
root.floatButtonClicked();
root.minimizeButtonClicked();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions examples/qtquick/customtitlebar/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ int main(int argc, char *argv[])

auto &config = KDDockWidgets::Config::self();
auto flags = config.flags() | KDDockWidgets::Config::Flag_TitleBarIsFocusable;
flags |= KDDockWidgets::Config::Flag_TitleBarHasMinimizeButton;

config.setFlags(flags);
config.setViewFactory(new CustomViewFactory());
Expand Down
Loading