Skip to content

Commit d1b4026

Browse files
authored
Make all widgets scalable (needed for High-DPI-displays)
* made all widgets scalable (needed for High-DPI-displays) * moved EnhancedWindow.h next to cvui.h, fixed issue with new OpenCV version * Support for colored buttons and counters * in case of bright button color, make button text dark to make is readable * removed unused parameters from internal functions, added getters to EnhancedWindow, replaced spaces with tabs * replaced spaces with tabs * bugfix for new OpenCV versions * workaround for CMake issue with wildcards on Windows * added 3D effect for buttons, depending on up/down * bugfix for button geometry in case the font is smaller than DEFAULT_FONT_SCALE
1 parent fbc4357 commit d1b4026

File tree

32 files changed

+475
-303
lines changed

32 files changed

+475
-303
lines changed

EnhancedWindow.h

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#ifndef _ENHANCED_WINDOW_H_
2+
#define _ENHANCED_WINDOW_H_
3+
4+
/*
5+
This class enhances the window component of cvui by making it movable and minimizable.
6+
7+
Authors:
8+
ShengYu - https://github.com/shengyu7697
9+
Amaury Bréhéret - https://github.com/abreheret
10+
11+
Contributions:
12+
Fernando Bevilacqua <[email protected]>
13+
14+
Code licensed under the MIT license.
15+
*/
16+
class EnhancedWindow
17+
{
18+
private:
19+
int mX;
20+
int mY;
21+
int mWidth;
22+
int mHeight;
23+
int mHeightNotMinimized;
24+
cv::String mTitle;
25+
int mDeltaY;
26+
int mDeltaX;
27+
bool mIsMoving;
28+
bool mMinimized;
29+
bool mMinimizable;
30+
double mFontScale;
31+
32+
public:
33+
EnhancedWindow(int x, int y, int width, int height, const cv::String& title, bool minimizable = true, double theFontScale = cvui::DEFAULT_FONT_SCALE):
34+
mX(x),
35+
mY(y),
36+
mWidth(width),
37+
mHeight(height),
38+
mHeightNotMinimized(height),
39+
mTitle(title),
40+
mDeltaY(0),
41+
mDeltaX(0),
42+
mIsMoving(false),
43+
mMinimized(false),
44+
mMinimizable(minimizable),
45+
mFontScale(theFontScale) {
46+
}
47+
48+
void begin(cv::Mat &frame) {
49+
int scaledTitleHeight = std::lround(20*mFontScale/cvui::DEFAULT_FONT_SCALE);
50+
bool mouseInsideTitleArea = cvui::mouse().inside(cv::Rect(mX, mY, mWidth, scaledTitleHeight));
51+
mHeight = mMinimized ? scaledTitleHeight : mHeightNotMinimized;
52+
53+
if (mIsMoving == false && cvui::mouse(cvui::DOWN) && mouseInsideTitleArea) {
54+
mDeltaX = cvui::mouse().x - mX;
55+
mDeltaY = cvui::mouse().y - mY;
56+
mIsMoving = true;
57+
58+
} else if (mIsMoving && cvui::mouse(cvui::IS_DOWN)) {
59+
mX = cvui::mouse().x - mDeltaX;
60+
mY = cvui::mouse().y - mDeltaY;
61+
62+
} else {
63+
mIsMoving = false;
64+
mX = std::max(0, mX);
65+
mY = std::max(0, mY);
66+
mX = std::min(frame.cols - mWidth, mX);
67+
mY = std::min(frame.rows - scaledTitleHeight, mY);
68+
}
69+
70+
cvui::window(frame, mX, mY, mWidth, mHeight, mTitle, mFontScale);
71+
if (mMinimizable && cvui::button(frame, mX + mWidth - scaledTitleHeight, mY + 1, scaledTitleHeight-1, scaledTitleHeight-1, mMinimized ? "+" : "-", mFontScale)) {
72+
mMinimized = !mMinimized;
73+
}
74+
cvui::beginRow(frame, mX + std::lround(10*mFontScale/cvui::DEFAULT_FONT_SCALE), mY + std::lround(30*mFontScale/cvui::DEFAULT_FONT_SCALE), mWidth - scaledTitleHeight, mHeight - scaledTitleHeight);
75+
cvui::beginColumn(mWidth - std::lround(10*mFontScale/cvui::DEFAULT_FONT_SCALE), mHeight - scaledTitleHeight);
76+
}
77+
78+
/**
79+
Use this function to get the maximum width of a child widget of EnhancedWindow.
80+
81+
\return the width of the EnhancedWindow without the inner borders that are automatically added
82+
*/
83+
int widthWithoutBorders() {
84+
return mWidth - std::lround(20*mFontScale/cvui::DEFAULT_FONT_SCALE);
85+
}
86+
87+
/**
88+
Use this function to get the maximum height of a child widget of EnhancedWindow.
89+
90+
\return the height of the EnhancedWindow without title and inner borders that are automatically added
91+
*/
92+
int heightWithoutBorders() {
93+
return mHeight - std::lround(40*mFontScale/cvui::DEFAULT_FONT_SCALE);
94+
}
95+
96+
void end() {
97+
cvui::endColumn();
98+
cvui::endRow();
99+
}
100+
101+
int posX() const {
102+
return mX;
103+
}
104+
105+
int posY() const {
106+
return mY;
107+
}
108+
109+
void setPosX(int posX) {
110+
mX = posX;
111+
}
112+
113+
void setPosY(int posY) {
114+
mY = posY;
115+
}
116+
117+
int width() const {
118+
return mWidth;
119+
}
120+
121+
int height() const {
122+
return mHeight;
123+
}
124+
125+
void setWidth(int w) {
126+
mWidth = w;
127+
}
128+
129+
void setHeight(int h) {
130+
mHeight = mHeightNotMinimized = h;
131+
}
132+
133+
double fontScale() const {
134+
return mFontScale;
135+
}
136+
137+
void setFontScale(double fontScale) {
138+
mFontScale = fontScale;
139+
}
140+
141+
bool isMinimized() const {
142+
return mMinimized;
143+
}
144+
};
145+
146+
#endif // _ENHANCED_WINDOW_H_
File renamed without changes.

cvui.h

100644100755
+225-143
Large diffs are not rendered by default.

example/src/button-shortcut/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()
1919

example/src/canny/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if(ADD_PYTHON_EXAMPLES)
1414
add_custom_command(
1515
TARGET ${ApplicationName}
1616
POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
17+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1818
)
1919
endif()

example/src/canny/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ int main(int argc, const char *argv[])
2626
// Should we apply Canny edge?
2727
if (use_canny) {
2828
// Yes, we should apply it.
29-
cv::cvtColor(lena, frame, CV_BGR2GRAY);
29+
cv::cvtColor(lena, frame, cv::COLOR_BGR2GRAY);
3030
cv::Canny(frame, frame, low_threshold, high_threshold, 3);
31-
cv::cvtColor(frame, frame, CV_GRAY2BGR);
31+
cv::cvtColor(frame, frame, cv::COLOR_GRAY2BGR);
3232
} else {
3333
// No, so just copy the original image to the displaying frame.
3434
lena.copyTo(frame);
@@ -60,4 +60,4 @@ int main(int argc, const char *argv[])
6060
}
6161

6262
return 0;
63-
}
63+
}

example/src/complext-layout/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/hello-world/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/image-button/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ if(ADD_PYTHON_EXAMPLES)
1616
add_custom_command(
1717
TARGET ${ApplicationName}
1818
POST_BUILD
19-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
19+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
2020
)
2121
endif()

example/src/interaction-area/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/main-app/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/main-app/main.cpp

+25-16
Original file line numberDiff line numberDiff line change
@@ -16,76 +16,85 @@ Licensed under the MIT license.
1616

1717
int main(int argc, const char *argv[])
1818
{
19-
cv::Mat frame = cv::Mat(300, 600, CV_8UC3);
2019
bool checked = false;
2120
bool checked2 = true;
2221
int count = 0;
23-
double countFloat = 0.0;
2422
double trackbarValue = 0.0;
2523

2624
// Init cvui and tell it to create a OpenCV window, i.e. cv::namedWindow(WINDOW_NAME).
2725
cvui::init(WINDOW_NAME);
2826

27+
double scaling = 1.0;
28+
double currentScaling = -1;
29+
cv::Mat frame;
30+
2931
while (true) {
32+
if (scaling != currentScaling) {
33+
frame = cv::Mat(std::lround(scaling * 300), std::lround(scaling * 600), CV_8UC3);
34+
currentScaling = scaling;
35+
}
36+
3037
// Fill the frame with a nice color
3138
frame = cv::Scalar(49, 52, 49);
3239

3340
// Show some pieces of text.
34-
cvui::text(frame, 50, 30, "Hey there!");
41+
cvui::text(frame, std::lround(scaling * 50), std::lround(scaling * 30), "Hey there!", scaling*cvui::DEFAULT_FONT_SCALE);
3542

3643
// You can also specify the size of the text and its color
3744
// using hex 0xRRGGBB CSS-like style.
38-
cvui::text(frame, 200, 30, "Use hex 0xRRGGBB colors easily", 0.4, 0xff0000);
45+
cvui::text(frame, std::lround(scaling * 200), std::lround(scaling * 30), "Use hex 0xRRGGBB colors easily", scaling*cvui::DEFAULT_FONT_SCALE, 0xff0000);
3946

4047
// Sometimes you want to show text that is not that simple, e.g. strings + numbers.
4148
// You can use cvui::printf for that. It accepts a variable number of parameter, pretty
4249
// much like printf does.
43-
cvui::printf(frame, 200, 50, 0.4, 0x00ff00, "Use printf formatting: %d + %.2f = %f", 2, 3.2, 5.2);
50+
cvui::printf(frame, std::lround(scaling * 200), std::lround(scaling * 50), scaling*cvui::DEFAULT_FONT_SCALE, 0x00ff00, "Use printf formatting: %d + %.2f = %f", 2, 3.2, 5.2);
4451

4552
// Buttons will return true if they were clicked, which makes
4653
// handling clicks a breeze.
47-
if (cvui::button(frame, 50, 60, "Button")) {
54+
if (cvui::button(frame, std::lround(scaling * 50), std::lround(scaling * 60), "Colored Button", scaling*cvui::DEFAULT_FONT_SCALE, 0xa05050)) {
4855
std::cout << "Button clicked" << std::endl;
4956
}
5057

5158
// If you do not specify the button width/height, the size will be
5259
// automatically adjusted to properly house the label.
53-
cvui::button(frame, 200, 70, "Button with large label");
60+
cvui::button(frame, std::lround(scaling * 200), std::lround(scaling * 70), "Button with large label", scaling*cvui::DEFAULT_FONT_SCALE);
5461

5562
// You can tell the width and height you want
56-
cvui::button(frame, 410, 70, 15, 15, "x");
63+
cvui::button(frame, std::lround(scaling * 410), std::lround(scaling * 70), std::lround(scaling * 15), std::lround(scaling * 15), "x", scaling*cvui::DEFAULT_FONT_SCALE);
5764

5865
// Window components are useful to create HUDs and similars. At the
5966
// moment, there is no implementation to constraint content within a
6067
// a window.
61-
cvui::window(frame, 50, 120, 120, 100, "Window");
68+
cvui::window(frame, std::lround(scaling * 50), std::lround(scaling * 120), std::lround(scaling * 120), std::lround(scaling * 100), "Window", scaling*cvui::DEFAULT_FONT_SCALE);
6269

6370
// The counter component can be used to alter int variables. Use
6471
// the 4th parameter of the function to point it to the variable
6572
// to be changed.
66-
cvui::counter(frame, 200, 120, &count);
73+
cvui::counter(frame, std::lround(scaling * 200), std::lround(scaling * 120), &count, 1, "%d", scaling*cvui::DEFAULT_FONT_SCALE);
6774

6875
// Counter can be used with doubles too. You can also specify
6976
// the counter's step (how much it should change
7077
// its value after each button press), as well as the format
7178
// used to print the value.
72-
cvui::counter(frame, 320, 120, &countFloat, 0.1, "%.1f");
79+
cvui::counter(frame, std::lround(scaling * 320), std::lround(scaling * 120), &scaling, 0.1, "%.1f", scaling*cvui::DEFAULT_FONT_SCALE, 0x50a050);
80+
81+
cvui::printf(frame, std::lround(scaling * 340), std::lround(scaling * 150), scaling*cvui::DEFAULT_FONT_SCALE, 0xCECECE, "Scaling");
7382

7483
// The trackbar component can be used to create scales.
7584
// It works with all numerical types (including chars).
76-
cvui::trackbar(frame, 420, 110, 150, &trackbarValue, 0., 50.);
85+
cvui::trackbar(frame, std::lround(scaling * 420), std::lround(scaling * 110), std::lround(scaling * 150), &trackbarValue, 0., 50., 1, "%.1Lf", 0, 1.0, scaling*cvui::DEFAULT_FONT_SCALE);
7786

7887
// Checkboxes also accept a pointer to a variable that controls
7988
// the state of the checkbox (checked or not). cvui::checkbox() will
8089
// automatically update the value of the boolean after all
8190
// interactions, but you can also change it by yourself. Just
8291
// do "checked = true" somewhere and the checkbox will change
8392
// its appearance.
84-
cvui::checkbox(frame, 200, 160, "Checkbox", &checked);
85-
cvui::checkbox(frame, 200, 190, "A checked checkbox", &checked2);
93+
cvui::checkbox(frame, std::lround(scaling * 200), std::lround(scaling * 190), "Checkbox", &checked, 0x000000, scaling*cvui::DEFAULT_FONT_SCALE);
94+
cvui::checkbox(frame, std::lround(scaling * 200), std::lround(scaling * 220), "A checked checkbox", &checked2, 0x000000, scaling*cvui::DEFAULT_FONT_SCALE);
8695

8796
// Display the lib version at the bottom of the screen
88-
cvui::printf(frame, frame.cols - 80, frame.rows - 20, 0.4, 0xCECECE, "cvui v.%s", cvui::VERSION);
97+
cvui::printf(frame, frame.cols - std::lround(scaling * 80), frame.rows - std::lround(scaling * 20), scaling*cvui::DEFAULT_FONT_SCALE, 0xCECECE, "cvui v.%s", cvui::VERSION);
8998

9099
// This function must be called *AFTER* all UI components. It does
91100
// all the behind the scenes magic to handle mouse clicks, etc.
@@ -101,4 +110,4 @@ int main(int argc, const char *argv[])
101110
}
102111

103112
return 0;
104-
}
113+
}

example/src/mouse-complex-buttons/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if(ADD_PYTHON_EXAMPLES)
1414
add_custom_command(
1515
TARGET ${ApplicationName}
1616
POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
17+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1818
)
1919
endif()

example/src/mouse-complex/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ if(ADD_PYTHON_EXAMPLES)
1414
add_custom_command(
1515
TARGET ${ApplicationName}
1616
POST_BUILD
17-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
17+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1818
)
1919
endif()

example/src/mouse/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/multiple-files/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/multiple-windows-complex-dynamic/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/multiple-windows-complex-mouse/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/multiple-windows-complex/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

example/src/multiple-windows/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ if(ADD_PYTHON_EXAMPLES)
1313
add_custom_command(
1414
TARGET ${ApplicationName}
1515
POST_BUILD
16-
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/*.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
16+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/EnhancedWindow.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
1717
)
1818
endif()

0 commit comments

Comments
 (0)