Skip to content

Commit 2576f4d

Browse files
author
Sebi
committed
Merge remote-tracking branch 'remotes/origin/main' into feature/direct_typing
Fixing conflicts and little error in destructor
2 parents 1282660 + 1ef7fb1 commit 2576f4d

File tree

7 files changed

+25
-8
lines changed

7 files changed

+25
-8
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ add_subdirectory("Thirdparty/nativefiledialog-extended")
5858
# DasherUI
5959
###############################
6060

61-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
61+
IF (WIN32)
62+
# Hide console window
63+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
64+
ENDIF()
65+
6266
ADD_Executable(DasherUI
6367
${PROJECT_SOURCE_DIR}/src/DasherController.cpp
6468
${PROJECT_SOURCE_DIR}/src/DasherController.h

DasherCore

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# DasherUI
2+
This repository features a simple UI, written in ImGui, for the DasherCore backend. Its main purpose is the testing/development of the DasherCore library. So it is not meant for pretty looks or actual usability.
3+
4+
## Cloning and Building
5+
1. Clone the repository with all submodules: `git clone --recursive https://github.com/PapeCoding/DasherUI.git ./DasherUI`
6+
2. Generate some project files with CMake:
7+
* `cd ./DasherUI && mkdir build && cd build`
8+
* `cmake ..`
9+
3. Build the project with the selected build system (e.g. Visual Studio on Windows or `make` on Linux)
10+
11+
## Participate
12+
If you want to modernize some code within DasherCore or add UI features to the DasherUI repository, feel free to send a pull request!

src/DasherController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include "DasherUIScreen.h"
55
#include "imgui.h"
66
#include "imgui_internal.h"
7+
#include <memory>
8+
79
#include "SocketInput.h"
810

911

src/DasherUIScreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void DasherUIScreen::DrawRectangle(Dasher::screenint x1, Dasher::screenint y1, D
3333

3434
if(iThickness > 0)
3535
{
36-
const Dasher::CColourIO::ColourInfo::PaletteColor OutlineColor = this->pColorScheme->Colors[Colour];
36+
const Dasher::CColourIO::ColourInfo::PaletteColor OutlineColor = this->pColorScheme->Colors[iOutlineColour > 0 ? iOutlineColour : 3]; //Apparently Outline Color 3 is the default
3737
const ImVec4 ImOutlineColor = { static_cast<float>(OutlineColor.Red) / 255.0f, static_cast<float>(OutlineColor.Green) / 255.0f, static_cast<float>(OutlineColor.Blue) / 255.0f, 1.0f };
3838

3939
ImGui::GetWindowDrawList()->AddRect(CanvasPos + p1, CanvasPos + p2, ImGui::ColorConvertFloat4ToU32(ImOutlineColor),0,0, static_cast<float>(iThickness));
@@ -49,7 +49,7 @@ void DasherUIScreen::DrawCircle(Dasher::screenint iCX, Dasher::screenint iCY, Da
4949

5050
if (iLineWidth > 0)
5151
{
52-
const Dasher::CColourIO::ColourInfo::PaletteColor OutlineColor = this->pColorScheme->Colors[iLineColour];
52+
const Dasher::CColourIO::ColourInfo::PaletteColor OutlineColor = this->pColorScheme->Colors[iLineColour > 0 ? iLineColour : 3];
5353
const ImVec4 ImOutlineColor = { static_cast<float>(OutlineColor.Red) / 255.0f, static_cast<float>(OutlineColor.Green) / 255.0f, static_cast<float>(OutlineColor.Blue) / 255.0f, 1.0f };
5454

5555
ImGui::GetWindowDrawList()->AddCircle(CanvasPos + ImVec2(static_cast<float>(iCX), static_cast<float>(iCY)), static_cast<float>(iR), ImGui::ColorConvertFloat4ToU32(ImFillColor),0, static_cast<float>(iLineWidth));

src/SocketInput.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void SocketInput::stopListen()
9797
{
9898
keepListenServerAlive = false;
9999
keepReadThreadAlive = false;
100-
session_acceptor->close();
101-
open_socket->close();
102-
receiveThread.join();
100+
if(session_acceptor) session_acceptor->close();
101+
if(open_socket) open_socket->close();
102+
if(receiveThread.joinable()) receiveThread.join();
103103
}

src/SocketInput.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class SocketInput : public Dasher::CScreenCoordInput, public Dasher::CDefaultFil
1616
void startListen();
1717
void stopListen();
1818

19-
bool GetSettings(SModuleSettings** sets, int* iCount) override;
2019
private:
2120
bool relativeMode;
2221
double lastRelativeX = 0.5;

0 commit comments

Comments
 (0)