From 671f88f9a7f5735e1c2bd512a13314d8ae5f929b Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周二, 19 12月 2023 18:31:54 +0800
Subject: [PATCH] minor tweaks

---
 examples/mainwindow/mainwindow.cpp |    4 ++++
 README.md                          |    9 +++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index e3a1290..5780868 100644
--- a/README.md
+++ b/README.md
@@ -143,7 +143,10 @@
 Layout to work.
 
 ```c++
-agent->setSystemButton(QWK::WindowAgent::Base::Maximize, maxButton);
+agent->setSystemButton(QWK::WindowAgentBase::WindowIcon, myTitleBar->iconButton());
+agent->setSystemButton(QWK::WindowAgentBase::Minimize, myTitleBar->minButton());
+agent->setSystemButton(QWK::WindowAgentBase::Maximize, myTitleBar->maxButton());
+agent->setSystemButton(QWK::WindowAgentBase::Close, myTitleBar->closeButton());
 ```
 
 Set hit-test visible hint to let `WidgetWindowAgent` know the widgets that desire to receive mouse events.
@@ -161,9 +164,7 @@
 Make sure you have registered QWK into QtQuick:
 
 ```cpp
-// ...
 #include <QWKQuick/qwkquickglobal.h>
-// ...
 
 int main(int argc, char *argv[])
 {
@@ -175,7 +176,7 @@
 }
 ```
 
-Then you can use QWK data types and classes by importing it's URI:
+Then you can use `QWindowKit` data types and classes by importing it's URI:
 
 ```qml
 import QtQuick 2.15
diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp
index 8b32fe7..b44de01 100644
--- a/examples/mainwindow/mainwindow.cpp
+++ b/examples/mainwindow/mainwindow.cpp
@@ -108,6 +108,10 @@
     // 1. Setup window agent
     QWK::WidgetWindowAgent *agent = QWK::setupWidgetWindow(this);
 
+    // Equivalent to:
+    // auto agent = new QWK::WidgetWindowAgent(w);
+    // agent->setup(w);
+
     // 2. Construct your title bar
     auto menuBar = []() {
         auto menuBar = new QMenuBar();

--
Gitblit v1.9.1