Skip to content

Commit d26d9c9

Browse files
committed
tear down
1 parent bdb83ab commit d26d9c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+355
-1118
lines changed

App/App.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
#include "Logger.h"
1313
#include "NativeRect.h"
1414
#include "Font.h"
15-
#include "../Win/Box.h"
15+
#include "../Win/WinFull.h"
16+
#include "../Win/WinPin.h"
1617
#include "../Lib/QHotKey/qhotkey.h"
1718
#include "../Tool/ToolMain.h"
1819
#include "../Tool/ToolSub.h"
19-
//#include "../Win/WinPin.h"
20-
//#include "../Tool/ColorCtrl.h"
20+
#include "../Tool/ColorCtrl.h"
2121

2222
namespace {
2323
std::unique_ptr<App> app;
@@ -41,7 +41,7 @@ void App::dispose()
4141
void App::start()
4242
{
4343
NativeRect::init();
44-
Box::init();
44+
WinFull::init();
4545
}
4646
bool App::singleAppLock()
4747
{
@@ -76,10 +76,10 @@ void App::initConfig()
7676
QJsonObject jsonObject = document.object();
7777
auto lang = jsonObject["defaultLang"].toString();
7878
Tray::initData(jsonObject["tray"].toObject(), lang);
79+
WinPin::initData(jsonObject["winPin"].toArray(), lang);
7980
ToolMain::initData(jsonObject["toolMain"].toArray(), lang);
8081
ToolSub::initData(jsonObject["toolSub"].toObject(), lang);
81-
//WinPin::initData(jsonObject["winPin"].toArray(), lang);
82-
//ColorCtrl::initData(jsonObject["colorCtrl"].toObject(), lang);
82+
ColorCtrl::initData(jsonObject["colorCtrl"].toObject(), lang);
8383
Font::initData(jsonObject["icon"].toObject());
8484
auto hotkey = new QHotkey(QKeySequence(jsonObject["hotKey"].toString()), true,qApp);
8585
QObject::connect(hotkey, &QHotkey::activated, &App::start);

App/Font.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace {
77

88
void Font::initData(const QJsonObject& obj)
99
{
10-
QFont font("Microsoft YaHei Light", 9);
10+
QFont font("Microsoft YaHei", 9);
1111
qApp->setFont(font);
1212
QString fontPath = obj["fontPath"].toString();
1313
auto result = QFontDatabase::addApplicationFont(fontPath);

App/Util.cpp

+3-33
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include <QMessageBox>
2-
#include <dwmapi.h>
3-
#include <versionhelpers.h>
42
#include "Util.h"
3+
#include "../Win/WinBox.h"
4+
5+
56

67
QMouseEvent Util::createMouseEvent(const QEvent::Type& type, const Qt::MouseButton& btn)
78
{
@@ -191,34 +192,3 @@ void Util::copyColor(const int& key)
191192
// }
192193
// }
193194
//}
194-
195-
bool Util::alphaWindow(HWND hWnd)
196-
{
197-
if (!IsWindowsVistaOrGreater()) { return false; }
198-
BOOL isCompositionEnable = false;
199-
//检查DWM是否启用
200-
DwmIsCompositionEnabled(&isCompositionEnable);
201-
if (!isCompositionEnable) { return true; }
202-
DWORD currentColor = 0;
203-
BOOL isOpaque = false;
204-
//检查是否支持毛玻璃效果
205-
DwmGetColorizationColor(&currentColor, &isOpaque);
206-
if (!isOpaque || IsWindows8OrGreater())
207-
{
208-
HRGN region = CreateRectRgn(0, 0, -1, -1);
209-
DWM_BLURBEHIND bb = { 0 };
210-
bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
211-
bb.hRgnBlur = region;
212-
bb.fEnable = TRUE;
213-
DwmEnableBlurBehindWindow(hWnd, &bb);
214-
DeleteObject(region);
215-
return true;
216-
}
217-
else // For Window7
218-
{
219-
DWM_BLURBEHIND bb = { 0 };
220-
bb.dwFlags = DWM_BB_ENABLE;
221-
DwmEnableBlurBehindWindow(hWnd, &bb);
222-
return false;
223-
}
224-
}

App/Util.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ class Util
2020
static QScreen* getScreen(const int& x, const int& y);
2121
static void setClipboardText(const std::wstring& text);
2222
static void copyColor(const int& key);
23-
static bool alphaWindow(HWND hWnd);
2423
};
2524

Doc/窗口绘图.md

-47
This file was deleted.

ScreenCapture.vcxproj

+59-33
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
<Import Project="$(QtMsBuild)\qt_defaults.props" />
3737
</ImportGroup>
3838
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
39-
<QtInstall>6.8.3_msvc2022_64</QtInstall>
40-
<QtModules>core;gui;widgets;concurrent;opengl;openglwidgets</QtModules>
39+
<QtInstall>6.8.0_msvc2022_64</QtInstall>
40+
<QtModules>core;gui;widgets;concurrent</QtModules>
4141
<QtBuildConfig>debug</QtBuildConfig>
4242
</PropertyGroup>
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
4444
<QtInstall>6.8.3-static_msvc2022_64</QtInstall>
45-
<QtModules>core;gui;widgets;concurrent;opengl;openglwidgets</QtModules>
45+
<QtModules>core;gui;widgets;concurrent</QtModules>
4646
<QtBuildConfig>release</QtBuildConfig>
4747
</PropertyGroup>
4848
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
@@ -76,9 +76,6 @@
7676
<Link>
7777
<AdditionalDependencies>dwmapi.lib;shcore.lib;%(AdditionalDependencies)</AdditionalDependencies>
7878
</Link>
79-
<Manifest>
80-
<EnableDpiAwareness>false</EnableDpiAwareness>
81-
</Manifest>
8279
</ItemDefinitionGroup>
8380
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8481
<ClCompile>
@@ -89,9 +86,6 @@
8986
<Link>
9087
<AdditionalDependencies>dwmapi.lib;shcore.lib;%(AdditionalDependencies)</AdditionalDependencies>
9188
</Link>
92-
<Manifest>
93-
<EnableDpiAwareness>false</EnableDpiAwareness>
94-
</Manifest>
9589
</ItemDefinitionGroup>
9690
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
9791
<ClCompile>
@@ -127,44 +121,54 @@
127121
<ClCompile Include="App\NativeRect.cpp" />
128122
<ClCompile Include="App\Logger.cpp" />
129123
<ClCompile Include="App\Font.cpp" />
130-
<ClCompile Include="main.cpp" />
131-
<ClCompile Include="Lib\QHotKey\qhotkey.cpp" />
132-
<ClCompile Include="Lib\QHotKey\qhotkey_win.cpp" />
133-
<ClCompile Include="App\Tray.cpp" />
134-
<ClCompile Include="App\Util.cpp" />
124+
<ClCompile Include="Shape\ShapeArrow.cpp" />
135125
<ClCompile Include="Shape\ShapeBase.cpp" />
126+
<ClCompile Include="Shape\ShapeEllipse.cpp" />
127+
<ClCompile Include="Shape\ShapeEraserLine.cpp" />
128+
<ClCompile Include="Shape\ShapeEraserRect.cpp" />
129+
<ClCompile Include="Shape\ShapeLine.cpp" />
130+
<ClCompile Include="Shape\ShapeLineBase.cpp" />
131+
<ClCompile Include="Shape\ShapeMosaicLine.cpp" />
132+
<ClCompile Include="Shape\ShapeMosaicRect.cpp" />
133+
<ClCompile Include="Shape\ShapeNumber.cpp" />
136134
<ClCompile Include="Shape\ShapeRect.cpp" />
137135
<ClCompile Include="Shape\ShapeRectBase.cpp" />
136+
<ClCompile Include="Shape\ShapeText.cpp" />
137+
<ClCompile Include="Shape\ShapeTextContainer.cpp" />
138+
<ClCompile Include="Shape\ShapeTextInput.cpp" />
138139
<ClCompile Include="Tool\ColorCtrl.cpp" />
140+
<ClCompile Include="main.cpp" />
141+
<ClCompile Include="Lib\QHotKey\qhotkey.cpp" />
142+
<ClCompile Include="Lib\QHotKey\qhotkey_win.cpp" />
143+
<ClCompile Include="App\Tray.cpp" />
144+
<ClCompile Include="Tool\PixelInfo.cpp" />
139145
<ClCompile Include="Tool\StrokeCtrl.cpp" />
140146
<ClCompile Include="Tool\ToolBase.cpp" />
141147
<ClCompile Include="Tool\ToolBtn.cpp" />
142148
<ClCompile Include="Tool\ToolMain.cpp" />
143149
<ClCompile Include="Tool\ToolSub.cpp" />
144-
<ClCompile Include="Win\Box.cpp" />
145-
<ClCompile Include="Win\Canvas.cpp" />
146-
<ClCompile Include="Win\Magnifier.cpp" />
147-
<ClCompile Include="Win\Mask.cpp" />
148-
<ClCompile Include="Win\Bg.cpp" />
150+
<ClCompile Include="App\Util.cpp" />
151+
<ClCompile Include="Win\WinBase.cpp" />
152+
<ClCompile Include="Win\WinBoard.cpp" />
153+
<ClCompile Include="Win\WinBox.cpp" />
154+
<ClCompile Include="Win\WinCanvas.cpp" />
155+
<ClCompile Include="Win\WinFull.cpp" />
156+
<ClCompile Include="Win\WinMask.cpp" />
157+
<ClCompile Include="Win\WinPin.cpp" />
149158
</ItemGroup>
150159
<ItemGroup>
151-
<QtMoc Include="Tool\StrokeCtrl.h" />
152-
<QtMoc Include="Tool\ColorCtrl.h" />
153-
<QtMoc Include="Shape\ShapeBase.h" />
154-
<QtMoc Include="Shape\ShapeRect.h" />
155-
<QtMoc Include="Shape\ShapeRectBase.h" />
156-
<ClInclude Include="Tool\ToolBtn.h" />
157-
<QtMoc Include="Tool\ToolSub.h" />
158-
<QtMoc Include="Tool\ToolMain.h" />
159-
<QtMoc Include="Tool\ToolBase.h" />
160-
<QtMoc Include="Win\Mask.h" />
161-
<QtMoc Include="Win\Magnifier.h" />
162-
<QtMoc Include="Win\Canvas.h" />
163-
<QtMoc Include="Win\Box.h" />
164-
<QtMoc Include="Win\Bg.h" />
165160
<QtMoc Include="App\About.h" />
166161
<ClInclude Include="App\App.h" />
167162
<ClInclude Include="App\Util.h" />
163+
<QtMoc Include="Win\WinBox.h" />
164+
<QtMoc Include="Win\WinBoard.h" />
165+
<QtMoc Include="Win\WinMask.h" />
166+
<QtMoc Include="Win\WinCanvas.h" />
167+
<QtMoc Include="Win\WinBase.h" />
168+
<QtMoc Include="Tool\StrokeCtrl.h" />
169+
<QtMoc Include="Tool\ColorCtrl.h" />
170+
<QtMoc Include="Shape\ShapeBase.h" />
171+
<QtMoc Include="Shape\ShapeArrow.h" />
168172
<ClInclude Include="App\NativeRect.h" />
169173
<ClInclude Include="App\Res.h" />
170174
<ClInclude Include="App\Font.h" />
@@ -186,15 +190,37 @@
186190
<ClInclude Include="Lib\spdlog\tweakme.h" />
187191
<ClInclude Include="Lib\spdlog\version.h" />
188192
<QtMoc Include="App\Logger.h" />
193+
<ClInclude Include="Shape\ShapeEllipse.h" />
194+
<QtMoc Include="Shape\ShapeRect.h" />
195+
<QtMoc Include="Shape\ShapeNumber.h" />
196+
<QtMoc Include="Shape\ShapeLine.h" />
197+
<QtMoc Include="Shape\ShapeRectBase.h" />
198+
<QtMoc Include="Shape\ShapeLineBase.h" />
199+
<QtMoc Include="Shape\ShapeEraserRect.h" />
200+
<QtMoc Include="Shape\ShapeEraserLine.h" />
201+
<QtMoc Include="Shape\ShapeMosaicRect.h" />
202+
<QtMoc Include="Shape\ShapeMosaicLine.h" />
203+
<ClInclude Include="Shape\ShapeState.h" />
204+
<QtMoc Include="Shape\ShapeText.h" />
205+
<QtMoc Include="Shape\ShapeTextInput.h" />
206+
<QtMoc Include="Tool\PixelInfo.h" />
207+
<QtMoc Include="Tool\ToolBase.h" />
208+
<QtMoc Include="Shape\ShapeTextContainer.h" />
209+
<ClInclude Include="Tool\ToolBtn.h" />
210+
<QtMoc Include="Tool\ToolMain.h" />
211+
<QtMoc Include="Tool\ToolSub.h" />
212+
<QtMoc Include="Win\WinPin.h" />
189213
<QtMoc Include="Lib\QHotKey\qhotkey_p.h" />
190214
<QtMoc Include="Lib\QHotKey\qhotkey.h" />
191215
<ClInclude Include="App\State.h" />
216+
<QtMoc Include="Win\WinFull.h" />
192217
<QtMoc Include="App\Tray.h" />
193218
</ItemGroup>
194219
<ItemGroup>
195220
<None Include="Config\config.json" />
196221
<None Include="ReadMe.md" />
197222
<None Include="todo.md" />
223+
<None Include="Doc\高亮窗口.md" />
198224
</ItemGroup>
199225
<ItemGroup>
200226
<Font Include="Config\iconfont.ttf" />

0 commit comments

Comments
 (0)